diff options
Diffstat (limited to 'mk/bulk/pre-build')
-rw-r--r-- | mk/bulk/pre-build | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/mk/bulk/pre-build b/mk/bulk/pre-build index 4ae1398ba77..bf74926ef5a 100644 --- a/mk/bulk/pre-build +++ b/mk/bulk/pre-build @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: pre-build,v 1.40.2.1 2005/01/13 20:11:55 tv Exp $ +# $NetBSD: pre-build,v 1.40.2.2 2005/01/24 18:40:01 tv Exp $ # # Clean up system to be ready for bulk pkg build # @@ -16,8 +16,8 @@ else fi PRUNEDISTFILES=${PRUNEDISTFILES:-"no"} -PRUNEPACKAGES=${PRUNEPACKAGES:-"no"} -PRUNELINKS=${PRUNEPACKAGES:-"no"} +PRUNEPACKAGES=${PRUNEPACKAGES:-"yes"} +PRUNELINKS=${PRUNEPACKAGES:-"yes"} PKGLINT_PKG_DIR=${USR_PKGSRC}/pkgtools/pkglint @@ -40,6 +40,11 @@ if [ "$BLDLOG" = "" ]; then echo "Had problems determining the name of the .make files" exit 1 fi +LINTPKGSRC_DB=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=LINTPKGSRC_DB )`; +if [ "$LINTPKGSRC_DB" = "" ]; then + echo "Had problems determining the name of the .lintpkgsrc.db file" + exit 1 +fi STARTFILE=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=STARTFILE )`; if [ "$STARTFILE" = "" ]; then echo "Had problems determining the name of the .start file" @@ -171,11 +176,29 @@ fi DISTDIR=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=DISTDIR )`; PACKAGES=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=PACKAGES )`; +case "$LINTPKGSRC_CACHE$PRUNEDISTFILES$PRUNEPACKAGES" in +*yes*|*YES*) + # install pkglint to support any of these options + ( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} PRECLEAN=yes bulk-install ) + ;; +esac + +case "$LINTPKGSRC_CACHE" in +yes|YES) + echo "Creating lintpkgsrc cache database." + lintpkgsrc -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -E $LINTPKGSRC_DB + lintpkgsrc_cache="-I $LINTPKGSRC_DB" + echo done. + ;; +*) + lintpkgsrc_cache='' + ;; +esac + case "$PRUNEDISTFILES" in yes|YES) echo "Removing old/broken distfiles" - ( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} PRECLEAN=yes bulk-install ) - lintpkgsrc -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -o -m -r + lintpkgsrc $lintpkgsrc_cache -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -o -m -r echo done. ;; *) @@ -186,8 +209,7 @@ esac case "$PRUNEPACKAGES" in yes|YES) echo "Removing old (out of date) binary packages" - ( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} PRECLEAN=yes bulk-install ) - lintpkgsrc -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -p -r + lintpkgsrc $lintpkgsrc_cache -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -p -r echo done. ;; *) |