Subject: pkg/31277: pkg_chk requires absolute path for -C
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <kivinen@iki.fi>
List: pkgsrc-bugs
Date: 09/09/2005 10:09:00
>Number:         31277
>Category:       pkg
>Synopsis:       pkg_chk requires absolute path for -C pkgchk.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 09 10:09:00 +0000 2005
>Originator:     Tero Kivinen
>Release:        NetBSD 2.0.2_STABLE
>Organization:
Safenet
>Environment:
System:  NetBSD  ryijy.hel.internal 2.0.2_STABLE NetBSD 2.0.2_STABLE (GENERIC) #0: Tue Sep 6 21:06:50 EEST 2005 root@ryijy.hel.internal:/usr/obj/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:

	The  pkg_chk requires absolute path for the -C option. This is
	because the extract_variables does a cd to the
	$PKGSRCDIR/pkgtools/pkg_chk and after that relative path
	of the pkgchk.conf stored in the opt_C does not work

>How-To-Repeat:

	run

	cd /usr/pkgsrc; pkg_chk -a -C pkgchk.conf

	and you notice that it does not install anything, nor does it
	print out error messages, it simply exits with error value 1
	without doing anything.


>Fix:

	Either check if the path given to opt_C is relative and
	convert it to absolute while parsing the option list, or
	change all cases where pkg_chk uses cd to change to another
	directory so they will change back to old directory after
	doing their work.