summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorhubertf <hubertf@pkgsrc.org>2000-03-09 14:05:26 +0000
committerhubertf <hubertf@pkgsrc.org>2000-03-09 14:05:26 +0000
commit50f2df320b67712166376d11f2e29c5328737eaf (patch)
tree6ef75b4450561d2ddb8a95f8edea70f0bdecf799 /mk
parent4c257865d4e2951281111cb6b134009d07ac99e8 (diff)
downloadpkgsrc-50f2df320b67712166376d11f2e29c5328737eaf.tar.gz
Change print-depends to look into /var/db/pkg, instead of pkgsrc
(implements $PACKAGE_DEPENDS_QUICK) -- Thomas Klausner hinted me at some interresting problem WRT the print-depends package. If something depends on suse_linus-6.*, that package will register whatever suse_linux there is right now on the system (in his case V6.1). What print-depends then does is also dig out any pkgs required for suse_linux, based on what's in pkgsrc, which is of course _wrong_, as this most likely doesn't match the installed version.[*] The right thing instead is to print whatever the (currently installed) suse_linux package depends on, which can be read from "pkg_info -qf" output, looking at the @pkgdep lines. Of course this only works if the pkg is actually installed, so it cannot be used for README.html generation etc., but that's bad luck. One positive aspect of using the @pkgdep list instead of going down recursively is that this saves some time and processes. On my P133 it's going down from ~11s to 0.5s for the pkgsrc/x11/kde package. During a "make package" of kde itself (not counting the depending pkgs) this will cut down like 20s (once for the fake-pkg target, and another one for the pkg_create args - maybe a 3rd time for pkg_create in fake-pkg, but I don't want to check that right now). Anyways, a general solution would be to use the "pkg_info -qf | grep @pkgdep" in print-depends instead of recursion (only!) in the places that we know that the depends are installed. Which is the PKG_ARGS assignment (for pkg_create) and the fake-pkg target. [*] Plus it may be questioned that we should not go down recursively for pkg depends anyways, but this is used in too many subtle ways throughout the system to change.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk23
1 files changed, 18 insertions, 5 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index ac805756e1b..b8cfeed9349 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.413 2000/03/09 13:54:50 hubertf Exp $
+# $NetBSD: bsd.pkg.mk,v 1.414 2000/03/09 14:05:26 hubertf Exp $
#
# This file is in the public domain.
#
@@ -595,7 +595,7 @@ SIZE_ALL_FILE= ${WRKDIR}/SizeAll
PKG_ARGS= -v -c ${COMMENT} -d ${DESCR} -f ${PLIST} -l
PKG_ARGS+= -b ${BUILD_VERSION_FILE} -B ${BUILD_INFO_FILE}
PKG_ARGS+= -s ${SIZE_PKG_FILE} -S ${SIZE_ALL_FILE}
-PKG_ARGS+= -p ${PREFIX} -P "`${MAKE} package-depends|sort -u`"
+PKG_ARGS+= -p ${PREFIX} -P "`${MAKE} package-depends PACKAGE_DEPENDS_QUICK=true|sort -u`"
.ifdef CONFLICTS
PKG_ARGS+= -C "${CONFLICTS}"
.endif
@@ -2116,12 +2116,17 @@ package-path:
.endif
# Show (recursively) all the packages this package depends on.
-# if PACKAGE_DEPENDS_WITH_PATTERNS is set, print as pattern (if possible)
+# If PACKAGE_DEPENDS_WITH_PATTERNS is set, print as pattern (if possible)
PACKAGE_DEPENDS_WITH_PATTERNS?=true
+# To be used (-> true) ONLY if the pkg in question is known to be installed
+# (i.e. when calling for pkg_create args, and for fake-pkg)
+# Will probably not work with PACKAGE_DEPENDS_WITH_PATTERNS=false ...
+PACKAGE_DEPENDS_QUICK?=false
.if !target(package-depends)
package-depends:
.for dep in ${DEPENDS}
- @pkg="`${ECHO} \"${dep}\" | ${SED} -e 's/:.*//'`"; \
+ ${_PKG_SILENT}${_PKG_DEBUG}\
+ pkg="`${ECHO} \"${dep}\" | ${SED} -e 's/:.*//'`"; \
dir="`${ECHO} \"${dep}\" | ${SED} -e 's/[^:]*://'`"; \
if [ -d $$dir ]; then \
if ${PACKAGE_DEPENDS_WITH_PATTERNS}; then \
@@ -2129,7 +2134,11 @@ package-depends:
else \
(cd $$dir && ${MAKE} package-name PACKAGE_NAME_TYPE=${PACKAGE_NAME_TYPE}); \
fi; \
+ if ${PACKAGE_DEPENDS_QUICK} ; then \
+ ${PKG_INFO} -qf "$$pkg" | grep ^@pkgdep | awk '{print $$2}' ; \
+ else \
(cd $$dir && ${MAKE} package-depends PACKAGE_NAME_TYPE=${PACKAGE_NAME_TYPE}); \
+ fi ; \
else \
${ECHO_MSG} "Warning: \"$$dir\" non-existent -- @pkgdep registration incomplete" >&2; \
fi
@@ -2143,7 +2152,11 @@ package-depends:
else \
(cd $$dir && ${MAKE} package-name PACKAGE_NAME_TYPE=${PACKAGE_NAME_TYPE}); \
fi; \
+ if ${PACKAGE_DEPENDS_QUICK} ; then \
+ ${PKG_INFO} -qf "$$pkg" | grep ^@pkgdep | awk '{print $$2}' ; \
+ else \
(cd $$dir && ${MAKE} package-depends PACKAGE_NAME_TYPE=${PACKAGE_NAME_TYPE}); \
+ fi ; \
else \
${ECHO_MSG} "Warning: \"$$dir\" non-existent -- @pkgdep registration incomplete" >&2; \
fi
@@ -2655,7 +2668,7 @@ fake-pkg: ${PLIST} ${DESCR}
${CP} ${MESSAGE_FILE} ${PKG_DBDIR}/${PKGNAME}/+DISPLAY; \
fi; \
fi; \
- for dep in `${MAKE} package-depends ECHO_MSG=${TRUE} | sort -u`; do \
+ for dep in `${MAKE} package-depends PACKAGE_DEPENDS_QUICK=true ECHO_MSG=${TRUE} | sort -u`; do \
realdep="`${PKG_INFO} -e \"$$dep\" || ${TRUE}`" ; \
if [ `${ECHO} $$realdep | wc -w` -gt 1 ]; then \
${ECHO} '***' "WARNING: '$$dep' expands to several installed packages " ; \