diff options
author | reed <reed@pkgsrc.org> | 2005-07-06 05:52:34 +0000 |
---|---|---|
committer | reed <reed@pkgsrc.org> | 2005-07-06 05:52:34 +0000 |
commit | c3c794690571ae629d19801834cd5eac3d0b249c (patch) | |
tree | f4303cf4ea7541411005fdbd2544777f923e7e29 /mk | |
parent | 597263b97a96be1a2f16501358bc6cd77a7508c9 (diff) | |
download | pkgsrc-c3c794690571ae629d19801834cd5eac3d0b249c.tar.gz |
For the fetch-list target: Do not use mkdir if just creating a shell
script that will make the directory later. This fixes the problem
where it fails when doesn't have write access -- for example use
"make fetch-list" to create the shell script to use on another
system.
Thank you, Geert Hendrickx, for your feedback.
Also in a few places echo ${fetchfile:T} instead of ${fetchfile}.
(Todo: maybe should not say "not fetched" until has tried all sites.)
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.mk | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index ec6bb3aab45..d6a99286e72 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.1705 2005/06/27 16:25:43 rillig Exp $ +# $NetBSD: bsd.pkg.mk,v 1.1706 2005/07/06 05:52:34 reed Exp $ # # This file is in the public domain. # @@ -3255,12 +3255,9 @@ fetch-list-one-pkg: @${ECHO} '#' @location=`${PWD_CMD} | ${AWK} -F / '{ print $$(NF-1) "/" $$NF }'`; \ ${ECHO} '# Need additional files for ${PKGNAME} ('$$location')...' - @${ECHO} '#' - @${MKDIR} ${_DISTDIR} . for fetchfile in ${_ALLFILES} . if defined(_FETCH_MESSAGE) - @(cd ${_DISTDIR}; \ - if [ ! -f ${fetchfile:T} ]; then \ + if [ ! -f ${_DISTDIR}/${fetchfile:T} ]; then \ ${ECHO}; \ filesize=`${AWK} ' \ /^Size/ && $$2 == "(${fetchfile})" { print $$4 } \ @@ -3268,10 +3265,9 @@ fetch-list-one-pkg: ${ECHO} '# Prompt user to get ${fetchfile} ('$${filesize-???}' bytes) manually:'; \ ${ECHO} '#'; \ ${ECHO} ${_FETCH_MESSAGE:Q}; \ - fi) + fi . elif defined(DYNAMIC_MASTER_SITES) - @(cd ${_DISTDIR}; \ - if [ ! -f ${fetchfile:T} ]; then \ + if [ ! -f ${_DISTDIR}/${fetchfile:T} ]; then \ ${ECHO}; \ filesize=`${AWK} ' \ /^Size/ && $$2 == "(${fetchfile})" { print $$4 } \ @@ -3288,13 +3284,12 @@ fetch-list-one-pkg: ${ECHO} 'cd ${_DISTDIR} && [ -f ${fetchfile} -o -f ${fetchfile:T} ] ||'; \ ${ECHO} 'for site in $$sites; do'; \ ${ECHO} ' ${FETCH_CMD} ${FETCH_BEFORE_ARGS} "$${site}${fetchfile:T}" ${FETCH_AFTER_ARGS} && break ||'; \ - ${ECHO} ' ${ECHO} ${fetchfile} not fetched'; \ + ${ECHO} ' ${ECHO} ${fetchfile:T} not fetched'; \ ${ECHO} done; \ ${ECHO} ')'; \ - fi) + fi . else - @(cd ${_DISTDIR}; \ - if [ ! -f ${fetchfile:T} ]; then \ + if [ ! -f ${_DISTDIR}/${fetchfile:T} ]; then \ ${ECHO}; \ filesize=`${AWK} ' \ /^Size/ && $$2 == "(${fetchfile})" { print $$4 } \ @@ -3307,9 +3302,9 @@ fetch-list-one-pkg: ${ECHO} 'cd ${_DISTDIR} && [ -f ${fetchfile} -o -f ${fetchfile:T} ] ||'; \ ${ECHO} 'for site in $$sites; do'; \ ${ECHO} ' ${FETCH_CMD} ${FETCH_BEFORE_ARGS} "$${site}${fetchfile:T}" ${FETCH_AFTER_ARGS} && break ||'; \ - ${ECHO} ' ${ECHO} ${fetchfile} not fetched'; \ + ${ECHO} ' ${ECHO} ${fetchfile:T} not fetched'; \ ${ECHO} done; \ - fi) + fi . endif # defined(_FETCH_MESSAGE) || defined(DYNAMIC_MASTER_SITES) . endfor . endif # !empty(_ALLFILES) |