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

Bug#690210: strange sources.list when using debootstrap with option --extra-suite



Hi again,

It seems that components are duplicated when using option --extra-suite in debootstrap.

I got the following /etc/apt/sources.list (note the 'main' component repeated twice or four times)

   --------------8<----------/etc/apt/sources.list---------------8<----------
deb http://deb.debian.org/debian stable main main
deb http://deb.debian.org/debian buster-proposed-updates main main main main
   --------------8<----------/etc/apt/sources.list---------------8<----------

as a result of the invocation of debootstrap (version 1.0.123) :

# debootstrap --variant=minbase --extra-suites=buster-proposed-updates stable \
  my_stable_chroot_with_updates

The partial fix for bug #690210 seems to be the culprit. I recover the expected 
sources.list with the patch below.

Thank you for your ongoing work on debootstrap !

Regards,
JH Chatenet 

diff -Naur a/usr/share/debootstrap/functions b/usr/share/debootstrap/functions
--- a/usr/share/debootstrap/functions	2020-03-14 02:07:20.000000000 +0100
+++ b/usr/share/debootstrap/functions	2020-07-15 18:49:15.214419623 +0200
@@ -547,6 +547,9 @@
 		mv "$reldest" "$reldest.malformed"
 		error 1 INVALIDREL "Invalid Release file, no valid components"
 	fi
+
+	# Suppress duplicated components (this may occur if EXTRA_SUITES are selected)
+	COMPONENTS=$(echo "$COMPONENTS" | tr ' ' '\n' | sort | uniq | tr '\n' ' ')
 }
 
 CODENAME=""
@@ -1110,6 +1113,7 @@
 	for m in "$@"; do
 		for s in $SUITE $EXTRA_SUITES; do
 			local cs c path pkgdest
+			cs=""
 			for c in ${COMPONENTS:-$USE_COMPONENTS}; do
 				path="dists/$s/$c/binary-$ARCH/Packages"
 				pkgdest="$TARGET/$($DLDEST pkg "$s" "$c" "$ARCH" "$m" "$path")"


Reply to: