pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk/bulk Add support in the bulk build code to properly...
details: https://anonhg.NetBSD.org/pkgsrc/rev/421f127f08a9
branches: trunk
changeset: 472297:421f127f08a9
user: dmcmahill <dmcmahill%pkgsrc.org@localhost>
date: Wed Apr 07 22:56:34 2004 +0000
description:
Add support in the bulk build code to properly deal with SPECIFIC_PKGS=1.
In particular, when SPECIFIC_PKGS is set in /etc/mk.conf, you can now do
sh mk/bulk/build
and have the right thing happen. Only those packages explicitly listed
and those which are depended upon are considered for the build. Other
than the restricted list of packages, the bulk build works the same way
as a full bulk build.
diffstat:
mk/bulk/bsd.bulk-pkg.mk | 43 ++++++++++++++++++++++++++++++++++++++-----
mk/bulk/build | 5 ++++-
mk/bulk/post-build | 7 +++++--
3 files changed, 47 insertions(+), 8 deletions(-)
diffs (151 lines):
diff -r 149a6a310692 -r 421f127f08a9 mk/bulk/bsd.bulk-pkg.mk
--- a/mk/bulk/bsd.bulk-pkg.mk Wed Apr 07 22:44:23 2004 +0000
+++ b/mk/bulk/bsd.bulk-pkg.mk Wed Apr 07 22:56:34 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.bulk-pkg.mk,v 1.57 2004/02/25 09:20:59 grant Exp $
+# $NetBSD: bsd.bulk-pkg.mk,v 1.58 2004/04/07 22:56:34 dmcmahill Exp $
#
# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf%NetBSD.org@localhost>
@@ -107,6 +107,13 @@
# for looking for leftover files (files not properly deinstalled)
STARTFILE?= ${_PKGSRCDIR}/.start${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 SPECIFIC_PKGS
+# bulk build, this file is created and then used to create the INDEXFILE and
+# DEPENDSTREEFILE.
+BULK_DBFILE?= ${_PKGSRCDIR}/.bulk_db${BULK_ID}
+
# a list of pkgs which we should _never_ delete during a build. The primary use is for digest
# and also for xpkgwedge. Add pkgtools/xpkgwedge in /etc/mk.conf to do an xpkgwedged bulk build.
BULK_PREREQ+= pkgtools/digest
@@ -123,20 +130,46 @@
.for __prereq in ${BULK_PREREQ}
cd ${_PKGSRCDIR}/${__prereq} && ${MAKE} bulk-install
.endfor
+ ${RM} -f ${BULK_DBFILE}
+ ${TOUCH} ${BULK_DBFILE}
+.if !defined(SPECIFIC_PKGS)
+ @${ECHO} "This file is unused for a full pkgsrc bulk build" >> ${BULK_DBFILE}
+ @${ECHO} "It is only used for a SPECIFIC_PKGS bulk build" >> ${BULK_DBFILE}
@${ECHO_MSG} "BULK> Building complete pkgsrc dependency tree (this may take a while)."
cd ${_PKGSRCDIR} && ${SH} mk/bulk/printdepends ${BROKENFILE} > ${DEPENDSTREEFILE}
+ @${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}
+.else
+ @${ECHO_MSG} "BULK> Extracting database for SPECIFIC_PKGS subset of pkgsrc"
+ @${ECHO_MSG} " along with their dependencies"
+.for __tmp__ in ${SUBDIR} ${BULK_PREREQ} lang/perl5 pkgtools/pkglint
+ cd ${_PKGSRCDIR}/${__tmp__} && ../../mk/scripts/mkdatabase -a -f ${BULK_DBFILE}
+.endfor
+ @${ECHO_MSG} "BULK> Extracting dependency tree file"
+ ${AWK} '/^(build_)?depends/ {pkgs[$$2] = 1; cat=$$2; sub(/\/.*/, "", cat); \
+ for(i=3; i<=NF; i=i+1){ \
+ listed[$$2] = 1; \
+ sub(/[^:]*:\.\.\/\.\.\//, "", $$i); \
+ sub(/[^:]*:\.\./, cat , $$i); \
+ print $$i " " $$2; \
+ }} END{ \
+ for(pkg in pkgs) {if( pkg in listed ) {} else{ print pkg " " pkg;}} \
+ }' \
+ ${BULK_DBFILE} | ${SORT} -u > ${DEPENDSTREEFILE}
+ @${ECHO_MSG} "BULK> Extracting package name <=> package directory cross reference file"
+ ${AWK} '/^index/ {print $$2 " " $$3 " "}' ${BULK_DBFILE} > ${INDEXFILE}
+.endif
@${ECHO_MSG} "BULK> Sorting build order."
${TSORT} ${DEPENDSTREEFILE} > ${ORDERFILE}
@${ECHO_MSG} "BULK> Generating up and down dependency files."
${AWK} -f ${_PKGSRCDIR}/mk/bulk/tflat up ${DEPENDSTREEFILE} > ${SUPPORTSFILE}
${AWK} -f ${_PKGSRCDIR}/mk/bulk/tflat down ${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} \
+ ${RM} -f ${BULK_DBFILE} \
+ ${DEPENDSTREEFILE} \
${DEPENDSFILE} \
${SUPPORTSFILE} \
${INDEXFILE} \
diff -r 149a6a310692 -r 421f127f08a9 mk/bulk/build
--- a/mk/bulk/build Wed Apr 07 22:44:23 2004 +0000
+++ b/mk/bulk/build Wed Apr 07 22:56:34 2004 +0000
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: build,v 1.36 2004/02/25 09:20:59 grant Exp $
+# $NetBSD: build,v 1.37 2004/04/07 22:56:34 dmcmahill Exp $
#
# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf%NetBSD.org@localhost>
@@ -103,6 +103,7 @@
fail=no
if [ -d pkgtools/pkglint ]; then
cd pkgtools/pkglint
+ BULK_DBFILE=`${BMAKE} show-var VARNAME=BULK_DBFILE` || 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
@@ -127,6 +128,7 @@
echo "----------------------------------"
echo "| Build Temporary Files: |"
echo "----------------------------------"
+echo "BULK_DBFILE = $BULK_DBFILE"
echo "DEPENDSTREEFILE = $DEPENDSTREEFILE"
echo "DEPENDSFILE = $DEPENDSFILE"
echo "SUPPORTSFILE = $SUPPORTSFILE"
@@ -140,6 +142,7 @@
# make sure we have values for these very important
# variables
if [ $fail = "yes" -o \
+ -z "$BULK_DBFILE" -o \
-z "$DEPENDSTREEFILE" -o \
-z "$DEPENDSFILE" -o \
-z "$SUPPORTSFILE" -o \
diff -r 149a6a310692 -r 421f127f08a9 mk/bulk/post-build
--- a/mk/bulk/post-build Wed Apr 07 22:44:23 2004 +0000
+++ b/mk/bulk/post-build Wed Apr 07 22:56:34 2004 +0000
@@ -1,5 +1,5 @@
#!/usr/pkg/bin/perl
-# $NetBSD: post-build,v 1.41 2004/03/28 20:35:29 agc Exp $
+# $NetBSD: post-build,v 1.42 2004/04/07 22:56:34 dmcmahill Exp $
#
# Collect stuff after a pkg bulk build
#
@@ -48,6 +48,7 @@
# 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($BULK_DBFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; $ENV{"BMAKE"} show-var VARNAME=BULK_DBFILE )`);
chomp($DEPENDSTREEFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; $ENV{"BMAKE"} show-var VARNAME=DEPENDSTREEFILE )`);
chomp($DEPENDSFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; $ENV{"BMAKE"} show-var VARNAME=DEPENDSFILE )`);
chomp($SUPPORTSFILE=`( cd $USR_PKGSRC/pkgtools/pkglint ; $ENV{"BMAKE"} show-var VARNAME=SUPPORTSFILE )`);
@@ -58,6 +59,7 @@
chomp($X11BASE=`( cd $USR_PKGSRC/pkgtools/pkglint ; $ENV{"BMAKE"} show-var VARNAME=X11BASE )`);
chomp($FIND=`( cd $USR_PKGSRC/pkgtools/pkglint ; $ENV{"BMAKE"} show-var VARNAME=FIND )`);
chomp($GTAR=`( cd $USR_PKGSRC/pkgtools/pkglint ; $ENV{"BMAKE"} show-var VARNAME=GTAR )`);
+$bulkdbfile=basename($BULK_DBFILE);
$dtfile=basename($DEPENDSTREEFILE);
$depfile=basename($DEPENDSFILE);
$supfile=basename($SUPPORTSFILE);
@@ -92,7 +94,7 @@
system("find . -name $BROKENFILE -print | $GTAR -T - -plcf - | (cd $FTP; $GTAR -plxf -)");
# Copy over the cache files used during the build
-foreach my $f ($DEPENDSTREEFILE, $DEPENDSFILE, $SUPPORTSFILE, $INDEXFILE, $ORDERFILE) {
+foreach my $f ($BULK_DBFILE, $DEPENDSTREEFILE, $DEPENDSFILE, $SUPPORTSFILE, $INDEXFILE, $ORDERFILE) {
system("cp ${f} ${FTP}") if -f ${f};
}
@@ -442,6 +444,7 @@
The following cache files were used during the build:
</p>
<ul>
+<li>The <a href="$bulkdbfile">SPECIFIC_PKGS bulk database file</a>.</li>
<li>The <a href="$dtfile">depends tree file</a>.</li>
<li>The <a href="$depfile">depends file</a>.</li>
<li>The <a href="$supfile">supports file</a>.</li>
Home |
Main Index |
Thread Index |
Old Index