ports/86776: [patch] bsd.port.mk - fetch-list doesn't do as described
Edwin Groothuis
edwin at mavetju.org
Sat Oct 1 07:50:12 UTC 2005
>Number: 86776
>Category: ports
>Synopsis: [patch] bsd.port.mk - fetch-list doesn't do as described
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sat Oct 01 07:50:11 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Edwin Groothuis
>Release: FreeBSD 5.2.1-RELEASE i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #8: Wed Dec 15 16:58:01 EST 2004 edwin at k7.mavetju:/usr/src-5.2.1/sys/i386/compile/k7 i386
>Description:
The fetch-list target in bsd.port.mk is described as:
# fetch-list - Show list of files that would be retrieved by fetch.
But when running it, it returns:
[/usr/ports/www/squid] root at tim>DISTDIR=/tmp/foo make fetch-list
/usr/bin/env /usr/bin/fetch -ARr -S 1069922 ftp://ftp.squid-cache.org/pub/squid-2/STABLE/squid-2.5.STABLE10.tar.bz2 || /usr/bin/env /usr/bin/fetch -ARr -S 1069922 ftp://ftp.unimelb.edu.au/pub/cwis/servers/unix/squid/squid-2/STABLE/squid-2.5.STABLE10.tar.bz2 || /usr/bin/env /usr/bin/fetch -ARr -S 1069922 ftp://sunsite.auc.dk/pub/infosystems/squid/squid
[...]
That is not how the description describes it, and it neither returns
a usable list for users.
With the patch applied, it gives a real list:
[/usr/ports/www/squid] root at tim>DISTDIR=/tmp/foo make fetch-list
http://distfiles.barnet.com.au/distfiles/squid2.5/squid-2.5.STABLE10.tar.bz2
ftp://ftp.squid-cache.org/pub/squid-2/STABLE/squid-2.5.STABLE10.tar.bz2
ftp://ftp.unimelb.edu.au/pub/cwis/servers/unix/squid/squid-2/STABLE/squid-2.5.STABLE10.tar.bz2
ftp://sunsite.auc.dk/pub/infosystems/squid/squid-2/STABLE/squid-2.5.STABLE10.tar.bz2
ftp://ftp.mirrorservice.org/sites/ftp.squid-cache.org/pub/squid-2/STABLE/squid-2.5.STABLE10.tar.bz2
ftp://www.t.ring.gr.jp/pub/net/www/squid/squid-2/STABLE/squid-2.5.STABLE10.tar.bz2
http://www.t.ring.gr.jp/archives/net/www/squid/squid-2/STABLE/squid-2.5.STABLE10.tar.bz2
ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/squid2.5/squid-2.5.STABLE10.tar.bz2
And it introduces a new target: fetch-all-list:
# fetch-all-list - Show all files which could be fetched.
Which does the same as fetch-list but does not ignore the already
fetched files.
>How-To-Repeat:
>Fix:
--- bsd.port.mk.orig Sat Oct 1 15:56:43 2005
+++ bsd.port.mk Sat Oct 1 17:38:56 2005
@@ -608,20 +608,23 @@
#
# fetch - Retrieves ${DISTFILES} (and ${PATCHFILES} if defined)
# into ${DISTDIR} as necessary.
-# fetch-list - Show list of files that would be retrieved by fetch.
+# fetch-list - Show list of URLs that will be retrieved by fetch.
# fetch-recursive
# - Retrieves ${DISTFILES} (and ${PATCHFILES} if defined),
# for port and dependencies into ${DISTDIR} as necessary.
# fetch-recursive-list
-# - Show list of files that would be retrieved by
-# fetch-recursive.
+# - Show list of URLs that will be retrieved by fetch-recursive.
# fetch-required-list
-# - Show list of files that would be retrieved by
-# fetch-required.
+# - Show list of URLs that will be retrieved by fetch-required.
# fetch-required
# - Retrieves ${DISTFILES} (and ${PATCHFILES} if defined),
# for port and dependencies that are not already installed
# into ${DISTDIR}.
+# fetch-all-list
+# - Show list of URLS which would be retrieved by fetch if
+# none of the ${DISTFILES} or ${PATCHFILES} would be in
+# ${DISTDIR} yet.
+#
# all-depends-list
# - Show all directories which are dependencies
# for this port.
@@ -4076,11 +4079,11 @@
fetch-list:
@${MKDIR} ${_DISTDIR}
@(cd ${_DISTDIR}; \
- ${_MASTER_SITES_ENV} ; \
- for _file in ${DISTFILES}; do \
+ ${_MASTER_SITES_ENV} ; \
+ for _file in ${DISTFILES}; do \
file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
- if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
+ if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
if [ ! -z "$$select" ] ; then \
__MASTER_SITES_TMP= ; \
for group in $$select; do \
@@ -4101,18 +4104,17 @@
*/*) args="-o $${file} $${site}$${file}";; \
*) args=$${site}$${file};; \
esac; \
- ${ECHO_CMD} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} "${FETCH_AFTER_ARGS}" '|| ' ; \
+ ${ECHO_CMD} $${args} ; \
done; \
- ${ECHO_CMD} "${ECHO_CMD} $${file} not fetched" ; \
fi \
done)
.if defined(PATCHFILES)
@(cd ${_DISTDIR}; \
- ${_PATCH_SITES_ENV} ; \
- for _file in ${PATCHFILES}; do \
+ ${_PATCH_SITES_ENV} ; \
+ for _file in ${PATCHFILES}; do \
file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
- if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
+ if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
if [ ! -z "$$select" ] ; then \
__PATCH_SITES_TMP= ; \
for group in $$select; do \
@@ -4133,9 +4135,8 @@
*/*) args="-o $${file} $${site}$${file}";; \
*) args=$${site}$${file};; \
esac; \
- ${ECHO_CMD} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} "${FETCH_AFTER_ARGS}" '|| ' ; \
+ ${ECHO_CMD} $${args} ; \
done; \
- ${ECHO_CMD} "${ECHO_CMD} $${file} not fetched" ; \
fi \
done)
.endif
@@ -4567,6 +4568,11 @@
.endif
.endif
.endfor
+.endif
+
+.if !target(fetch-all-list)
+fetch-all-list: fetch-list
+ @LISTALL=yes ${MAKE} fetch-list
.endif
.if !target(checksum-recursive)
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list