diff options
author | agc <agc> | 2001-05-03 13:01:04 +0000 |
---|---|---|
committer | agc <agc> | 2001-05-03 13:01:04 +0000 |
commit | 3c878d081291ae5155a47af5f6deabd8569a9e5c (patch) | |
tree | 63795500b38dc1f7ded4f4dd2e4f75839aeb210d /mk | |
parent | 0f2ad0fbb1e0335518ef8898cb50c2e08f16e51b (diff) | |
download | pkgsrc-3c878d081291ae5155a47af5f6deabd8569a9e5c.tar.gz |
Check that the ${PACKAGES} directory exists, before trying to cd there.
This modification allows "make readme" to succeed even if the ${PACKAGES}
hierarchy does not exist.
Fixes PR 12480 from Arto Selonen (arto@selonen.org), and addresses
PR 12362 from Masao Uebayashi <uebayasi@soum.co.jp>
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.mk | 97 |
1 files changed, 49 insertions, 48 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 9efe509fce9..d396396e87f 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.730 2001/04/26 08:35:38 tron Exp $ +# $NetBSD: bsd.pkg.mk,v 1.731 2001/05/03 13:01:04 agc Exp $ # # This file is in the public domain. # @@ -2787,53 +2787,54 @@ build-depends-list: # the target used to generate the README.html file. .if !target(binpkg-list) binpkg-list: - @\ - cd ${PACKAGES}; \ - case ${.CURDIR} in \ - */pkgsrc/packages) \ - for pkg in ${PKGREPOSITORYSUBDIR}/${PKGWILDCARD}${PKG_SUFX} ; \ - do \ - if [ -f "$$pkg" ] ; then \ - pkgname=`${ECHO} $$pkg | ${SED} 's@.*/@@'`; \ - ${ECHO} "<TR><TD>${MACHINE_ARCH}:<TD><a href=\"${PKG_URL}/$$pkg\">$$pkgname</a><TD>(${OPSYS} ${OS_VERSION})"; \ - fi ; \ - done ; \ - ;; \ - *) \ - cd ${PACKAGES}/../..; \ - for i in [1-9].*/*; do \ - if cd ${PACKAGES}/../../$$i/${PKGREPOSITORYSUBDIR} 2>/dev/null; then \ - for j in ${PKGWILDCARD}${PKG_SUFX}; \ - do \ - if [ -f "$$j" ]; then \ - ${ECHO} $$i/$$j; \ - fi; \ - done; \ - fi; \ - done | ${AWK} -F/ ' \ - { \ - release = $$1; \ - arch = $$2; \ - pkg = $$3; \ - gsub("\.tgz","", pkg); \ - if (arch != "m68k" && arch != "mipsel") { \ - if (arch in urls) \ - urls[arch "/" pkg "/" release] = "<a href=\"${PKG_URL}/" release "/" arch "/${PKGREPOSITORYSUBDIR}/" pkg "${PKG_SUFX}\">" pkg "</a>, " urls[arch]; \ - else \ - urls[arch "/" pkg "/" release] = "<a href=\"${PKG_URL}/" release "/" arch "/${PKGREPOSITORYSUBDIR}/" pkg "${PKG_SUFX}\">" pkg "</a> "; \ - } \ - } \ - END { \ - for (av in urls) { \ - split(av, ava, "/"); \ - arch=ava[1]; \ - pkg=ava[2]; \ - release=ava[3]; \ - print "<TR><TD>" arch ":<TD>" urls[av] "<TD>(${OPSYS} " release ")"; \ - } \ - }' | sort \ - ;; \ - esac + @if [ -e ${PACKAGES} ]; then \ + cd ${PACKAGES}; \ + case ${.CURDIR} in \ + */pkgsrc/packages) \ + for pkg in ${PKGREPOSITORYSUBDIR}/${PKGWILDCARD}${PKG_SUFX} ; \ + do \ + if [ -f "$$pkg" ] ; then \ + pkgname=`${ECHO} $$pkg | ${SED} 's@.*/@@'`; \ + ${ECHO} "<TR><TD>${MACHINE_ARCH}:<TD><a href=\"${PKG_URL}/$$pkg\">$$pkgname</a><TD>(${OPSYS} ${OS_VERSION})"; \ + fi ; \ + done ; \ + ;; \ + *) \ + cd ${PACKAGES}/../..; \ + for i in [1-9].*/*; do \ + if cd ${PACKAGES}/../../$$i/${PKGREPOSITORYSUBDIR} 2>/dev/null; then \ + for j in ${PKGWILDCARD}${PKG_SUFX}; \ + do \ + if [ -f "$$j" ]; then \ + ${ECHO} $$i/$$j;\ + fi; \ + done; \ + fi; \ + done | ${AWK} -F/ ' \ + { \ + release = $$1; \ + arch = $$2; \ + pkg = $$3; \ + gsub("\.tgz","", pkg); \ + if (arch != "m68k" && arch != "mipsel") { \ + if (arch in urls) \ + urls[arch "/" pkg "/" release] = "<a href=\"${PKG_URL}/" release "/" arch "/${PKGREPOSITORYSUBDIR}/" pkg "${PKG_SUFX}\">" pkg "</a>, " urls[arch]; \ + else \ + urls[arch "/" pkg "/" release] = "<a href=\"${PKG_URL}/" release "/" arch "/${PKGREPOSITORYSUBDIR}/" pkg "${PKG_SUFX}\">" pkg "</a> "; \ + } \ + } \ + END { \ + for (av in urls) { \ + split(av, ava, "/"); \ + arch=ava[1]; \ + pkg=ava[2]; \ + release=ava[3]; \ + print "<TR><TD>" arch ":<TD>" urls[av] "<TD>(${OPSYS} " release ")"; \ + } \ + }' | sort \ + ;; \ + esac; \ + fi .endif ################################################################ |