diff options
author | hubertf <hubertf@pkgsrc.org> | 2000-11-18 21:53:31 +0000 |
---|---|---|
committer | hubertf <hubertf@pkgsrc.org> | 2000-11-18 21:53:31 +0000 |
commit | 7c6c6d304f843ae66cb01bf703b012ae95fb9a37 (patch) | |
tree | f279d3e3fb246ae6bde3ce1c9d812920b64458a7 /mk | |
parent | aecdabed34012ad5b759e6f87dadd69baf6b0371 (diff) | |
download | pkgsrc-7c6c6d304f843ae66cb01bf703b012ae95fb9a37.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.mk | 7 |
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 "); } \ |