Bug#806780: --foreign/--second-stage breaks with multiple components
Package: debootstrap
Version: 1.0.75
Severity: normal
Tags: patch
When passing multiple components to --second-stage things fail as debootstrap
tries to open debootstrap.invalid_dists_badger_snake|mushroom-armhf.Packages
rather then seperate Packages file for snake and mushroom.
Fixed in attached patch
-- System Information:
Debian Release: stretch/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable'), (101, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armhf, armel
Kernel: Linux 4.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages debootstrap depends on:
ii wget 1.17-1
Versions of packages debootstrap recommends:
ii debian-archive-keyring 2014.3
ii gnupg 1.4.19-6
debootstrap suggests no packages.
-- no debconf information
>From 6621d8304cb79dcc6e07098caaf6eaa56fe8594a Mon Sep 17 00:00:00 2001
From: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Date: Tue, 1 Dec 2015 09:09:07 +0100
Subject: [PATCH] Fix multiple components usage for --foreign
commit e24e4b006736734e, bug #757819 made resolve_deps and
setup_available in the --foreign case. However this only worked when
using just one component as the USE_COMPONENTS variable is | delimited.
Translate the USE_COMPONENTS variable on the fly from | delimited to
space delimeted to allow multiple components to work again.
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
---
functions | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/functions b/functions
index 8bef5e6..64d76e4 100644
--- a/functions
+++ b/functions
@@ -1256,14 +1256,14 @@ resolve_deps () {
local ALLPKGS2="";
while [ "$PKGS" != "" ]; do
local NEWPKGS=""
- for c in ${COMPONENTS:-$USE_COMPONENTS}; do
+ for c in ${COMPONENTS:-$(echo ${USE_COMPONENTS} | tr '|' ' ')}; 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:-$USE_COMPONENTS}; do
+ for c in ${COMPONENTS:-$(echo ${USE_COMPONENTS} | tr '|' ' ')}; 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')"
@@ -1279,7 +1279,7 @@ resolve_deps () {
setup_available () {
local m1="${MIRRORS%% *}"
- for c in ${COMPONENTS:-$USE_COMPONENTS}; do
+ for c in ${COMPONENTS:-$(echo ${USE_COMPONENTS} | tr '|' ' ')}; 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?
--
2.6.2
Reply to: