summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2009-07-29 09:49:51 (GMT)
committerColin Watson <cjwatson@debian.org>2009-07-29 09:49:51 (GMT)
commit9e7d96f50df440f1ce1432e44f774799d4e5c0c0 (patch)
tree9b6fc6775cd8ecde0653ae320b3a44440ea4d535 /functions
parent91ea3a0cf08eddf8a0f134f4878387ef4fcd9c84 (diff)
downloaddebootstrap-9e7d96f50df440f1ce1432e44f774799d4e5c0c0.zip
debootstrap-9e7d96f50df440f1ce1432e44f774799d4e5c0c0.tar.gz
debootstrap-9e7d96f50df440f1ce1432e44f774799d4e5c0c0.tar.bz2
Cope with pre-dependencies of included packages that aren't in Priority:
required (closes: #487908). r59820
Diffstat (limited to 'functions')
-rw-r--r--functions40
1 files changed, 40 insertions, 0 deletions
diff --git a/functions b/functions
index 989fb6e..0312157 100644
--- a/functions
+++ b/functions
@@ -997,6 +997,24 @@ while (<STDIN>) {
local p="$4"
shift; shift; shift; shift
pkgdetails_field 0 "$f" "$m" "$@" < "$p"
+ elif [ "$1" = "STANZAS" ]; then
+ local pkgdest="$2"; shift; shift
+ perl -e '
+my $accum = "";
+while (<STDIN>) {
+ $accum .= $_;
+ $in = 1 if (/^Package: (.*)$/ && grep {$_ eq $1} @ARGV);
+ if ($in and /^$/) {
+ print $accum;
+ if (substr($accum, -1) != "\n") {
+ print "\n\n";
+ } elsif (substr($accum, -2, 1) != "\n") {
+ print "\n";
+ }
+ $in = 0;
+ }
+ $accum = "" if /^$/;
+}' <"$pkgdest" "$@"
fi
}
elif [ -e "/usr/lib/debootstrap/pkgdetails" ]; then
@@ -1032,6 +1050,28 @@ resolve_deps () {
echo $ALLPKGS
}
+setup_available () {
+ local m1="${MIRRORS%% *}"
+
+ for c in $COMPONENTS; do
+ local path="dists/$SUITE/$c/binary-$ARCH/Packages"
+ local pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m1" "$path")"
+ # XXX: What if a package is in more than one component?
+ # -- cjwatson 2009-07-29
+ "$PKGDETAILS" STANZAS "$pkgdest" "$@"
+ done >"$TARGET/var/lib/dpkg/available"
+
+ for pkg; do
+ echo "$pkg install" | sudo dpkg --admindir "$TARGET/var/lib/dpkg" --set-selections
+ done
+}
+
+get_next_predep () {
+ local stanza="$(dpkg --admindir "$TARGET/var/lib/dpkg" --predep-package)" || return 1
+ [ "$stanza" ] || return 1
+ echo "$stanza" | grep '^Package:' | sed 's/^Package://; s/^ *//'
+}
+
################################################################### helpers
# Return zero if it is possible to create devices and execute programs in