pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk/bulk Avoid feeding very long lines to grep/egrep. ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/5b81b6e6456a
branches: trunk
changeset: 490485:5b81b6e6456a
user: dmcmahill <dmcmahill%pkgsrc.org@localhost>
date: Sat Mar 12 13:27:03 2005 +0000
description:
Avoid feeding very long lines to grep/egrep. The grep/egrep implementation
on some systems, e.g. solaris, will simply drop long lines. These longs
lines are found in the flattened up and down dependency lists in the bulk
cache files. Instead, use sed to deal with this.
Fixes problems noted in Solaris bulk builds. Patch tested on NetBSD-2.0
and Solaris-2.9
diffstat:
mk/bulk/bsd.bulk-pkg.mk | 71 ++++++++++++++++++++++++++++--------------------
1 files changed, 41 insertions(+), 30 deletions(-)
diffs (121 lines):
diff -r 44b544dec7b8 -r 5b81b6e6456a mk/bulk/bsd.bulk-pkg.mk
--- a/mk/bulk/bsd.bulk-pkg.mk Sat Mar 12 12:53:56 2005 +0000
+++ b/mk/bulk/bsd.bulk-pkg.mk Sat Mar 12 13:27:03 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.bulk-pkg.mk,v 1.74 2005/01/27 17:55:42 sketch Exp $
+# $NetBSD: bsd.bulk-pkg.mk,v 1.75 2005/03/12 13:27:03 dmcmahill Exp $
#
# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf%NetBSD.org@localhost>
@@ -143,6 +143,12 @@
# by default, clean up any broken packages
_PRESERVE_WRKDIR?= no
+# create an escaped version of PKGPATH. We do this because
+# in several places we want to be able to use something like
+# foo/bar.baz++ in a regular expression but have it be interpreted
+# literally. So, turn it into foo\/bar\.baz\+\+
+_ESCPKGPATH= ${PKGPATH:C@\/@\\/@g:C@\+@\\+@g:C@\.@\\.@g:Q}
+
# 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
@@ -297,7 +303,7 @@
${ECHO_MSG} "BULK> Full rebuild in progress..." ; \
${ECHO_MSG} "BULK> Cleaning package and its depends" ;\
if [ "${USE_BULK_CACHE}" = "yes" ]; then \
- for pkgdir in ${PKGPATH} `${GREP} "^${PKGPATH} " ${DEPENDSFILE} | ${SED} -e 's;^.*:;;g'`; do \
+ for pkgdir in ${PKGPATH} `${SED} -n -e "/^${_ESCPKGPATH} / s;^[^:]*:;;p" ${DEPENDSFILE}`; do \
${DO} (cd ${PKGSRCDIR}/$$pkgdir && ${MAKE} clean) ; \
done ;\
else \
@@ -315,7 +321,9 @@
fi; \
if ${PKG_INFO} -qe $$pkgname ; then \
${SHCOMMENT} "Remove only unneeded pkgs" ; \
- if ${EGREP} "^${PKGPATH} .* $$pkgdir( |$$)" ${DEPENDSFILE} >/dev/null 2>&1; then \
+ pkgdir2=`${ECHO} "$$pkgdir" | ${AWK} '{gsub(/\//,"\\\\/"); gsub(/\+/,"\\\\+"); gsub(/ /,"\\\\ "); gsub(/\./,"\\\\."); print}'` ; \
+ tmp=`${SED} -n -e "/^${_ESCPKGPATH} .* $$pkgdir2 / s;.*;yes;p" ${DEPENDSFILE}` ; \
+ if test "X$$tmp" = "Xyes" ; then \
${ECHO_MSG} "BULK> ${PKGNAME} requires installed package $$pkgname ($$pkgdir) to build." ;\
else \
case "${BULK_PREREQ}" in \
@@ -345,7 +353,7 @@
if [ "${USE_BULK_CACHE}" = "yes" ]; then \
${SHCOMMENT} "Install required depends via binarypkgs XXX" ; \
${ECHO_MSG} "BULK> Installing packages which are required to build ${PKGNAME}." ;\
- for pkgdir in `${GREP} "^${PKGPATH} " ${DEPENDSFILE} | ${SED} -e 's;^.*:;;g'` ${BULK_PREREQ} ; do \
+ for pkgdir in `${SED} -n -e "/^${_ESCPKGPATH} / s;^[^:]*:;;p" ${DEPENDSFILE}` ${BULK_PREREQ} ; do \
pkgname=`${GREP} "^$$pkgdir " ${INDEXFILE} | ${AWK} '{print $$2}'` ; \
if [ -z "$$pkgname" ]; then continue ; fi ;\
pkgfile=${PACKAGES}/All/$${pkgname}${PKG_SUFX} ;\
@@ -396,32 +404,35 @@
nbrokenby=0;\
if [ "${USE_BULK_CACHE}" = "yes" ]; then \
${ECHO_MSG} "BULK> Marking all packages which depend upon ${PKGNAME} as broken:"; \
- for pkgdir in `${GREP} "^${PKGPATH} " ${SUPPORTSFILE} | ${SED} -e 's;^.*:;;g'`; do \
- pkgname=`${GREP} "^$$pkgdir " ${INDEXFILE} | ${AWK} '{print $$2}'` ;\
- if [ -z "$$pkgname" ]; then pkgname=unknown ; fi ; \
- ${ECHO_MSG} "BULK> marking package that requires ${PKGNAME} as broken: $$pkgname ($$pkgdir)";\
- pkgerr="-1"; \
- pkgignore=`(cd ${PKGSRCDIR}/$$pkgdir && ${MAKE} show-var VARNAME=PKG_FAIL_REASON)`; \
- pkgskip=`(cd ${PKGSRCDIR}/$$pkgdir && ${MAKE} show-var VARNAME=PKG_SKIP_REASON)`; \
- if [ ! -z "$${pkgignore}$${pkgskip}" -a ! -f ${PKGSRCDIR}/$$pkgdir/${BROKENFILE} ]; then \
- ${ECHO_MSG} "BULK> $$pkgname ($$pkgdir) may not be packaged because:" >> ${PKGSRCDIR}/$$pkgdir/${BROKENFILE};\
- ${ECHO_MSG} "BULK> $$pkgignore" >> ${PKGSRCDIR}/$$pkgdir/${BROKENFILE};\
- ${ECHO_MSG} "BULK> $$pkgskip" >> ${PKGSRCDIR}/$$pkgdir/${BROKENFILE};\
- if [ -z "`(cd ${PKGSRCDIR}/$$pkgdir && ${MAKE} show-var VARNAME=BROKEN)`" ]; then \
- pkgerr="0"; \
- else \
- pkgerr="1"; \
+ tmp=`${SED} -n -e "/^${_ESCPKGPATH} / s;^[^:]*:[ \t]*;;p" ${SUPPORTSFILE}` ; \
+ if test -n "$$tmp" ; then \
+ for pkgdir in $$tmp ; do \
+ pkgname=`${GREP} "^$$pkgdir " ${INDEXFILE} | ${AWK} '{print $$2}'` ;\
+ if [ -z "$$pkgname" ]; then pkgname=unknown ; fi ; \
+ ${ECHO_MSG} "BULK> marking package that requires ${PKGNAME} as broken: $$pkgname ($$pkgdir)";\
+ pkgerr="-1"; \
+ pkgignore=`(cd ${PKGSRCDIR}/$$pkgdir && ${MAKE} show-var VARNAME=PKG_FAIL_REASON)`; \
+ pkgskip=`(cd ${PKGSRCDIR}/$$pkgdir && ${MAKE} show-var VARNAME=PKG_SKIP_REASON)`; \
+ if [ ! -z "$${pkgignore}$${pkgskip}" -a ! -f ${PKGSRCDIR}/$$pkgdir/${BROKENFILE} ]; then \
+ ${ECHO_MSG} "BULK> $$pkgname ($$pkgdir) may not be packaged because:" >> ${PKGSRCDIR}/$$pkgdir/${BROKENFILE};\
+ ${ECHO_MSG} "BULK> $$pkgignore" >> ${PKGSRCDIR}/$$pkgdir/${BROKENFILE};\
+ ${ECHO_MSG} "BULK> $$pkgskip" >> ${PKGSRCDIR}/$$pkgdir/${BROKENFILE};\
+ if [ -z "`(cd ${PKGSRCDIR}/$$pkgdir && ${MAKE} show-var VARNAME=BROKEN)`" ]; then \
+ pkgerr="0"; \
+ else \
+ pkgerr="1"; \
+ fi; \
fi; \
- fi; \
- ${ECHO_MSG} "BULK> $$pkgname ($$pkgdir) is broken because it depends upon ${PKGNAME} (${PKGPATH}) which is broken." \
- >> ${PKGSRCDIR}/$$pkgdir/${BROKENFILE};\
- ${ECHO_MSG} "Please view the <a href=\"../../${PKGPATH}/${BROKENFILE}\">build log for ${PKGNAME}</a>.<br />" \
- >> ${PKGSRCDIR}/$$pkgdir/${BROKENFILE};\
- nbrokenby=`expr $$nbrokenby + 1`;\
- if ${GREP} -q " $$pkgdir/${BROKENFILE}" ${PKGSRCDIR}/${BROKENFILE} ; then :; else \
- ${ECHO} " $$pkgerr $$pkgdir/${BROKENFILE} 0 " >> ${PKGSRCDIR}/${BROKENFILE} ;\
- fi ;\
- done ;\
+ ${ECHO_MSG} "BULK> $$pkgname ($$pkgdir) is broken because it depends upon ${PKGNAME} (${PKGPATH}) which is broken." \
+ >> ${PKGSRCDIR}/$$pkgdir/${BROKENFILE};\
+ ${ECHO_MSG} "Please view the <a href=\"../../${PKGPATH}/${BROKENFILE}\">build log for ${PKGNAME}</a>.<br />" \
+ >> ${PKGSRCDIR}/$$pkgdir/${BROKENFILE};\
+ nbrokenby=`expr $$nbrokenby + 1`;\
+ if ${GREP} -q " $$pkgdir/${BROKENFILE}" ${PKGSRCDIR}/${BROKENFILE} ; then :; else \
+ ${ECHO} " $$pkgerr $$pkgdir/${BROKENFILE} 0 " >> ${PKGSRCDIR}/${BROKENFILE} ;\
+ fi ;\
+ done ;\
+ fi ;\
fi ;\
nerrors=`${GREP} -c '^\*\*\* Error code' ${BROKENFILE} || true`; \
if [ -f ${INTERACTIVE_COOKIE} ]; then \
@@ -434,7 +445,7 @@
yes|YES) ;; \
*) ${ECHO_MSG} "BULK> Cleaning packages and its depends"; \
if [ "${USE_BULK_CACHE}" = "yes" ]; then \
- for pkgdir in ${PKGPATH} `${GREP} "^${PKGPATH} " ${DEPENDSFILE} | ${SED} -e 's;^.*:;;g'`; do \
+ for pkgdir in ${PKGPATH} `${SED} -n -e "/^${_ESCPKGPATH} / s;^[^:]*:;;p" ${DEPENDSFILE}`; do \
${DO} (cd ${PKGSRCDIR}/$$pkgdir && ${MAKE} clean) ; \
done; \
else \
Home |
Main Index |
Thread Index |
Old Index