[Midnightbsd-cvs] mports: bsd.mport.mk: clean up the package depends stuff for the mport
ctriv at midnightbsd.org
ctriv at midnightbsd.org
Tue Mar 25 21:48:37 EDT 2008
Log Message:
-----------
clean up the package depends stuff for the mport tools side.
Modified Files:
--------------
mports/Mk:
bsd.mport.mk (r1.84 -> r1.85)
-------------- next part --------------
Index: bsd.mport.mk
===================================================================
RCS file: /home/cvs/mports/Mk/bsd.mport.mk,v
retrieving revision 1.84
retrieving revision 1.85
diff -L Mk/bsd.mport.mk -L Mk/bsd.mport.mk -u -r1.84 -r1.85
--- Mk/bsd.mport.mk
+++ Mk/bsd.mport.mk
@@ -70,9 +70,10 @@
# numerically (e.g. if port-0.3 is newer than port-1998).
# In this case, incrementing PORTEPOCH forces the revision.
# Default: 0 (no effect).
-# PKGNAME - Always defined as
-# ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}.
-# Do not define this in your Makefile.
+# PKGSUBNAME - Always defined as
+# ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
+# PKGNAME - Defined as ${PKGSUBNAME}-${PORTVERSION}
+# Do not define this or PKGSUBNAME in your Makefile.
# PKGNAMEPREFIX - Prefix to specify that port is language-specific, etc.
# Optional.
# PKGNAMESUFFIX - Suffix to specify compilation options. Optional.
@@ -5075,15 +5076,24 @@
# the mport binary tools only store the the first tier of the depenancy
# tree in a mports archive.
PACKAGE-DEPENDS-LIST?= \
- for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
- dir=`${REALPATH} $$dir`; \
+ for depend in `${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/'`; do \
+ version=`(${ECHO_CMD} $$depend | ${CUT} -f 1 -d ':' | ${GREP} -se '[<>]') || ${TRUE}`; \
+ dir=`${ECHO_CMD} $$depend | ${CUT} -f 2 -d ':' | ${XARGS} ${REALPATH}`; \
if [ -d $$dir ]; then \
- meta=`cd $$dir && ${MAKE} -V PKGNAME -V PKGORIGIN | ${PASTE} - -'`; \
- ${ECHO_CMD} "$$dir $$meta" | ${AWK} '{print $$2 " " $$1 " " $$3}'; \
+ meta=`cd $$dir && ${MAKE} -V PKGSUBNAME -V PKGORIGIN | ${PASTE} - -'`; \
+ if [ -z "$$version" ]; then \
+ ${ECHO_CMD} "$$dir $$meta" | ${AWK} '{print $$2 " " $$1 " " $$3}'; \
+ else \
+ version=`${ECHO_CMD} $$version | ${SED} -E 's/^.*([<>])/\1/'`; \
+ ${ECHO_CMD} "$$dir $$meta $$version" | ${AWK} '{print $$2 " " $$1 " " $$3 " " $$4}'; \
+ fi; \
else \
${ECHO_MSG} "\"$$dir\" non-existent -- dependency list incomplete" >&2; \
fi; \
done
+package-depends:
+ @${PACKAGE-DEPENDS-LIST} | ${AWK} '{ if ($$4) print $$1":"$$3":"$$4; else print $$1":"$$3 }'
+
.else
PACKAGE-DEPENDS-LIST?= \
if [ "${CHILD_DEPENDS}" ]; then \
@@ -5118,9 +5128,10 @@
${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
fi; \
done
-.endif
+
package-depends:
@${PACKAGE-DEPENDS-LIST} | ${AWK} '{print $$1":"$$3}'
+.endif
# Build packages for port and dependencies
More information about the Midnightbsd-cvs
mailing list