Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Oct 1999 06:29:43 -0400
From:      W Gerald Hicks <wghicks@bellsouth.net>
To:        freebsd-ports@freebsd.org
Cc:        wghicks@wghicks.bellsouth.net
Subject:   distfiles with path prefixes
Message-ID:  <199910101029.GAA45098@bellsouth.net>

next in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199910101029.GAA45098>