diff options
author | dmcmahill <dmcmahill@pkgsrc.org> | 2004-04-07 22:56:34 +0000 |
---|---|---|
committer | dmcmahill <dmcmahill@pkgsrc.org> | 2004-04-07 22:56:34 +0000 |
commit | eb0a5dcca7a68b306d9fb9e3d4f44b48cc32e3cb (patch) | |
tree | 69bb1d0d9885157508b41df893cc22a81a7cd8c3 /mk/bulk/bsd.bulk-pkg.mk | |
parent | 2a8f9c23d44d4cdc6f2a9dcd939489acefcf6193 (diff) | |
download | pkgsrc-eb0a5dcca7a68b306d9fb9e3d4f44b48cc32e3cb.tar.gz |
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 (limited to 'mk/bulk/bsd.bulk-pkg.mk')
-rw-r--r-- | mk/bulk/bsd.bulk-pkg.mk | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/mk/bulk/bsd.bulk-pkg.mk b/mk/bulk/bsd.bulk-pkg.mk index f0fa305164d..d1914172650 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.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> @@ -107,6 +107,13 @@ ORDERFILE?= ${_PKGSRCDIR}/.order${BULK_ID} # 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 @@ bulk-cache: .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} \ |