distfile belongs to?

Doug Barton dougb at FreeBSD.org
Thu Dec 7 22:22:25 PST 2006


Doug Barton wrote:
> Wesley Shields wrote:
> 
>> Part 2 (the bsd.port.mk piece) is the patch posted by Doug with Ade's
>> suggestions.
> 
> You missed the second patch I sent with the ${file%:*} changes.

One more for fun. :) I was looking through bsd.port.mk for another
purpose tonight and came across ${ALLFILES}. Not only does it combine
dist and patch files into one variable, it has the benefit of not
adding the : stuff to the filenames in the first place.

Learning as I go,

Doug
-------------- next part --------------
Index: bsd.port.mk
===================================================================
RCS file: /usr/local/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.544
diff -u -r1.544 bsd.port.mk
--- bsd.port.mk	30 Sep 2006 19:25:45 -0000	1.544
+++ bsd.port.mk	8 Dec 2006 06:11:25 -0000
@@ -5395,11 +5395,20 @@
 # files exist.
 
 .if !target(generate-plist)
+.if defined(DIST_SUBDIR)
+PDS=	${DIST_SUBDIR}/
+.endif
 generate-plist:
 	@${ECHO_MSG} "===>   Generating temporary packing list"
 	@${MKDIR} `${DIRNAME} ${TMPPLIST}`
 	@if [ ! -f ${DESCR} ]; then ${ECHO_CMD} "** Missing pkg-descr for ${PKGNAME}."; exit 1; fi
 	@>${TMPPLIST}
+	@for file in ${ALLFILES}; do \
+		distsize=`${GREP} "^SIZE (${PDS}$${file})" ${MD5_FILE} | ${CUT} -f4 -d' '`; \
+		distsha256=`${GREP} "^SHA256 (${PDS}$${file})" ${MD5_FILE} | ${CUT} -f4 -d' '`; \
+		distmd5=`${GREP} "^MD5 (${PDS}$${file})" ${MD5_FILE} | ${CUT} -f4 -d' '`; \
+		${ECHO_CMD} "@comment DISTFILE:${PDS}$${file}:SIZE=$${distsize}:SHA256=$${distsha256}:MD5=$${distmd5}" >> ${TMPPLIST}; \
+	done
 	@for file in ${PLIST_FILES}; do \
 		${ECHO_CMD} $${file} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} >> ${TMPPLIST}; \
 	done


More information about the freebsd-ports mailing list