slackpkg upgrade-all: comm: file 2 is not in sorted order
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
slackpkg upgrade-all: comm: file 2 is not in sorted order
Hi, after executing slackpkg upgrade-all i'm getting:
Code:
Checking local integrity... DONE
Looking for packages to upgrade. Please wait... comm: file 2 is not in sorted order
DONE
No packages match the pattern for upgrade. Try:
/usr/sbin/slackpkg install|reinstall
I found the message related to the next lines in /usr/libexec/slackpkg/core-functions.sh (while debugging with set -x):
Code:
643 upgrade-all)
644 listpkgname
645 for i in $(comm -1 -2 ${TMPDIR}/lpkg ${TMPDIR}/dpkg | \
646 comm -1 -2 - ${TMPDIR}/spkg) ; do
647
My first workaround was to use the --nocheck-order option (from comm manpage) which removes the message but it seems that the real problem comes from the function listpkgname:
Code:
526 # Creates files with mirror package names (spkg), local package
527 # names (lpkg) and packages unique to one or other file (dpkg)
528 #
529 function listpkgname() {
530 cut -f2 -d\ ${TMPDIR}/pkglist | sort > ${TMPDIR}/spkg
531 cut -f2 -d\ ${TMPDIR}/tmplist | sort > ${TMPDIR}/lpkg
532 cat ${TMPDIR}/pkglist ${TMPDIR}/tmplist | \
533 cut -f2-6 -d\ |sort | uniq -u | \
534 cut -f1 -d\ | uniq > ${TMPDIR}/dpkg
535 }
The content of pkglist and tmplist (lines #532 to #534) are processed two times, first time is cut-sort-uniq and the second time cut-uniq but never sort, so after the next modification the message also goes away:
Perhaps this is a locale issue.
From /etc/profile.d/lang.sh
Code:
# One side effect of the newer locales is that the sort order
# is no longer according to ASCII values, so the sort order will
# change in many places. Since this isn't usually expected and
# can break scripts, we'll stick with traditional ASCII sorting.
# If you'd prefer the sort algorithm that goes with your $LANG
# setting, comment this out.
export LC_COLLATE=C
The LANGUAGE variable, that comes handy to set a priority list of languages, is a GNU extension and as such non portable.
Avoid to set LC_ALL system wide, as that overrides all other settings.
For internationalization, preferably only set LANG. That's generally enough to get messages in your preferred language.
Better keep LC_COLLATE set to C as pointed out by allend, when sorting is involved. Additionally this makes sorting faster in scripts probably because then we sort only one byte characters. Only exception: if you need to sort messages written using characters beyond the ASCII set, on a case by case basis.
Additionally, for folks using character classes in grep and sed, 7.3.1 LC_CTYPE is a must read.
Generally, the effect of setting LC_something to a specific locale stated in /usr/share/i18n/locale/<locale name> as a list of Unicode code points (there is also one for the POSIX locale). The Unicode code point of each character can be found e.g. in this handy table.
Last edited by Didier Spaier; 07-11-2015 at 11:23 PM.
Reason: URL fixed
Your fix is unnecessary in standard Slackware. If you want to use a custom environment, then you will need to maintain that on your setup, which, as you have demonstrated, is easy to do in this instance. Just be aware that your fix will be overwritten if the slackpkg package is upgraded or reinstalled.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.