Subject: pkg/32351: make readme fails when packages directory is missing
To: None <,,>
From: None <>
List: pkgsrc-bugs
Date: 12/21/2005 11:05:01
>Number:         32351
>Category:       pkg
>Synopsis:       make readme fails when packages directory is missing
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 21 11:05:00 +0000 2005
>Originator:     Christian Hattemer
>Release:        3.0
NetBSD webster 3.0 NetBSD 3.0 (WEBSTER-TMP) #1: Tue Dec 20 19:48:09 CET 2005  krille@webster:/usr/src/sys/arch/i386/compile/WEBSTER-TMP i386
"make readme" fails when the directory containing the binary packages is missing. This happens e.g. when PACKAGES is set to /usr/local/packages/${OS_VERSION}/${MACHINE_ARCH} and the system is updated to a new version.
Make $PACKAGES point to a nonexisting directory

cd /usr/pkgsrc/lang/perl5
make readme

---->  Creating new database in /usr/pkgsrc/lang/perl5/README.html.tmp1
---->  Depending in /usr/pkgsrc/lang/perl5 (pass #1)
Complete dependency database left in /usr/pkgsrc/lang/perl5/README.html.tmp1
Reading database file
Making sure binary package cache file is up to date...
Packages directory /usr/local/packages/3.0/i386 seems to be missing

**** WARNING ****
Command: /usr/bin/env AWK=/usr/bin/awk CMP=/usr/bin/cmp FIND= GREP=/usr/bin/grep PKG_INFO="/usr/bin/env  /usr/sbin/pkg_info -K /var/db/pkg" PKG_SUFX=.tgz SED=/usr/bin/sed SORT=/usr/bin/sort /usr/pkgsrc/mk/scripts/binpkg-cache --packages /usr/local/packages/3.0/i386
failed.**** ------- ****
*** Error code 1

make: stopped in /usr/pkgsrc/lang/perl5
*** Error code 1

make: stopped in /usr/pkgsrc/lang/perl5

Since listing the available binary packages isn't really essential for the readme files the process should continue withouth them.

Either binpkg-cache could return a code to indicate that no data is available which genreadme.awk would use to place a notice about the condition in the readme files, or genreadme.awk could ignore the return code of binpkg-cache completely.

BTW: In case of a failure it would also be nice to clean up the database file.