LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 06-22-2009, 11:13 AM   #1
grissiom
Member
 
Registered: Apr 2008
Location: China, Beijing
Distribution: Slackware
Posts: 411

Rep: Reputation: 45
Bug in slackpkg -- fail to find installed package?


slackpkg say I don't have qt3 package installed. But actually I have...

Code:
        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
qt3-3.3.8b-x86_64-opt2

        root 2009-06-23 0:10 @darkstar
/ext4/slackware_rsync#
 
Old 06-22-2009, 02:44 PM   #2
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 2,493

Rep: Reputation: 403Reputation: 403Reputation: 403Reputation: 403Reputation: 403
You need to mention slackpkg version
 
Old 06-23-2009, 11:41 AM   #3
grissiom
Member
 
Registered: Apr 2008
Location: China, Beijing
Distribution: Slackware
Posts: 411

Original Poster
Rep: Reputation: 45
Oh, I always stay with current. So the version is slackpkg-2.71.2-noarch-2
 
Old 06-23-2009, 03:37 PM   #4
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 226Reputation: 226Reputation: 226
Thanks for the report. It was a bug and should be fixed in the next slackpkg release.
 
Old 07-15-2009, 07:08 PM   #5
grissiom
Member
 
Registered: Apr 2008
Location: China, Beijing
Distribution: Slackware
Posts: 411

Original Poster
Rep: Reputation: 45
Bug still exits in slackpkg - version 2.80.1
 
Old 07-15-2009, 07:57 PM   #6
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 226Reputation: 226Reputation: 226
Yes so it is.

Will run it past PiterPunk
 
Old 07-15-2009, 11:10 PM   #7
niels.horn
Senior Member
 
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004

Rep: Reputation: 89
The problem lies in the "opt2" extension of the slackpkg script.

In /usr/sbin/slackpkg at line 464 you'll find:
Code:
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:

Code:
INSTPKG=$(ls -1 /var/log/packages | \
	grep -e "^${BASENAME}-[^-]\+-\(${ARCH}\|fw\|noarch\)-[[:alpha:]]*[[:digit:]]\+")
This seems to work, as "slackpkg search qt3" returns:
Code:
[ 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
 
Old 07-16-2009, 01:23 AM   #8
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 226Reputation: 226Reputation: 226
Thanks niels, yes we knew what the problem was but I think PP forgot to apply the fix
 
Old 07-16-2009, 05:26 AM   #9
niels.horn
Senior Member
 
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004

Rep: Reputation: 89
ok!

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

"slackpkg info qt3" gives this result:
Code:
No packages found! Try:

	slackpkg search qt3

and choose one (and ONLY one package).
Changing the function like this (lines 484+):
Code:
	"info")
		PATTERN=`echo $INPUTLIST | sed -e 's/\+/\\\+/g' -e 's/\./\\\./g'`
		NAME=$(cutpkg $PATTERN)
		awk -F: "/PACKAGE NAME:.* ${NAME}-[^-]+-(${ARCH}|fw|noarch)-[[:alpha:]]*[[:digit:]]+/,/^$/ {
                                found=1
				 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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pkg-config can't find installed package JAKK Slackware 16 08-11-2008 09:07 AM
how to find a package installed ? jabka Debian 3 09-06-2007 07:59 PM
How to find out if you have a specific package installed? AriciU Slackware 2 07-08-2007 10:58 PM
How to find if package is installed Redbone981sl Ubuntu 4 01-23-2007 06:03 PM
How to find the complete path of an installed package samik Linux - Newbie 1 10-26-2003 02:19 PM


All times are GMT -5. The time now is 08:23 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration