Subject: /bin/sh errors on install?
To: None <tech-pkg@NetBSD.org>
From: Stuart Shelton <stuart@zeus.com>
List: tech-pkg
Date: 03/17/2006 11:51:12
Just recently I've found that many packages (including rsync, pkglint,
pkg_comp) are building fine, but on running "bmake install", "bmake
update", "bmake replace", etc. I get the error:

/usr/bsd/src/pkgtools/pkglint $ bmake update
===> do-su-deinstall [pkglint-4.59] ===> Deinstalling for pkglint
Running /usr/bsd/bin/env /usr/bsd/sbin/pkg_delete -K /usr/bsd/var/db/pkg
-r pkglint-4.58
pkg_delete: couldn't open dependency file
`/usr/bsd/var/db/pkg/p5-pkgsrc-Dewey-1.0nb1/+REQUIRED_BY'
===> do-fetch [pkglint-4.59] ===> Checking for vulnerabilities in
pkglint-4.59
===> do-su-install [pkglint-4.59] ===> Installing for pkglint-4.59
/bin/sh: syntax error at line 1 : `do' unexpected
*** Error code 2

Stop.
bmake: stopped in /usr/bsd/src/pkgtools/pkglint
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/src/pkgtools/pkglint
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/src/pkgtools/pkglint
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/src/pkgtools/pkglint

(I also note that if I make /bin/sh a symlink to bash, then the error is
"/bin/sh -c: syntax error...")

I've filed this at Bug pkg/33088, but now I'm finding that more and more
packages are affected this is becoming a serious problem.

Can anyone suggest how I might fix this?  The problem seems to be
related to mk/bsd.pkg.mk (or something included by it) - but I cannot
see what.

Thanks in advance,

	Stuart