summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorhubertf <hubertf>2000-11-18 21:53:31 +0000
committerhubertf <hubertf>2000-11-18 21:53:31 +0000
commite28ac3dfb4ea450b9e4066dd97ac4fc287faf0a7 (patch)
treef279d3e3fb246ae6bde3ce1c9d812920b64458a7 /mk
parenta8fc5ceb11134df2635b128be5501d78e3308591 (diff)
downloadpkgsrc-e28ac3dfb4ea450b9e4066dd97ac4fc287faf0a7.tar.gz
Fix print-pkg-size-depends:
I now remember why I felt there was something wrong with the fix in PR 11433: it calls some target with PACKAGE_DEPENDS_WITH_PATTERNS=false, and this will cause problems when someone has a different version installed than what's currently in pkgsrc. This was also what the XXX was for that I couldn't remember - all dependencies were found installed at the time that the print-pkg-size-depends target gets called, and as such we can call run-depends list with the PACKAGE_DEPENDS_QUICK switch (to first print our direct dependencies, and then look at their @pkgdep lines to get all their depends - no need for recursion, as well store all a pkg's depends in it's @pkgdep lines!). Using that, we can call "pkg_info -e" on all the patterns to expand them to match what's really installed on the system, then make that list unique (so that e.g. foo-1.0 and foo-* gets to the same pkg twice, and then sorted out). After that we can calculate it's size as before using "pkg-info -s". Using this method is also a whole lot faster (due to no recursion).
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk7
1 files changed, 4 insertions, 3 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index e686e440685..61038005d61 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.608 2000/11/18 01:03:33 tv Exp $
+# $NetBSD: bsd.pkg.mk,v 1.609 2000/11/18 21:53:31 hubertf Exp $
#
# This file is in the public domain.
#
@@ -2949,9 +2949,10 @@ print-pkg-size-this:
# Sizes of required pkgs (only)
#
# XXX This is intended to be run before pkg_create is called, so the
-# dependencies are all installed
+# dependencies are all installed.
print-pkg-size-depends:
- @${MAKE} ${MAKEFLAGS} PACKAGE_DEPENDS_WITH_PATTERNS=false run-depends-list \
+ @${MAKE} ${MAKEFLAGS} run-depends-list PACKAGE_DEPENDS_QUICK=true \
+ | xargs -n 1 ${SETENV} ${PKG_INFO} -e \
| sort -u \
| xargs ${SETENV} ${PKG_INFO} -qs \
| ${AWK} -- 'BEGIN { print("0 "); } \