-   Slackware (
-   -   Bug in slackpkg -- fail to find installed package? (

grissiom 06-22-2009 12:13 PM

Bug in slackpkg -- fail to find installed package?
slackpkg say I don't have qt3 package installed. But actually I have...


        root 2009-06-22 23:17 @darkstar
/ext4/slackware_rsync# slackpkg search qt3

The list below shows all packages with the selected pattern.

[ installed ] - kdebase-runtime-4.2.4-x86_64-1
[ installed ] - qt-r964497-x86_64-1
[uninstalled] - qt3-3.3.8b-x86_64-opt2

        root 2009-06-22 23:17 @darkstar
/ext4/slackware_rsync# ls /var/log/packages|grep qt3

        root 2009-06-23 0:10 @darkstar

willysr 06-22-2009 03:44 PM

You need to mention slackpkg version :)

grissiom 06-23-2009 12:41 PM

Oh, I always stay with current. So the version is slackpkg-2.71.2-noarch-2

mRgOBLIN 06-23-2009 04:37 PM

Thanks for the report. It was a bug and should be fixed in the next slackpkg release.

grissiom 07-15-2009 08:08 PM

Bug still exits in slackpkg - version 2.80.1

mRgOBLIN 07-15-2009 08:57 PM

Yes so it is.

Will run it past PiterPunk

niels.horn 07-16-2009 12:10 AM

The problem lies in the "opt2" extension of the slackpkg script.

In /usr/sbin/slackpkg at line 464 you'll find:

INSTPKG=$(ls -1 /var/log/packages | \
        grep -e "^${BASENAME}-[^-]\+-\(${ARCH}\|fw\|noarch\)-[[:digit:]]\+")

Most packages end with the "build-version" like -1, -2, -3 etc.

The qt3 package is optional and ends with -opt2 and therefore is not found as "installed" by Slackpkg.

The solution would be to change the line as follows:


INSTPKG=$(ls -1 /var/log/packages | \
        grep -e "^${BASENAME}-[^-]\+-\(${ARCH}\|fw\|noarch\)-[[:alpha:]]*[[:digit:]]\+")

This seems to work, as "slackpkg search qt3" returns:

[ installed ] - kdebase-runtime-4.2.4-x86_64-1
[ installed ] - qt-r994599-x86_64-1
[ installed ] - qt3-3.3.8b-x86_64-opt2

Note: I am not an expert, just a big fan of Slackpkg and have made some changes in the scripts before :)

mRgOBLIN 07-16-2009 02:23 AM

Thanks niels, yes we knew what the problem was but I think PP forgot to apply the fix :)

niels.horn 07-16-2009 06:26 AM


By the way, the same little bug also crept into the "info" function of Slackpkg.

"slackpkg info qt3" gives this result:

No packages found! Try:

        slackpkg search qt3

and choose one (and ONLY one package).

Changing the function like this (lines 484+):

                PATTERN=`echo $INPUTLIST | sed -e 's/\+/\\\+/g' -e 's/\./\\\./g'`
                NAME=$(cutpkg $PATTERN)
                awk -F: "/PACKAGE NAME:.* ${NAME}-[^-]+-(${ARCH}|fw|noarch)-[[:alpha:]]*[[:digit:]]+/,/^$/ {
                                if (\$1 ~ /"$NAME"/) {
                                print \$PATTERN
                                } else {
                                print \$0
                        END {
                                if ( found != 1 ) {
                        print \"No packages found! Try:\n\n\tslackpkg search $PATTERN\n\nand choose one (and ONLY one package).\n\"
                        }" ${WORKDIR}/PACKAGES.TXT 2>/dev/null

solved it as well!

All times are GMT -5. The time now is 11:48 AM.