From owner-freebsd-ports Fri Sep 17 17:29:50 1999 Delivered-To: freebsd-ports@freebsd.org Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (Postfix) with ESMTP id B729214C03; Fri, 17 Sep 1999 17:29:15 -0700 (PDT) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.3/8.9.1) with ESMTP id RAA02877; Fri, 17 Sep 1999 17:29:15 -0700 (PDT) (envelope-from jdp@polstra.com) From: John Polstra Received: (from jdp@localhost) by vashon.polstra.com (8.9.3/8.9.1) id RAA55497; Fri, 17 Sep 1999 17:29:14 -0700 (PDT) (envelope-from jdp@polstra.com) Date: Fri, 17 Sep 1999 17:29:14 -0700 (PDT) Message-Id: <199909180029.RAA55497@vashon.polstra.com> To: ports@freebsd.org Subject: Re: Handling distfiles in multiple subdirs on master site: how? In-Reply-To: References: Organization: Polstra & Co., Seattle, WA Cc: asami@freebsd.org Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org In article , I wrote: > I'm trying to make a new port and have run into something I don't > know how to do. The master site has a funky system of cgi scripts (I > guess) that constructs tarballs of arbitrary subtrees on the fly. I > need to get several distfiles from various subdirectories on the same > master site. Ideally, I'd like to be able to do something like this > (just an example): > > MASTER_SITES= http://m3.polymtl.ca/m3htbin/download/m3/pkg/pm3-1.1.13/ > DISTFILES= libs/set.tgz \ > m3config.tgz \ > graphics/gr-libs/ui > DIST_SUBDIR= pm3-1.1.13 > > But having subdirectories in the DISTFILES list isn't working. I made some changes to locally that solve this problem. Could one or more ports-gods please look it over and hopefully get it committed? The patch is appended. Here's what this patch does: * If filenames in DISTFILES contain one or more "/" characters, their directory structure is preserved on the local machine. This is done by creating the necessary directories and adding a "-o path" option to the fetch command. * If there are no "/" characters in the filenames, the "-o path" argument is omitted from the fetch command, and everything happens just the same as always. Thus, existing ports which override FETCH_CMD won't experience any surprises. It all seems to work fine here, including the "makesum", "checksum" and "extract" targets. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "No matter how cynical I get, I just can't keep up." -- Nora Ephron Index: bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.319 diff -u -r1.319 bsd.port.mk --- bsd.port.mk 1999/09/11 01:11:21 1.319 +++ bsd.port.mk 1999/09/17 01:42:13 @@ -1474,7 +1474,12 @@ ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \ DIR=${DIST_SUBDIR}; \ CKSIZE=`${GREP} "^SIZE ($${DIR:+$$DIR/}$$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \ - if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \ + case $${file} in \ + */*) ${MKDIR} $${file%/*}; \ + args="-o $${file} $${site}$${file}";; \ + *) args=$${site}$${file};; \ + esac; \ + if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} ${FETCH_AFTER_ARGS}; then \ continue 2; \ fi \ done; \ @@ -1498,7 +1503,12 @@ ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \ DIR=${DIST_SUBDIR}; \ CKSIZE=`${GREP} "^SIZE ($${DIR:+$$DIR/}$$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \ - if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \ + case $${file} in \ + */*) ${MKDIR} $${file%/*}; \ + args="-o $${file} $${site}$${file}";; \ + *) args=$${site}$${file};; \ + esac; \ + if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} ${FETCH_AFTER_ARGS}; then \ continue 2; \ fi \ done; \ @@ -2033,7 +2043,11 @@ for site in ${MASTER_SITES}; do \ DIR=${DIST_SUBDIR}; \ CKSIZE=`${GREP} "^SIZE ($${DIR:+$$DIR/}$$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \ - ${ECHO} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '||' ; \ + case $${file} in \ + */*) args="-o $${file} $${site}$${file}";; \ + *) args=$${site}$${file};; \ + esac; \ + ${ECHO} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} "${FETCH_AFTER_ARGS}" '||' ; \ break; \ done; \ ${ECHO} "echo $${file} not fetched" ; \ @@ -2046,7 +2060,11 @@ for site in ${PATCH_SITES}; do \ DIR=${DIST_SUBDIR}; \ CKSIZE=`${GREP} "^SIZE ($${DIR:+$$DIR/}$$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \ - ${ECHO} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '||' ; \ + case $${file} in \ + */*) args="-o $${file} $${site}$${file}";; \ + *) args=$${site}$${file};; \ + esac; \ + ${ECHO} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} "${FETCH_AFTER_ARGS}" '||' ; \ break; \ done; \ ${ECHO} "echo $${file} not fetched" ; \ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message