From owner-freebsd-ports Sun Oct 10 3:24:23 1999 Delivered-To: freebsd-ports@freebsd.org Received: from mail1.atl.bellsouth.net (mail1.atl.bellsouth.net [205.152.0.28]) by hub.freebsd.org (Postfix) with ESMTP id 82CEA1551B for ; Sun, 10 Oct 1999 03:24:03 -0700 (PDT) (envelope-from wghicks@bellsouth.net) Received: from wghicks.bellsouth.net (host-216-78-101-26.asm.bellsouth.net [216.78.101.26]) by mail1.atl.bellsouth.net (3.3.4alt/0.75.2) with ESMTP id GAA09279 for ; Sun, 10 Oct 1999 06:19:38 -0400 (EDT) Received: from wghicks.bellsouth.net (IDENT:wghicks@localhost [127.0.0.1]) by wghicks.bellsouth.net (8.9.3/8.9.2) with ESMTP id GAA45098; Sun, 10 Oct 1999 06:29:43 -0400 (EDT) (envelope-from wghicks@wghicks.bellsouth.net) Message-Id: <199910101029.GAA45098@bellsouth.net> To: freebsd-ports@freebsd.org Cc: wghicks@wghicks.bellsouth.net Subject: distfiles with path prefixes Date: Sun, 10 Oct 1999 06:29:43 -0400 From: W Gerald Hicks Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Recently ports/Mk/bsd.port.mk was modified to permit a prefix path to be specified for a distfile. As I understand it, this prefix specifies the remote directory containing the distfile and is not propagated to the local distfile directory. In constructing a new port which uses this feature, 'fetch' seems to work but I was unable to 'makesum', 'checksum' or 'extract' as the remote path prefix was not being stripped from the distfile spec. I'm trying to use a distfiles spec that looks like this: DISTFILES= newlib/newlib-1.8.1.tar.gz binutils/binutils-2.9.1.tar.gz \ gcc/gcc-core-2.95.1.tar.gz Attached is a patch which makes the extract, checksum and makesum targets work for me. I have not considered 'patch' functionality... Cheers, Jerry Hicks wghicks@bellsouth.net --- bsd.port.mk.orig Sat Oct 2 04:12:33 1999 +++ bsd.port.mk Sun Oct 10 08:57:52 1999 @@ -1527,7 +1527,11 @@ @${RM} -rf ${WRKDIR} @${MKDIR} ${WRKDIR} @for file in ${EXTRACT_ONLY}; do \ - if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\ + case $${file} in \ + */*) basefile=`basename $${file}` ;; \ + *) basefile=$${file} ;; \ + esac; \ + if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$basefile ${EXTRACT_AFTER_ARGS});\ then \ exit 1; \ fi \ @@ -2081,10 +2085,18 @@ @if [ -f ${MD5_FILE} ]; then ${RM} -f ${MD5_FILE}; fi @(cd ${DISTDIR}; \ for file in ${_CKSUMFILES}; do \ - ${MD5} $$file >> ${MD5_FILE}; \ + case $${file} in \ + */*) basefile=`basename $${file}` ;; \ + *) basefile=$${file} ;; \ + esac; \ + ${MD5} $${basefile} >> ${MD5_FILE}; \ done) @for file in ${_IGNOREFILES}; do \ - ${ECHO} "MD5 ($$file) = IGNORE" >> ${MD5_FILE}; \ + case $${file} in \ + */*) basefile=`basename $${file}` ;; \ + *) basefile=$${file} ;; \ + esac; \ + ${ECHO} "MD5 ($$basefile) = IGNORE" >> ${MD5_FILE}; \ done .endif # this line goes after the ${MD5} above @@ -2101,29 +2113,37 @@ else \ (cd ${DISTDIR}; OK="true"; \ for file in ${_CKSUMFILES}; do \ - CKSUM=`${MD5} < $$file`; \ - CKSUM2=`${GREP} "^MD5 ($$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \ + case $${file} in \ + */*) basefile=`basename $${file}` ;; \ + *) basefile=$${file} ;; \ + esac; \ + CKSUM=`${MD5} < $$basefile`; \ + CKSUM2=`${GREP} "^MD5 ($$basefile)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \ if [ "$$CKSUM2" = "" ]; then \ - ${ECHO_MSG} ">> No checksum recorded for $$file."; \ + ${ECHO_MSG} ">> No checksum recorded for $$basefile."; \ OK="false"; \ elif [ "$$CKSUM2" = "IGNORE" ]; then \ - ${ECHO_MSG} ">> Checksum for $$file is set to IGNORE in md5 file even though"; \ + ${ECHO_MSG} ">> Checksum for $$basefile is set to IGNORE in md5 file even though"; \ ${ECHO_MSG} " the file is not in the "'$$'"{IGNOREFILES} list."; \ OK="false"; \ elif ${EXPR} "$$CKSUM2" : ".*$$CKSUM" > /dev/null; then \ - ${ECHO_MSG} ">> Checksum OK for $$file."; \ + ${ECHO_MSG} ">> Checksum OK for $$basefile."; \ else \ - ${ECHO_MSG} ">> Checksum mismatch for $$file."; \ + ${ECHO_MSG} ">> Checksum mismatch for $$basefile."; \ OK="false"; \ fi; \ done; \ for file in ${_IGNOREFILES}; do \ - CKSUM2=`${GREP} "($$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \ + case $${file} in \ + */*) basefile=`basename $${file}` ;; \ + *) basefile=$${file} ;; \ + esac ; \ + CKSUM2=`${GREP} "($$basefile)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \ if [ "$$CKSUM2" = "" ]; then \ - ${ECHO_MSG} ">> No checksum recorded for $$file, file is in "'$$'"{IGNOREFILES} list."; \ + ${ECHO_MSG} ">> No checksum recorded for $$basefile, file is in "'$$'"{IGNOREFILES} list."; \ OK="false"; \ elif [ "$$CKSUM2" != "IGNORE" ]; then \ - ${ECHO_MSG} ">> Checksum for $$file is not set to IGNORE in md5 file even though"; \ + ${ECHO_MSG} ">> Checksum for $$basefile is not set to IGNORE in md5 file even though"; \ ${ECHO_MSG} " the file is in the "'$$'"{IGNOREFILES} list."; \ OK="false"; \ fi; \ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message