pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/bulk With the most recent pkg_install, directories ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/606153d291e3
branches:  trunk
changeset: 395595:606153d291e3
user:      he <he%pkgsrc.org@localhost>
date:      Thu Jul 09 12:46:49 2009 +0000

description:
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:

 mk/bulk/build |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (41 lines):

diff -r c05f7f2c54aa -r 606153d291e3 mk/bulk/build
--- a/mk/bulk/build     Thu Jul 09 11:54:39 2009 +0000
+++ b/mk/bulk/build     Thu Jul 09 12:46:49 2009 +0000
@@ -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@localhost>
@@ -260,6 +260,7 @@
                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 @@
                                $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 () {
 



Home | Main Index | Thread Index | Old Index