[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#732255: Bug#773867: missing sources.list



jhcha54008 <jhcha54008@free.fr> (2014-12-30):
> Hi,
> 
> May this be related to bug #732255 ?

(Adding back everyone to the loop.)

Back to your suggestion in <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732255#10>:
| --- a/usr/sbin/debootstrap	2014-02-26 20:31:23.000000000 +0100
| +++ b/usr/sbin/debootstrap	2014-02-26 20:32:31.000000000 +0100
| @@ -656,6 +656,7 @@
|  		setup_apt_sources "${MIRRORS%% *}"
|  		mv_invalid_to "${MIRRORS%% *}"
|  	else
| +		COMPONENTS="${COMPONENTS:-$USE_COMPONENTS}"
|  		setup_apt_sources "$DEF_MIRROR"
|  		mv_invalid_to "$DEF_MIRROR"
|  	fi

setup_apt_sources is defined in the functions script, and iterates over
COMPONENTS to update sources.list accordingly; so this would likely
help. Anyway, COMPONENTS is only ever defined/used in functions, so I'm
wondering whether it's wise to expose/manipulate it in the main
debootstrap script. Additionally, if the sources.list file is the only
thing not working without touching COMPONENTS, I'd rather suggest
something like the attached, untested patch.

If you'd like to see some progress on this bug report, please test (with
regular and foreign architectures) and report back.

Mraw,
KiBi.
From 183eaa304570330f1f76f6f5ffbbb3371582aec7 Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <kibi@debian.org>
Date: Tue, 30 Dec 2014 14:40:50 +0100
Subject: [PATCH] Fix the empty sources.list bug with foreign architectures
 (Closes: #732255, #773867).

Update setup_apt_sources to look at USE_COMPONENTS if COMPONENTS is
empty, so that some iteration over defined components happens.
---
 debian/changelog | 3 +++
 functions        | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 925c8c6..75dd347 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,9 @@ debootstrap (1.0.67) UNRELEASED; urgency=medium
   * Apply patch by Jérémy Bobbio to support reproducible builds: specify
     a modification time on the tar side, and add the -n option to gzip
     (Closes: #774069). Thanks, Jérémy!
+  * Update setup_apt_sources to look at USE_COMPONENTS if COMPONENTS is
+    empty, fixing the empty sources.list bug with foreign architectures
+    (Closes: #732255, #773867).
 
  -- Cyril Brulebois <kibi@debian.org>  Mon, 29 Dec 2014 15:01:57 +0100
 
diff --git a/functions b/functions
index 674d649..bf999f1 100644
--- a/functions
+++ b/functions
@@ -949,9 +949,11 @@ mv_invalid_to () {
 
 setup_apt_sources () {
 	mkdir -p "$TARGET/etc/apt"
+	# Cope with the foreign case where COMPONENTS would be empty:
+	sources_components="${COMPONENTS:-$USE_COMPONENTS}"
 	for m in "$@"; do
 		local cs=""
-		for c in $COMPONENTS; do
+		for c in $sources_components; do
 			local path="dists/$SUITE/$c/binary-$ARCH/Packages"
 			local pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m" "$path")"
 			if [ -e "$pkgdest" ]; then cs="$cs $c"; fi
-- 
2.1.4

Attachment: signature.asc
Description: Digital signature


Reply to: