Subject: bin/32024: pkg_admin ls{all,best} don't set return code properly
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <hubert@feyrer.de>
List: netbsd-bugs
Date: 11/09/2005 08:43:00
>Number:         32024
>Category:       bin
>Synopsis:       pkg_admin ls{all,best} don't set return code properly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 09 08:43:00 +0000 2005
>Originator:     hubert@feyrer.de
>Release:        NetBSD 2.0
>Organization:
Hubert Feyrer <hubertf@gmx.de>
>Environment:
	
	
System: NetBSD vulab.fh-regensburg.de 2.0 NetBSD 2.0 (GENERIC) #14: Wed Jan 5 20:02:56 CET 2005 feyrer@vulab.fh-regensburg.de:/disk4/cvs/src-2.0/sys/arch/i386/compile/obj.i386/GENERIC i386
Architecture: i386
Machine: i386
>Description:
	pkg_admin ls{all,best} do not indicate if an data was actually printed
	by setting the return code appropriately.
	It is always 0 while it should be 1 if no output is made
	(think "pkg_info -qe")

>How-To-Repeat:
	noon% pkg_admin -bS lsall /var/db/pkg/tcsh\*
	tcsh-6.14.00nb1
	noon% echo $?
	0
	noon% pkg_admin -bS lsall /var/db/pkg/tcsxh\*
	noon% echo $?
	0

	The latter should print 1 (assuming there is no such pkg
	installed).

>Fix:
	somewhere in the guts of pkg_install.
	I'm willing (requesting) to review patches.

>Unformatted:
 	noon% pkg_admin -V
 	20050530