tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Weirdness in /bin/sh of 8.0



I am a user of pkg_chk (pkgtools/pkg_chk) to keep my packages up to
date. One step in this process is calling "pkg_chk -vak": verbose, add
packages, keep going in case of error.

Starting with 8.0 this stopped working. It worked fine in 7.0.

Normal procedure is that pkg_chk first determines the list of wanted
packages, and then it checks if those are correctly installed. In 8.0,
the second part doesn't happen. It just stops after printing the package
list:

$ pkg_chk -vak
ARGV: -vak
Variable: MAKECONF = /etc/mk.conf
Variable: PKGSRCDIR = (using default)
Variable: LOCALBASE = (using default)
Variable: AWK = /usr/bin/awk
Variable: GREP = /usr/bin/grep
Variable: GZCAT = /usr/bin/gzcat
Variable: GZIP_CMD = /usr/bin/gzip -nf -9
Variable: ID = /usr/bin/id
Variable: PACKAGES = /mnt/vol1/rhialto/cvs/pkgsrc/packages
Variable: PKGCHK_CONF =
Variable: PKGCHK_NOTAGS =
Variable: PKGCHK_TAGS =
Variable: PKGCHK_UPDATE_CONF =
Variable: PKG_ADD = /usr/pkg/sbin/pkg_add -K /var/db/pkg
Variable: PKG_DBDIR = /var/db/pkg
Variable: PKG_DELETE = /usr/pkg/sbin/pkg_delete -K /var/db/pkg
Variable: PKG_ADMIN = /usr/pkg/sbin/pkg_admin -K /var/db/pkg
Variable: PKG_INFO = /usr/pkg/sbin/pkg_info -K /var/db/pkg
Variable: PKG_SUFX = .tgz
Variable: SED = /usr/bin/sed
Variable: SORT = /usr/bin/sort
Variable: SU_CMD = /usr/bin/su - root -c
Variable: TSORT = tsort -q
Append to PKGDIRLIST based on config /usr/pkgsrc/pkgchk.conf
Variable: OPSYS = NetBSD
Variable: OS_VERSION = 8.0
Variable: MACHINE_ARCH = x86_64
unset TAGS=
set   TAGS=murthe,murthe.falu.nl,NetBSD-8.0-x86_64,NetBSD-8.0,NetBSD-x86_64,NetBSD,8.0,x86_64,x11
/usr/bin/awk -v alreadyset= -v
set_tags=murthe,murthe.falu.nl,NetBSD-8.0-x86_64,NetBSD-8.0,NetBSD-x86_64,NetBSD,8.0,x86_64,x11 -v unset_tags=
pkgtools/pkg_chk pkgtools/pkg_install pkgtools/pkgdiff pkgtools/pkgin
pkgtools/nih archivers/bzip2 archivers/lha archivers/macutil
archivers/par2 archivers/p7zip archivers/undms archivers/unlzx
archivers/unrar archivers/unzip archivers/zip ...more packages...
$

Weirdly enough, if I leave out the -v, it works (but prints no verbose
output):

$ pkg_chk -ak
pkgtools/pkg_install - pkg_install-20180325 < pkg_install-20180425
...

If I run "bash /usr/pkg/sbin/pkg_chk -vak", it also works....

This looks like a regression (or a subtle bug in the script)...

With some debugging I have already determined that it goes wrong around
here:

if [ -n "$opt_a" -o -n "$opt_l" ];then	# Append to PKGDIRLIST based on conf
    verbose "Append to PKGDIRLIST based on config $PKGCHK_CONF"
    PKGDIRLIST="$(pkgdirs_from_conf $PKGCHK_CONF $PKGDIRLIST)"
fi

where PKGDIRLIST gets an empty value, even though the pkgdirs_from_conf
function determines, and echos, the correct list. I can see that if I
run "sh -x /usr/pkg/sbin/pkg_chk -vak".

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- Wayland: Those who don't understand X
\X/ rhialto/at/falu.nl      -- are condemned to reinvent it. Poorly.

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index