[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Add in checksum for dependencies feature



Here is a patch that adds in the ability to do a checksum on a port's
dependencies, if the environment variable CHECKSUMDEPENDS is set to
Yes. Initial testing I did showed that it worked just fine with
various ports and various flavors of ports. I've wanted this feature
for a while, and since it's always just shutup and code, here's the
patch:

Index: bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.740
diff -u -r1.740 bsd.port.mk
--- bsd.port.mk	27 Nov 2005 12:31:18 -0000	1.740
+++ bsd.port.mk	7 Dec 2005 19:20:07 -0000
@@ -65,6 +65,7 @@
 BIN_PACKAGES?=No
 FETCH_PACKAGES?=No
 CLEANDEPENDS?=No
+CHECKSUMDEPENDS?=No
 USE_SYSTRACE?=	No
 BULK?=No
 RECURSIVE_FETCH_LIST?=	Yes
@@ -118,6 +119,7 @@
 BULK_${PKGPATH}?= ${BULK}
 BULK_TARGETS_${PKGPATH}?= ${BULK_TARGETS}
 CLEANDEPENDS_${PKGPATH}?= ${CLEANDEPENDS}
+CHECKSUMDEPENDS_${PKGPATH}?= ${CHECKSUMDEPENDS}

 # Commands and command settings.
 PKG_DBDIR?=		/var/db/pkg
@@ -200,6 +202,11 @@
 .  endif
 .endfor

+_checksum=${checksum}
+.if ${CHECKSUMDEPENDS_${PKGPATH}:L} == "yes"
+_checksum+=depends
+.endif
+
 NOMANCOMPRESS?=	Yes
 DEF_UMASK?=		022

@@ -1139,6 +1146,7 @@
 _FAKE_SETUP=TRUEPREFIX=${PREFIX} PREFIX=${WRKINST}${PREFIX}
${DESTDIRNAME}=${WRKINST}

 _CLEANDEPENDS?=Yes
+_CHECKSUMDEPENDS?=Yes

 # mirroring utilities
 .if !empty(DIST_SUBDIR)
@@ -1508,7 +1516,7 @@
 _internal-libs-depends: ${_DEPlibs_COOKIE}

 .if defined(IGNORE) && !defined(NO_IGNORE)
-_internal-fetch _internal-checksum _internal-extract _internal-patch \
+_internal-fetch _internal-checksum _internal-checksumdepends
_internal-extract _internal-patch \
 _internal-configure _internal-all _internal-build _internal-install \
 _internal-regress _internal-uninstall _internal-deinstall _internal-fake \
 _internal-update _internal-newlib-depends-check _internal-plist \
@@ -1566,7 +1574,15 @@
 .  endif


-_internal-checksum: _internal-fetch
+_internal-checksumdepends:
+.if ${_checksum:L:Mdepends} && ${_CHECKSUMDEPENDS:L} == "yes"
+	@PACKAGING='${SUBPACKAGE}' ${MAKE} all-dir-depends|tsort
-r|${_zap_last_line}|while read subdir; do \
+		${_flavor_fragment}; \
+		eval $$toset ${MAKE} _CHECKSUMDEPENDS=No checksum; \
+	done
+.endif
+
+_internal-checksum: _internal-checksumdepends _internal-fetch
 .  if ! defined(NO_CHECKSUM)
 	@checksum_file=${CHECKSUM_FILE}; \
 	if [ ! -f $$checksum_file ]; then \
@@ -2777,7 +2793,7 @@
 	license-check _license-check \
 	_internal-extract _internal-distpatch _internal-configure \
 	_internal-build _internal-all _internal_install _internal-fake \
-	_internal-package _internal_fetch _internal-checksum \
+	_internal-package _internal_fetch _internal-checksum
_internal-checksumdepends \
 	_internal-depends _internal-lib-depends _internal-libs-depends \
 	_internal-build-depends \
 	_internal-run-depends _internal-regress-depends \