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
This commit is contained in:
parent
2559846ff2
commit
ef23058a67
1 changed files with 41 additions and 30 deletions
|
@ -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>
|
||||
|
@ -143,6 +143,12 @@ BULK_PREREQ+= pkgtools/digest
|
|||
# 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 @@ bulk-package:
|
|||
${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 @@ bulk-package:
|
|||
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 @@ bulk-package:
|
|||
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,7 +404,9 @@ bulk-package:
|
|||
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 \
|
||||
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)";\
|
||||
|
@ -423,6 +433,7 @@ bulk-package:
|
|||
fi ;\
|
||||
done ;\
|
||||
fi ;\
|
||||
fi ;\
|
||||
nerrors=`${GREP} -c '^\*\*\* Error code' ${BROKENFILE} || true`; \
|
||||
if [ -f ${INTERACTIVE_COOKIE} ]; then \
|
||||
nerrors="0"; \
|
||||
|
@ -434,7 +445,7 @@ bulk-package:
|
|||
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 \
|
||||
|
|
Loading…
Reference in a new issue