[Midnightbsd-cvs] mports: bsd.mport.mk: add a few things to make magus's life easier.

ctriv at midnightbsd.org ctriv at midnightbsd.org
Tue Oct 23 00:56:46 EDT 2007


Log Message:
-----------
add a few things to make magus's life easier.

Modified Files:
--------------
    mports/Mk:
        bsd.mport.mk (r1.68 -> r1.69)

-------------- next part --------------
Index: bsd.mport.mk
===================================================================
RCS file: /home/cvs/mports/Mk/bsd.mport.mk,v
retrieving revision 1.68
retrieving revision 1.69
diff -LMk/bsd.mport.mk -LMk/bsd.mport.mk -u -r1.68 -r1.69
--- Mk/bsd.mport.mk
+++ Mk/bsd.mport.mk
@@ -3417,19 +3417,25 @@
 .endif
 
 
+.if defined(MAGUS)
+_SLEEP=${TRUE}
+.else
+_SLEEP=sleep
+.endif
+
 .if !target(check-license) 
 .if defined(MPORT_MAINTAINER_MODE)
 check-license:
 .if !defined(LICENSE) 
 	@${ECHO_MSG} "${PKGNAME}: Makefile error: LICENSE not set."
-	@sleep 5
+	@${_SLEEP} 5
 .else
 	@if test -z '${LICENSE}'; then \
 		${ECHO_MSG} "${PKGNAME}: Makefile error: empty license."; \
-		sleep 5; \
+		${_SLEEP} 5; \
 	elif ! ${ECHO_CMD} ${_LICENSES} | ${GREP} ${LICENSE} >/dev/null; then \
 		${ECHO_MSG} "${PKGNAME}: Makefile error: Invalid LICENSE: ${LICENSE}"; \
-		sleep 5; \
+		${_SLEEP} 5; \
 	else \
 		${DO_NADA}; \
 	fi
@@ -3768,6 +3774,23 @@
 .	endif		
 .endif
 
+
+#
+# This is the depends target used by our build cluster, magus. It is 
+# much like cached-install, but a missing depends file in this case is 
+# a fatal error.
+#
+.if !target(magus-install-depend)
+magus-install-depend:
+.   if exists(${PKGFILE})
+		@cd ${.CURDIR} && ${MAKE} ${_INSTALL_SEQ}
+.   else
+		@echo "Missing dependency package file: ${PKGFILE}"
+		@exit 1
+.   endif
+.endif
+
+
 #
 # Utility targets follow
 #
@@ -5165,6 +5188,7 @@
 .if !target(describe-yaml)
 describe-yaml:
 	@perl -MYAML -e ' \
+		sub uniq (@) {  my %saw;  return grep(!$$saw{$$_}++, @_); } \
 		my %port = ( \
 			pkgname     => q(${PKGSUBNAME}), \
 			name        => q(${PKGORIGIN}), \
@@ -5175,13 +5199,13 @@
 		); \
 		$$port{license} ||= undef; \
 		my %depends; \
-		$$depends{extract} = [ map((split /:/)[1], qw{${EXTRACT_DEPENDS:S|${PORTSDIR}/||g}}) ]; \
-		$$depends{patch}   = [ map((split /:/)[1], qw{${PATCH_DEPENDS:S|${PORTSDIR}/||}})   ]; \
-		$$depends{fetch}   = [ map((split /:/)[1], qw{${FETCH_DEPENDS:S|${PORTSDIR}/||}})   ]; \
-		$$depends{build}   = [ map((split /:/)[1], qw{${BUILD_DEPENDS:S|${PORTSDIR}/||}})   ]; \
-		$$depends{run}     = [ map((split /:/)[1], qw{${RUN_DEPENDS:S|${PORTSDIR}/||}})     ]; \
-		$$depends{misc}	   = [ map((split /:/)[0], qw{${DEPENDS:S|${PORTSDIR}/||}})         ]; \
-		$$depends{lib}     = [ map((split /:/)[1], qw{${LIB_DEPENDS:S|${PORTSDIR}/||}})     ]; \
+		$$depends{extract} = [ uniq map((split /:/)[1], qw{${EXTRACT_DEPENDS:S|${PORTSDIR}/||g}}) ]; \
+		$$depends{patch}   = [ uniq map((split /:/)[1], qw{${PATCH_DEPENDS:S|${PORTSDIR}/||}})   ]; \
+		$$depends{fetch}   = [ uniq map((split /:/)[1], qw{${FETCH_DEPENDS:S|${PORTSDIR}/||}})   ]; \
+		$$depends{build}   = [ uniq map((split /:/)[1], qw{${BUILD_DEPENDS:S|${PORTSDIR}/||}})   ]; \
+		$$depends{run}     = [ uniq map((split /:/)[1], qw{${RUN_DEPENDS:S|${PORTSDIR}/||}})     ]; \
+		$$depends{misc}	   = [ uniq map((split /:/)[0], qw{${DEPENDS:S|${PORTSDIR}/||}})         ]; \
+		$$depends{lib}     = [ uniq map((split /:/)[1], qw{${LIB_DEPENDS:S|${PORTSDIR}/||}})     ]; \
 		$$port{depends}  = \%depends; \
 		open(my $$desc, q(<), q(${DESCR})) || die qq(Could not open ${DESCR}: $$!\n); \
 		while (<$$desc>) { \


More information about the Midnightbsd-cvs mailing list