pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/bulk * Add USE_BULK_TIMESTAMPS (default "yes") to c...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b51346e17abb
branches:  trunk
changeset: 487766:b51346e17abb
user:      tv <tv%pkgsrc.org@localhost>
date:      Wed Jan 19 20:58:00 2005 +0000

description:
* Add USE_BULK_TIMESTAMPS (default "yes") to control whether dependency
  binpkg timestamps, and ${PKGDIR} file timestamps, will be used to
  determine if a rebuild is necessary.  If changed to "no", then rebuilds
  will only happen when PKGNAME actually changes.

* Add LINTPKGSRC_DB (and companion USE_LINTPKGSRC_CACHE, default "no") to
  make pre-build generate a reusable database with "lintpkgsrc -E"; helps
  with nfs-mounted pkgsrc.  A future change will allow use of this in the
  upload script.

* Add entry for PRUNEPACKAGES in build.conf-example (this was missing).

diffstat:

 mk/bulk/bsd.bulk-pkg.mk    |  46 +++++++++++++++++++++++++++++-----------------
 mk/bulk/build.conf-example |  12 ++++++++++--
 mk/bulk/pre-build          |  32 +++++++++++++++++++++++++++-----
 3 files changed, 66 insertions(+), 24 deletions(-)

diffs (181 lines):

diff -r 99112f20f56c -r b51346e17abb mk/bulk/bsd.bulk-pkg.mk
--- a/mk/bulk/bsd.bulk-pkg.mk   Wed Jan 19 20:55:03 2005 +0000
+++ b/mk/bulk/bsd.bulk-pkg.mk   Wed Jan 19 20:58:00 2005 +0000
@@ -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@localhost>
@@ -53,6 +53,12 @@
 # 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 @@
 # 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 @@
 # 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 @@
                        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 -r 99112f20f56c -r b51346e17abb mk/bulk/build.conf-example
--- a/mk/bulk/build.conf-example        Wed Jan 19 20:55:03 2005 +0000
+++ b/mk/bulk/build.conf-example        Wed Jan 19 20:58:00 2005 +0000
@@ -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@localhost"
@@ -40,6 +40,14 @@
 # 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 -r 99112f20f56c -r b51346e17abb mk/bulk/pre-build
--- a/mk/bulk/pre-build Wed Jan 19 20:55:03 2005 +0000
+++ b/mk/bulk/pre-build Wed Jan 19 20:58:00 2005 +0000
@@ -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 @@
        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 @@
 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 @@
 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.
        ;;
 *)



Home | Main Index | Thread Index | Old Index