summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordmcmahill <dmcmahill>2001-12-17 02:32:22 +0000
committerdmcmahill <dmcmahill>2001-12-17 02:32:22 +0000
commitfcef78fe9cbfdd7836e173ee0720bb2e40c9e286 (patch)
tree46206899ae8ca78a529c724dd73b18e44d6a3b43
parent00880eaf1b79d1bb91718c759d52e0d53f74e2a8 (diff)
downloadpkgsrc-fcef78fe9cbfdd7836e173ee0720bb2e40c9e286.tar.gz
- add 'bulk-cache' and 'clean-bulk-cache' targets to create and remove
the cache files used during a bulk pkgsrc build. - replace the code in the build script that used to create the cache files with a 'make bulk-cache' call.
-rw-r--r--Makefile10
-rw-r--r--mk/bulk/bsd.bulk-pkg.mk32
-rw-r--r--mk/bulk/build21
3 files changed, 43 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index fae7f2a224e..4b5f29295cc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.44 2001/07/17 13:11:51 wiz Exp $
+# $NetBSD: Makefile,v 1.45 2001/12/17 02:32:22 dmcmahill Exp $
#
.include "mk/bsd.prefs.mk"
@@ -53,6 +53,14 @@ PKGSRCTOP= yes
.include "mk/bsd.pkg.subdir.mk"
+# the bulk-cache and clean-bulk-cache targets are a global-pkgsrc
+# thing and thus it makes sense to run it from the top level pkgsrc
+# directory.
+.if make(bulk-cache) || make(clean-bulk-cache)
+.include "${.CURDIR}/mk/bulk/bsd.bulk-pkg.mk"
+_PKGSRCDIR?=${.CURDIR}
+.endif
+
index:
@rm -f ${.CURDIR}/INDEX
@${MAKE} ${.CURDIR}/INDEX
diff --git a/mk/bulk/bsd.bulk-pkg.mk b/mk/bulk/bsd.bulk-pkg.mk
index e8da68195b5..16767b20ffb 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.33 2001/12/16 14:27:07 dmcmahill Exp $
+# $NetBSD: bsd.bulk-pkg.mk,v 1.34 2001/12/17 02:32:23 dmcmahill Exp $
#
# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@netbsd.org>
@@ -105,6 +105,35 @@ ORDERFILE?= ${_PKGSRCDIR}/.order
# and also for xpkgwedge. Add pkgtools/xpkgwedge in /etc/mk.conf to do an xpkgwedged bulk build.
BULK_PREREQ+= pkgtools/digest
+
+# build the cache files used as part of a full bulk build
+# Note: we have to install the BULK_PREREQ packages _before_
+# extracting the depends tree because some packages like
+# xpkgwedge only become DEPENDS if it is installed
+bulk-cache:
+ ${ECHO_MSG} "Installing BULK_PREREQ packages"
+.for __prereq in ${BULK_PREREQ}
+ cd ${_PKGSRCDIR}/${__prereq} && ${MAKE} bulk-install
+.endfor
+ @${ECHO_MSG} "BULK> Building complete pkgsrc dependency tree (this may take a while)."
+ cd ${_PKGSRCDIR} && ${SH} mk/bulk/printdepends ${BROKENFILE} > ${DEPENDSTREEFILE}
+ @${ECHO_MSG} "BULK> Sorting build order."
+ tsort ${DEPENDSTREEFILE} > ${ORDERFILE}
+ @${ECHO_MSG} "BULK> Generating up and down dependency files."
+ ${_PKGSRCDIR}/mk/bulk/tflat -u ${DEPENDSTREEFILE} > ${SUPPORTSFILE}
+ ${_PKGSRCDIR}/mk/bulk/tflat -d ${DEPENDSTREEFILE} > ${DEPENDSFILE}
+ @${ECHO_MSG} "BULK> Generating package name <=> package directory cross reference file"
+ @${ECHO_MSG} " (this may take a while)."
+ cd ${_PKGSRCDIR} && ${SH} mk/bulk/printindex ${BROKENFILE} > ${INDEXFILE}
+
+# remove the bulk cache files
+clean-bulk-cache:
+ ${RM} -f ${DEPENDSTREEFILE} \
+ ${DEPENDSFILE} \
+ ${SUPPORTSFILE} \
+ ${INDEXFILE} \
+ ${ORDERFILE}
+
# 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:
@@ -338,3 +367,4 @@ bulk-install:
${ECHO_MSG} ${MAKE} bulk-package PRECLEAN=no; \
${DO} ${MAKE} bulk-package PRECLEAN=no; \
fi
+
diff --git a/mk/bulk/build b/mk/bulk/build
index 38903ea0f84..b374d79d7fa 100644
--- a/mk/bulk/build
+++ b/mk/bulk/build
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: build,v 1.19 2001/12/01 12:40:52 hubertf Exp $
+# $NetBSD: build,v 1.20 2001/12/17 02:32:23 dmcmahill Exp $
#
# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@netbsd.org>
@@ -137,25 +137,10 @@ do
cd ${USR_PKGSRC}/$pkgdir && make bulk-install
done
-# Figure out optimal build order.
+# Create the bulk cache files
cd ${USR_PKGSRC}
if [ "$1" != "restart" ]; then
- echo "Building dependency tree (this may take a while)..."
- sh mk/bulk/printdepends $BROKENFILE > $DEPENDSTREEFILE
-
- echo "Sorting build order..."
- tsort $DEPENDSTREEFILE > $ORDERFILE
-
- echo "Generating up and down dependency files..."
- ./mk/bulk/tflat -u $DEPENDSTREEFILE > $SUPPORTSFILE
- ./mk/bulk/tflat -d $DEPENDSTREEFILE > $DEPENDSFILE
-
- echo "Generating package name <=> package directory cross reference file (this may take a while)..."
- sh mk/bulk/printindex $BROKENFILE > $INDEXFILE
- if [ $? != 0 ]; then
- echo "ERROR while creating $INDEXFILE"
- exit 1
- fi
+ cd ${USR_PKGSRC} && make bulk-cache
fi
echo "Starting actual build using the order specified in $ORDERFILE..."