summaryrefslogtreecommitdiff
path: root/mk/bulk
diff options
context:
space:
mode:
authorhe <he@pkgsrc.org>2009-07-09 12:46:49 +0000
committerhe <he@pkgsrc.org>2009-07-09 12:46:49 +0000
commit0407af4bdbcd55dd9c9b697dd1805166d17b9b22 (patch)
treed8a48e89afdfc8d5aa057d50e1c6b48af1d3234a /mk/bulk
parent33a91ad060be8fd43c96314f00230277b228ae35 (diff)
downloadpkgsrc-0407af4bdbcd55dd9c9b697dd1805166d17b9b22.tar.gz
With the most recent pkg_install, directories are removed when the
last file in a directory is removed. This might cause common and expected-to-be-existing directories in /usr/pkg to be removed, and a subsequent attempt at installing a file to the now non-existent directory will instead create a file with the name of the expected directory. This will create PLIST errors for the package in question, but also will cause the erroneously named file to not be removed on package removal. This can cause cascading bulk build failures for subsequent packages. To prevent this, after each package is done, check if some of the common top-level expected-to-be directories are now files, and remove them and emit an error message if so. I *think* I already fixed the single package which had the unfortunate problem of not declaring "include" as an installation directory, but this should prevent the problem from re-occurring in the future as well. Thanks to joerg@ for the hint for pulling in the value of PREFIX.
Diffstat (limited to 'mk/bulk')
-rw-r--r--mk/bulk/build13
1 files changed, 12 insertions, 1 deletions
diff --git a/mk/bulk/build b/mk/bulk/build
index 135dc8cf418..f9a2f4430ee 100644
--- a/mk/bulk/build
+++ b/mk/bulk/build
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: build,v 1.105 2008/06/13 21:52:16 sketch Exp $
+# $NetBSD: build,v 1.106 2009/07/09 12:46:49 he Exp $
#
# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@NetBSD.org>
@@ -260,6 +260,7 @@ load_vars () {
BULK_DBFILE DEPENDSFILE INDEXFILE ORDERFILE STARTFILE
SUPPORTSFILE BULK_BUILD_ID_FILE BUILDLOG BROKENFILE
BROKENWRKLOG
+ PREFIX
AWK GREP MAIL_CMD MKDIR PAX PERL5 SED
PKG_DELETE PKG_INFO PKGBASE"
@@ -333,12 +334,22 @@ do_real_bulk_build () {
$makeargs </dev/null | post_filter_cmd
) || true
echo "$pkgdir" >> "${main_buildlog}"
+ check_pkg_dirs
fi
done
echo "build> Build finished."
}
+check_pkg_dirs () {
+ for d in bin etc include info lib libexec man sbin share; do
+ if [ -f $PREFIX/$d ]; then
+ echo "Removing file, should be dir: $PREFIX/$d" >&2
+ rm -f $PREFIX/$d
+ fi
+ done
+}
+
# clean up installed packages left over
do_bulk_cleanup () {