diff options
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bulk/build | 36 | ||||
-rw-r--r-- | mk/bulk/build.conf-example | 4 | ||||
-rw-r--r-- | mk/bulk/post-build | 22 | ||||
-rw-r--r-- | mk/bulk/pre-build | 58 | ||||
-rw-r--r-- | mk/bulk/printdepends | 10 | ||||
-rw-r--r-- | mk/bulk/printindex | 16 | ||||
-rw-r--r-- | mk/bulk/upload | 16 |
7 files changed, 92 insertions, 70 deletions
diff --git a/mk/bulk/build b/mk/bulk/build index 4db19b7ab82..6c13d691214 100644 --- a/mk/bulk/build +++ b/mk/bulk/build @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: build,v 1.22 2002/08/06 18:14:49 agc Exp $ +# $NetBSD: build,v 1.23 2002/08/07 10:56:11 agc Exp $ # # Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@netbsd.org> @@ -34,6 +34,14 @@ # Do builk build # +opsys=`uname -s` +case "$opsys" in +NetBSD) BMAKE=make ;; +*) BMAKE=bmake ;; +esac + +export BMAKE + # Set ressource limits as high as possible ulimit -S -s `ulimit -H -s` ulimit -S -d `ulimit -H -d` @@ -78,14 +86,14 @@ fi fail=no if [ -d pkgtools/pkglint ]; then cd pkgtools/pkglint - DEPENDSTREEFILE=`make show-var VARNAME=DEPENDSTREEFILE` || fail=yes - DEPENDSFILE=`make show-var VARNAME=DEPENDSFILE` || fail=yes - SUPPORTSFILE=`make show-var VARNAME=SUPPORTSFILE` || fail=yes - INDEXFILE=`make show-var VARNAME=INDEXFILE` || fail=yes - ORDERFILE=`make show-var VARNAME=ORDERFILE` || fail=yes - BROKENFILE=`make show-var VARNAME=BROKENFILE` || fail=yes - BUILDLOG=`make show-var VARNAME=BUILDLOG` || fail=yes - STARTFILE=`make show-var VARNAME=STARTFILE` || fail=yes + DEPENDSTREEFILE=`${BMAKE} show-var VARNAME=DEPENDSTREEFILE` || fail=yes + DEPENDSFILE=`${BMAKE} show-var VARNAME=DEPENDSFILE` || fail=yes + SUPPORTSFILE=`${BMAKE} show-var VARNAME=SUPPORTSFILE` || fail=yes + INDEXFILE=`${BMAKE} show-var VARNAME=INDEXFILE` || fail=yes + ORDERFILE=`${BMAKE} show-var VARNAME=ORDERFILE` || fail=yes + BROKENFILE=`${BMAKE} show-var VARNAME=BROKENFILE` || fail=yes + BUILDLOG=`${BMAKE} show-var VARNAME=BUILDLOG` || fail=yes + STARTFILE=`${BMAKE} show-var VARNAME=STARTFILE` || fail=yes else echo "The pkgtools/pkglint directory does not exist. Please update" echo "your pkgsrc tree in ${USR_PKGSRC}" @@ -127,7 +135,7 @@ cd ${USR_PKGSRC} # get the list of packages which should always be installed during the build cd ${USR_PKGSRC}/pkgtools/pkglint -BULK_PREREQ=`make show-var VARNAME=BULK_PREREQ` +BULK_PREREQ=`${BMAKE} show-var VARNAME=BULK_PREREQ` cd ${USR_PKGSRC} # install prerequisite packages. Note: we do this _before_ the depends tree @@ -137,13 +145,13 @@ for pkgdir in $BULK_PREREQ do echo $pkgdir # make sure its installed _and_ packaged - cd ${USR_PKGSRC}/$pkgdir && make bulk-install + cd ${USR_PKGSRC}/$pkgdir && ${BMAKE} bulk-install done # Create the bulk cache files cd ${USR_PKGSRC} if [ "$1" != "restart" ]; then - cd ${USR_PKGSRC} && make bulk-cache + cd ${USR_PKGSRC} && ${BMAKE} bulk-cache fi echo "Starting actual build using the order specified in $ORDERFILE..." @@ -168,7 +176,7 @@ do if ! grep -q "^${pkgdir}\$" $BUILDLOG ; then built=`wc -l $BUILDLOG | awk '{print $1}'` percent=`echo $built $tot | awk '{printf("%4.1f%%",$1*100/$2);}'` - (cd $pkgdir && nice -n 20 make USE_BULK_CACHE=yes bulk-package </dev/null | sed "s;^;`date '+%m/%d/%y %H:%M:%S'` $built/${tot}=$percent $pkgdir @ `uname -p`> ;g") + (cd $pkgdir && nice -n 20 ${BMAKE} USE_BULK_CACHE=yes bulk-package </dev/null | sed "s;^;`date '+%m/%d/%y %H:%M:%S'` $built/${tot}=$percent $pkgdir @ `uname -p`> ;g") echo "$pkgdir" >> $BUILDLOG fi done @@ -200,7 +208,7 @@ echo "Post processing bulk build results..." #rm $DEPENDSTREEFILE $DEPENDSFILE $SUPPORTSFILE $INDEXFILE $ORDERFILE # Perl was wiped, reinstall it! -( cd lang/perl5 && make bulk-install ) +( cd lang/perl5 && ${BMAKE} bulk-install ) perl mk/bulk/post-build | mail -s "pkgsrc/`uname -p` bulk build results `date +%F`" $ADMIN # Done! diff --git a/mk/bulk/build.conf-example b/mk/bulk/build.conf-example index cb77832106b..c6119359139 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.10 2001/07/08 14:36:56 dmcmahill Exp $ +# $NetBSD: build.conf-example,v 1.11 2002/08/07 10:56:12 agc Exp $ # # config file in /bin/sh syntax for {,pre,post}-build # @@ -31,7 +31,7 @@ CVS_USER="yourlogin" # prune distfiles to remove those which are out of date # can be set to 'yes' or 'no'. -PRUNEDISTFILES=yes +PRUNEDISTFILES=no # Proxies (optional): #ftp_proxy=http://proxy.machi.ne:3128/ diff --git a/mk/bulk/post-build b/mk/bulk/post-build index 006c3c0b4fe..d5bace8ec4d 100644 --- a/mk/bulk/post-build +++ b/mk/bulk/post-build @@ -1,5 +1,5 @@ #!/usr/pkg/bin/perl -# $NetBSD: post-build,v 1.18 2002/06/29 03:33:34 dmcmahill Exp $ +# $NetBSD: post-build,v 1.19 2002/08/07 10:56:12 agc Exp $ # # Collect stuff after a pkg bulk build # @@ -40,18 +40,18 @@ $reportf=basename($REPORT); # extract the name of the files used for the build log and broken build log. # these have defaults set by bsd.bulk-pkg.mk and may be overridden in /etc/mk.conf -chomp($BROKENFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=BROKENFILE )`); +chomp($BROKENFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; ${BMAKE} show-var VARNAME=BROKENFILE )`); # also extract the names of the cache files used during the bulk build. We'll save a copy of # those to help debug if the build messed up. -chomp($DEPENDSTREEFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=DEPENDSTREEFILE )`); -chomp($DEPENDSFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=DEPENDSFILE )`); -chomp($SUPPORTSFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=SUPPORTSFILE )`); -chomp($INDEXFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=INDEXFILE )`); -chomp($ORDERFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=ORDERFILE )`); -chomp($STARTFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=STARTFILE )`); -chomp($LOCALBASE=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=LOCALBASE )`); -chomp($X11BASE=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=X11BASE )`); +chomp($DEPENDSTREEFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; ${BMAKE} show-var VARNAME=DEPENDSTREEFILE )`); +chomp($DEPENDSFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; ${BMAKE} show-var VARNAME=DEPENDSFILE )`); +chomp($SUPPORTSFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; ${BMAKE} show-var VARNAME=SUPPORTSFILE )`); +chomp($INDEXFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; ${BMAKE} show-var VARNAME=INDEXFILE )`); +chomp($ORDERFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; ${BMAKE} show-var VARNAME=ORDERFILE )`); +chomp($STARTFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; ${BMAKE} show-var VARNAME=STARTFILE )`); +chomp($LOCALBASE=`( cd $USR_PKGSRC/pkgtools/pkglint ; ${BMAKE} show-var VARNAME=LOCALBASE )`); +chomp($X11BASE=`( cd $USR_PKGSRC/pkgtools/pkglint ; ${BMAKE} show-var VARNAME=X11BASE )`); $dtfile=basename($DEPENDSTREEFILE); $depfile=basename($DEPENDSFILE); $supfile=basename($SUPPORTSFILE); @@ -142,7 +142,7 @@ while (<BF>) { chomp($whofile); ($who,$file) = split(/\s+/, $whofile); - # $maintainer=`( cd $USR_PKGSRC/$pkg ; ( echo '.include "Makefile"' ; echo 'bla: ; \@echo ${MAINTAINER}' ) | make -f - bla )`; + # $maintainer=`( cd $USR_PKGSRC/$pkg ; ( echo '.include "Makefile"' ; echo 'bla: ; \@echo ${MAINTAINER}' ) | ${BMAKE} -f - bla )`; $maintainer=`grep ^MAINTAINER $USR_PKGSRC/$pkg/Makefile | awk '{ print \$2\$3\$4\$5\$6}' | sed -e 's/\</</g' -e 's/\>/>/g'`; chomp($maintainer); diff --git a/mk/bulk/pre-build b/mk/bulk/pre-build index 1a153a71f2c..d2960a223a6 100644 --- a/mk/bulk/pre-build +++ b/mk/bulk/pre-build @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: pre-build,v 1.21 2002/06/29 03:33:35 dmcmahill Exp $ +# $NetBSD: pre-build,v 1.22 2002/08/07 10:56:12 agc Exp $ # # Clean up system to be ready for bulk pkg build # @@ -15,28 +15,25 @@ else . `dirname $0`/build.conf fi -PRUNEDISTFILES=${PRUNEDISTFILES:-"yes"} +PRUNEDISTFILES=${PRUNEDISTFILES:-"no"} PRUNEPACKAGES=${PRUNEPACKAGES:-"no"} PRUNELINKS=${PRUNEPACKAGES:-"no"} -PRUNEDISTFILES=`echo $PRUNEDISTFILES | tr "[:lower:]" "[:upper:]"` -PRUNEPACKAGES=`echo $PRUNEPACKAGES | tr "[:lower:]" "[:upper:]"` -PRUNELINKS=`echo $PRUNELINKS | tr "[:lower:]" "[:upper:]"` PKGLINT_PKG_DIR=${USR_PKGSRC}/pkgtools/pkglint # extract the name of the files used for the build log and broken build log. # these have defaults set by bsd.bulk-pkg.mk and may be overridden in /etc/mk.conf -export BROKENF=`( cd ${PKGLINT_PKG_DIR} ; make show-var VARNAME=BROKENFILE )`; +export BROKENF=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=BROKENFILE )`; if [ "$BROKENF" = "" ]; then echo "Had problems determining the name of the .broken files" exit 1 fi -BLDLOG=`( cd ${PKGLINT_PKG_DIR} ; make show-var VARNAME=BUILDLOG )`; +BLDLOG=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=BUILDLOG )`; if [ "$BLDLOG" = "" ]; then echo "Had problems determining the name of the .make files" exit 1 fi -STARTFILE=`( cd ${PKGLINT_PKG_DIR} ; make show-var VARNAME=STARTFILE )`; +STARTFILE=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=STARTFILE )`; if [ "$BLDLOG" = "" ]; then echo "Had problems determining the name of the .start file" exit 1 @@ -47,7 +44,7 @@ fi # # Clean out everything and its mother # -PKG_DBDIR=`(cd ${PKGLINT_PKG_DIR}; make show-var VARNAME=PKG_DBDIR)` +PKG_DBDIR=`(cd ${PKGLINT_PKG_DIR}; ${BMAKE} show-var VARNAME=PKG_DBDIR)` echo Removing all installed packages in ${PKG_DBDIR} @@ -76,8 +73,8 @@ if [ -d ${PKG_DBDIR} ]; then rm -fr * fi -LOCALBASE=`( cd ${PKGLINT_PKG_DIR} ; make show-var VARNAME=LOCALBASE )`; -X11BASE=`( cd ${PKGLINT_PKG_DIR} ; make show-var VARNAME=X11BASE )`; +LOCALBASE=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=LOCALBASE )`; +X11BASE=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=X11BASE )`; # General cleanout - easy! cd $LOCALBASE && rm -fr * && rm -fr .??* @@ -110,11 +107,11 @@ rm -f $STARTFILE if [ "$CVS_USER" != "" ]; then if [ ! -f /usr/bin/cvs ]; then echo Installing required cvs pkgs for CVS update - ( cd ${USR_PKGSRC}/devel/cvs ; make bulk-install ) + ( cd ${USR_PKGSRC}/devel/cvs ; ${BMAKE} bulk-install ) fi if [ ! -f /usr/bin/ssh ]; then echo Installing required ssh pkgs for CVS update - ( cd ${USR_PKGSRC}/security/ssh ; make bulk-install ) + ( cd ${USR_PKGSRC}/security/ssh ; ${BMAKE} bulk-install ) fi echo Performing CVS update - this will take some time su - ${CVS_USER} -c 'stty sane ; setenv CVS_RSH ssh ; cd '${USR_PKGSRC}' ; cvs -q update -Pd' @@ -125,28 +122,35 @@ fi # # Remove old/broken distfiles and binary packages # -DISTDIR=`( cd ${PKGLINT_PKG_DIR} ; make show-var VARNAME=DISTDIR )`; -PACKAGES=`( cd ${PKGLINT_PKG_DIR} ; make show-var VARNAME=PACKAGES )`; +DISTDIR=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=DISTDIR )`; +PACKAGES=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=PACKAGES )`; -if [ $PRUNEDISTFILES = "YES" ]; then +case "$PRUNEDISTFILES" in +yes|YES) echo "Removing old/broken distfiles" - ( cd ${PKGLINT_PKG_DIR} ; make PRECLEAN=yes bulk-install ) + ( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} PRECLEAN=yes bulk-install ) lintpkgsrc -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -o -m -r echo done. -else + ;; +*) echo "Skipping distfile pruning." -fi + ;; +esac -if [ $PRUNEPACKAGES = "YES" ]; then +case "$PRUNEPACKAGES" in +yes|YES) echo "Removing old (out of date) binary packages" - ( cd ${PKGLINT_PKG_DIR} ; make PRECLEAN=yes bulk-install ) + ( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} PRECLEAN=yes bulk-install ) lintpkgsrc -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -p -r echo done. -else + ;; +*) echo "Skipping packages pruning." -fi + ;; +esac -if [ $PRUNELINKS = "YES" ]; then +case "$PRUNELINKS" in +yes|YES) echo "Checking for and removing orphaned packages links" find $PACKAGES -type l -print | \ while read f @@ -157,9 +161,11 @@ if [ $PRUNELINKS = "YES" ]; then fi done echo done. -else + ;; +*) echo "Skipping pruning of packages links." -fi + ;; +esac if [ -f mk/bulk/pre-build.local ]; then diff --git a/mk/bulk/printdepends b/mk/bulk/printdepends index 0bddf0abb98..ce93979cfa2 100644 --- a/mk/bulk/printdepends +++ b/mk/bulk/printdepends @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: printdepends,v 1.9 2001/10/14 20:34:53 dmcmahill Exp $ +# $NetBSD: printdepends,v 1.10 2002/08/07 10:56:12 agc Exp $ # # Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@netbsd.org> @@ -62,14 +62,14 @@ do else cd $pkgdir - l=`make show-depends-dirs` + l=`${BMAKE} show-depends-dirs` if [ $? != 0 ]; then echo "WARNING (printdepends): the package in $pkgdir had problem with" > /dev/stderr - echo " make show-depends-dirs" > /dev/stderr + echo " ${BMAKE} show-depends-dirs" > /dev/stderr echo " dependency information in the cache will" > /dev/stderr echo " be dropped for $pkgdir" > /dev/stderr - echo "make show-depends-dirs failed:" > $brokenfile - make show-depends-dirs >> $brokenfile 2>&1 + echo "${BMAKE} show-depends-dirs failed:" > $brokenfile + ${BMAKE} show-depends-dirs >> $brokenfile 2>&1 echo "$pkgdir $pkgdir" else if [ "$l" = "" ]; then diff --git a/mk/bulk/printindex b/mk/bulk/printindex index 27819b7ef28..bbfc1b8a253 100644 --- a/mk/bulk/printindex +++ b/mk/bulk/printindex @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: printindex,v 1.8 2001/12/01 12:32:08 hubertf Exp $ +# $NetBSD: printindex,v 1.9 2002/08/07 10:56:12 agc Exp $ # # # Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -69,11 +69,11 @@ do echo "but the directory does not exist. Please fix this!" > /dev/stderr else cd $pkgdir - pkgname=`make show-var VARNAME=PKGNAME` + pkgname=`${BMAKE} show-var VARNAME=PKGNAME` if [ $? != 0 ]; then echo "ERROR: printindex could not extract PKGNAME for $pkgdir" > /dev/stderr - echo "make show-var VARNAME=PKGNAME failed" > $brokenfile - make show-var VARNAME=PKGNAME >> $brokenfile 2>&1 + echo "${BMAKE} show-var VARNAME=PKGNAME failed" > $brokenfile + ${BMAKE} show-var VARNAME=PKGNAME >> $brokenfile 2>&1 #exit 1 fi echo "$pkgdir $pkgname " @@ -86,7 +86,7 @@ done # not be enabled for builds in pkgtools/xpkgwedge, but we may want to have # it listed in the index file. -cd $cwd/pkgtools/pkglint && BULK_PREREQ=`make show-var VARNAME=BULK_PREREQ` +cd $cwd/pkgtools/pkglint && BULK_PREREQ=`${BMAKE} show-var VARNAME=BULK_PREREQ` cd $cwd for pkgdir in $BULK_PREREQ @@ -97,11 +97,11 @@ do ;; *) cd $cwd/$pkgdir - pkgname=`make show-var VARNAME=PKGNAME` + pkgname=`${BMAKE} show-var VARNAME=PKGNAME` if [ $? != 0 ]; then echo "ERROR: printindex could not extract PKNAME for $pkgdir" > /dev/stderr - echo "make show-var VARNAME=PKGNAME failed" > $brokenfile - make show-var VARNAME=PKGNAME >> $brokenfile 2>&1 + echo "${BMAKE} show-var VARNAME=PKGNAME failed" > $brokenfile + ${BMAKE} show-var VARNAME=PKGNAME >> $brokenfile 2>&1 #exit 1 fi echo "$pkgdir $pkgname " diff --git a/mk/bulk/upload b/mk/bulk/upload index 7141a8d9d9e..4b5d9c41ad4 100644 --- a/mk/bulk/upload +++ b/mk/bulk/upload @@ -4,6 +4,14 @@ # Must be called in /usr/pkgsrc # +opsys=`uname -s` +case "$opsys" in +NetBSD) BMAKE=make ;; +*) BMAKE=bmake ;; +esac + +export BMAKE + # Pull in RSYNC_DST, RSYNC_OPTS: if [ -f "$BULK_BUILD_CONF" ]; then . $BULK_BUILD_CONF @@ -44,12 +52,12 @@ upload_specific=$TMP/upload_specific upload_others=$TMP/upload_others # May be different than $USR_PKGSRC: -pkgsrcdir=`cd pkgtools/pkglint ; make show-var VARNAME=_PKGSRCDIR` -packages=`cd pkgtools/pkglint ; make show-var VARNAME=PACKAGES` +pkgsrcdir=`cd pkgtools/pkglint ; ${BMAKE} show-var VARNAME=_PKGSRCDIR` +packages=`cd pkgtools/pkglint ; ${BMAKE} show-var VARNAME=PACKAGES` # Pull in some pkgs needed -( cd pkgtools/pkglint ; make bulk-install ) -( cd net/rsync ; make bulk-install ) +( cd pkgtools/pkglint ; ${BMAKE} bulk-install ) +( cd net/rsync ; ${BMAKE} bulk-install ) echo "Checking for restricted, out of date, and vulnerable packages:" # -p = report old versions of packages |