summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2011-04-13 18:42:02 +0100
committerColin Watson <cjwatson@debian.org>2011-04-13 18:42:02 +0100
commit8ca6fafd9030acfc060bb9f6f83b96cb56b4a9fe (patch)
tree5b82d0813fd820e84bbe898d0821d39da1713954 /functions
parent92cf330c441260fa28f6277dc63823f6416e2115 (diff)
downloaddebootstrap-8ca6fafd9030acfc060bb9f6f83b96cb56b4a9fe.tar.gz
Resolve dependencies from all requested components (LP: #740167).
Diffstat (limited to 'functions')
-rw-r--r--functions23
1 files changed, 14 insertions, 9 deletions
diff --git a/functions b/functions
index b4f74a9..48ba59e 100644
--- a/functions
+++ b/functions
@@ -1124,19 +1124,24 @@ fi
resolve_deps () {
local m1="${MIRRORS%% *}"
- # XXX: I can't think how to deal well with dependency resolution and
- # lots of Packages files. -- aj 2005/06/12
-
- c="${COMPONENTS%% *}"
- local path="dists/$SUITE/$c/binary-$ARCH/Packages"
- local pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m1" "$path")"
-
local PKGS="$*"
local ALLPKGS="$PKGS";
local ALLPKGS2="";
while [ "$PKGS" != "" ]; do
- PKGS=$("$PKGDETAILS" GETDEPS "$pkgdest" $PKGS)
- PKGS=$("$PKGDETAILS" PKGS REAL "$pkgdest" $PKGS | sed -n 's/ .*REAL.*$//p')
+ local NEWPKGS=""
+ for c in $COMPONENTS; do
+ local path="dists/$SUITE/$c/binary-$ARCH/Packages"
+ local pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m1" "$path")"
+ NEWPKGS="$NEWPKGS $("$PKGDETAILS" GETDEPS "$pkgdest" $PKGS)"
+ done
+ PKGS=$(echo "$PKGS $NEWPKGS" | tr ' ' '\n' | sort | uniq)
+ local REALPKGS=""
+ for c in $COMPONENTS; do
+ local path="dists/$SUITE/$c/binary-$ARCH/Packages"
+ local pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m1" "$path")"
+ REALPKGS="$REALPKGS $("$PKGDETAILS" PKGS REAL "$pkgdest" $PKGS | sed -n 's/ .*REAL.*$//p')"
+ done
+ PKGS="$REALPKGS"
ALLPKGS2=$(echo "$PKGS $ALLPKGS" | tr ' ' '\n' | sort | uniq)
PKGS=$(without "$ALLPKGS2" "$ALLPKGS")
ALLPKGS="$ALLPKGS2"