summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/bulk/bsd.bulk-pkg.mk46
-rw-r--r--mk/bulk/build.conf-example12
-rw-r--r--mk/bulk/pre-build32
3 files changed, 66 insertions, 24 deletions
diff --git a/mk/bulk/bsd.bulk-pkg.mk b/mk/bulk/bsd.bulk-pkg.mk
index 7b3438369ba..3db7468c16c 100644
--- a/mk/bulk/bsd.bulk-pkg.mk
+++ b/mk/bulk/bsd.bulk-pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.bulk-pkg.mk,v 1.69 2005/01/17 08:52:50 jmmv Exp $
+# $NetBSD: bsd.bulk-pkg.mk,v 1.70 2005/01/19 20:58:00 tv Exp $
#
# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@NetBSD.org>
@@ -53,6 +53,12 @@ WC?= wc
# they're known to exist and be up to date, don't use them.
USE_BULK_CACHE?= no
+# This variable may be set to 'no' to avoid automatic rebuilding of dependent
+# packages based solely on timestamps of the package's pkgsrc files and/or
+# its dependency binary packages. This will cause rebuilding only when the
+# full version number of the package changes (e.g., via PKGREVISION bump).
+USE_BULK_TIMESTAMPS?= yes
+
# Shall we remove any packages which are installed, but not required
# to build this package
PRECLEAN?= yes
@@ -118,6 +124,10 @@ ORDERFILE?= ${BULKFILESDIR}/.order${BULK_ID}
# eventually for looking for leftover files (files not properly deinstalled)
STARTFILE?= ${BULKFILESDIR}/.start${BULK_ID}
+# File created and used by lintpkgsrc(8) to cache package metadata for
+# pruning and bulk-upload exclusions.
+LINTPKGSRC_DB?= ${BULKFILESDIR}/.lintpkgsrc.db${BULK_ID}
+
# File which is used as a database for bulk builds in which SPECIFIC_PKGS is
# defined. This database is used to hold all the dependency and index
# information for the specific packages as well as their dependencies. In a
@@ -190,23 +200,25 @@ clean-bulk-cache:
# check if the $REF file is uptodate, i.e. is newer than any of
# the pkg files; prints "1" if upto date, "0" if not.
bulk-check-uptodate:
- @uptodate=1 ; \
- if [ -f "${REF}" ]; then \
- ${SHCOMMENT} "Check files of this package" ; \
- newfiles="`${FIND} . -type f -newer "${REF}" -print | ${EGREP} -v -e ./work -e COMMENT -e DESCR -e README.html -e CVS -e '^\./\.' || ${TRUE}`" ; \
- nnewfiles="`${FIND} . -type f -newer "${REF}" -print | ${EGREP} -v -e ./work -e COMMENT -e DESCR -e README.html -e CVS -e '^\./\.' | ${WC} -l`" ; \
- if [ "$$nnewfiles" -gt 0 ]; then \
- ${ECHO_MSG} >&2 "BULK> Package ${PKGNAME} ($$newfiles) modified since last 'make package' re-packaging..." ; \
- uptodate=0 ; \
+ @uptodate=1; \
+ if [ "$USE_BULK_TIMESTAMPS" = "yes" ]; then \
+ if [ -f "${REF}" ]; then \
+ ${SHCOMMENT} "Check files of this package"; \
+ newfiles="`${FIND} . -type f -newer "${REF}" -print | ${EGREP} -v -e ./work -e COMMENT -e DESCR -e README.html -e CVS -e '^\./\.' || ${TRUE}`"; \
+ nnewfiles="`${FIND} . -type f -newer "${REF}" -print | ${EGREP} -v -e ./work -e COMMENT -e DESCR -e README.html -e CVS -e '^\./\.' | ${WC} -l`"; \
+ if [ "$$nnewfiles" -gt 0 ]; then \
+ ${ECHO_MSG} >&2 "BULK> Package ${PKGNAME} ($$newfiles) modified since last 'make package' re-packaging..."; \
+ uptodate=0; \
+ else \
+ ${ECHO_MSG} >&2 "BULK> ${REF} is up to date."; \
+ fi; \
else \
- ${ECHO_MSG} >&2 "BULK> ${REF} is up to date." ; \
- fi ; \
- else \
- ${ECHO_MSG} >&2 "BULK> Package ${PKGNAME} not built yet, packaging..." ; \
- uptodate=0 ; \
- fi ; \
+ ${ECHO_MSG} >&2 "BULK> Package ${PKGNAME} not built yet, packaging..."; \
+ uptodate=0; \
+ fi; \
+ fi; \
if [ "$$uptodate" = "1" ]; then \
- ${SHCOMMENT} "Check required binary packages" ; \
+ ${SHCOMMENT} "Check required binary packages"; \
(${DEPENDS:C/:.*$//:@d@${ECHO} ${d:Q};@} ${TRUE}) | \
while read dep; do \
${SHCOMMENT} "check against the binary pkg that pkg_add would pick, too:" ; \
@@ -215,7 +227,7 @@ bulk-check-uptodate:
if [ -z "$$pkg" ]; then \
${ECHO_MSG} >&2 "BULK> Required binary package $$dep does not exist, rebuilding... " ; \
uptodate=0 ; \
- elif [ -n "$$(${FIND} $$pkg -prune -newer ${REF} -print)" ]; then \
+ elif [ "$USE_BULK_TIMESTAMPS" = "yes" ] && [ -n "$$(${FIND} $$pkg -prune -newer ${REF} -print)" ]; then \
${ECHO_MSG} >&2 "BULK> Required binary package $$dep (`basename $$pkg`) is newer, rebuilding... " ; \
uptodate=0 ; \
else \
diff --git a/mk/bulk/build.conf-example b/mk/bulk/build.conf-example
index 4a25b9595f4..ddf0bfb6140 100644
--- a/mk/bulk/build.conf-example
+++ b/mk/bulk/build.conf-example
@@ -1,5 +1,5 @@
# build.conf
-# $NetBSD: build.conf-example,v 1.22 2004/08/12 22:18:07 sketch Exp $
+# $NetBSD: build.conf-example,v 1.23 2005/01/19 20:58:01 tv Exp $
#
# config file in /bin/sh syntax for {,pre,post}-build
#
@@ -12,7 +12,7 @@
FTPx=`date +%Y%m%d.%H%M`
FTPURL="pub/NetBSD/pkgstat/${FTPx}" # relative to ~ftp !
FTP="/home/ftp/${FTPURL}" # absolute base path
-FTPHOST="ftp://ftp.machi.ne" # host for broken.html
+FTPHOST="ftp://ftp.machi.ne" # host for broken.html
# Where build will mail the report
ADMIN="you@some.whe.re"
@@ -40,6 +40,14 @@ CVS_USER="yourlogin"
# can be set to 'yes' or 'no'.
PRUNEDISTFILES=no
+# prune binary packages to remove those which are out of date
+# can be set to 'yes' or 'no'.
+PRUNEPACKAGES=yes
+
+# whether to cache the lintpkgsrc database for PRUNE* or uploading
+# can be set to 'yes' or 'no'.
+LINTPKGSRC_CACHE=no
+
# Proxies (optional):
#ftp_proxy=http://proxy.machi.ne:3128/
#http_proxy=http://proxy.machi.ne:3128/
diff --git a/mk/bulk/pre-build b/mk/bulk/pre-build
index fa7f739a014..121d89dcc4c 100644
--- a/mk/bulk/pre-build
+++ b/mk/bulk/pre-build
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: pre-build,v 1.43 2005/01/18 15:04:34 tv Exp $
+# $NetBSD: pre-build,v 1.44 2005/01/19 20:58:01 tv Exp $
#
# Clean up system to be ready for bulk pkg build
#
@@ -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.
;;
*)