[neon/backports-jammy/debuerreotype/Neon/unstable] /: 0.15-1 (patches unapplied)

git-ubuntu importer null at kde.org
Fri Aug 11 03:02:00 BST 2023


Git commit 2e7434c1079df5c49aed05ebdb595d7c04ed9d67 by git-ubuntu importer, on behalf of Tianon Gravi.
Committed on 24/08/2022 at 06:28.
Pushed by carlosdem into branch 'Neon/unstable'.

0.15-1 (patches unapplied)

Imported using git-ubuntu import.

M  +16   -10   .github/workflows/ci.yml
M  +3    -3    Dockerfile
M  +1    -1    VERSION
M  +9    -0    debian/changelog
M  +8    -0    debian/tests/stretch
M  +33   -10   examples/debian.sh
M  +1    -1    scripts/.debian-mirror.sh
M  +115  -56   scripts/debuerreotype-debian-sources-list

https://invent.kde.org/neon/backports-jammy/debuerreotype/-/commit/2e7434c1079df5c49aed05ebdb595d7c04ed9d67

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index eebe2a7..b2a0d2f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -5,6 +5,7 @@ on:
   push:
   schedule:
     - cron: 0 0 * * 0
+  workflow_dispatch:
 
 defaults:
   run:
@@ -26,25 +27,30 @@ jobs:
     strategy:
       matrix:
         include:
-          - { SUITE: stable,    CODENAME: jessie,  TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: a712fb9b228f107a0d65e836127a377857ab70388f2e23d3b583ac56f8f5a75b }
-          - { SUITE: jessie,    CODENAME: "",      TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: a712fb9b228f107a0d65e836127a377857ab70388f2e23d3b583ac56f8f5a75b }
-          - { SUITE: testing,   CODENAME: stretch, TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: 56adf91c1aca0b52ba7c818f4cdc93e47a6c2c93266296d7e0e108ddead825b4 }
-          - { SUITE: stretch,   CODENAME: "",      TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: 56adf91c1aca0b52ba7c818f4cdc93e47a6c2c93266296d7e0e108ddead825b4 }
+          - { SUITE: stable,    CODENAME: jessie,  TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: 2dfa65652d6666e1f496886a2a9b3852bd43c1df55babe7009e8dbfe4a66ba69 }
+          - { SUITE: jessie,    CODENAME: "",      TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: 2dfa65652d6666e1f496886a2a9b3852bd43c1df55babe7009e8dbfe4a66ba69 }
+          - { SUITE: testing,   CODENAME: stretch, TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: f6a94df0a2eccdec7cabf576e009b639f6d011c7db62744cbc9f11b4067b5568 }
+          - { SUITE: stretch,   CODENAME: "",      TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: f6a94df0a2eccdec7cabf576e009b639f6d011c7db62744cbc9f11b4067b5568 }
           - { SUITE: unstable,  CODENAME: sid,     TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: 87f46eeb98d44ff5742d87112d9cc45e51dbb1204d60cb4136b51f0edfce061f }
           - { SUITE: sid,       CODENAME: "",      TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: 87f46eeb98d44ff5742d87112d9cc45e51dbb1204d60cb4136b51f0edfce061f }
-          - { SUITE: oldstable, CODENAME: wheezy,  TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: 52f942d1d0f5ed2d41cb81b63091dc5da0872da94b80a684937cdab7fc57ac06 }
-          - { SUITE: wheezy,    CODENAME: "",      TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: 52f942d1d0f5ed2d41cb81b63091dc5da0872da94b80a684937cdab7fc57ac06 }
+          - { SUITE: oldstable, CODENAME: wheezy,  TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: d19b91beb77aa6d32dbf45681a8510916d70ec74d2f499ee5559fc96ada025a1 }
+          - { SUITE: wheezy,    CODENAME: "",      TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: d19b91beb77aa6d32dbf45681a8510916d70ec74d2f499ee5559fc96ada025a1 }
 
           # EOL suites testing
           - { SUITE: eol, CODENAME: etch,  TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: 893d436a060f2536f70efbdfd2e2952cf311eada558f858e6190c80b323b783e }
           - { SUITE: eol, CODENAME: lenny, TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: c263084bc482b1538512eb091095dd30cf55a6873b989aeee9d4e148f2f3fafa }
           - { SUITE: eol, CODENAME: woody, ARCH: i386, TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: f80833896e141fbfebf8c91e79da2ccca1bdeb8f8ecc4e05dd33531c32857e0f }
-          - { SUITE: eol, CODENAME: jessie, TIMESTAMP: "2021-03-01T00:00:00Z", SHA256: a151dd2b4209e152c9323778e3d1016b26e89881df7dd3d81a39282cbd37bdae }
+          - { SUITE: eol, CODENAME: jessie, TIMESTAMP: "2021-03-01T00:00:00Z", SHA256: 45c5553e989a8d42106029ec6f5e042bf48b29e08bf50e414f99f04c33b10fe9 }
+
+          # deb822 testing
+          - { SUITE: unstable, CODENAME: "", TIMESTAMP: "2022-06-30T00:00:00Z", SHA256: 6e781f82630cf92e68ce206a5363983be6b05fff0270de5d1839bcd5e2c415fd }
+          - { SUITE: bookworm, CODENAME: "", TIMESTAMP: "2022-06-30T00:00:00Z", SHA256: 2c8382c35c735217e66f51fd4634bb2f4d89cd0119af2151d320ecb677cb6b20 }
+          - { SUITE: bullseye, CODENAME: "", TIMESTAMP: "2022-06-30T00:00:00Z", SHA256: 2e65c32660eb2035874444de9e11223f34429712a7b6255f13127a3506e2bcb1 }
 
           # qemu-debootstrap testing
-          - { ARCH: arm64,   SUITE: jessie,   CODENAME: "", TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: e0bbe759a5df8a3201c3bfc984a91d7ee46bb7cb939d7c06275ff374043ed731 }
-          - { ARCH: sh4,     SUITE: unstable, CODENAME: "", TIMESTAMP: "2022-02-01T00:00:00Z", SHA256: 82949d1099c18dd13bd2d732238d94ae70d03abc50afc6950baee257cce37fd1 }
-          - { ARCH: riscv64, SUITE: unstable, CODENAME: "", TIMESTAMP: "2022-02-01T00:00:00Z", SHA256: 2a4accea7aef15d4979435ec16f898dcb784330b7b4991fc9ca38b11f87035f5 }
+          - { ARCH: arm64,   SUITE: jessie,   CODENAME: "", TIMESTAMP: "2017-01-01T00:00:00Z", SHA256: 45b3c398b472ff45399cc6cc633005f48d2359d0df8d905022d37a29434420cf }
+          - { ARCH: sh4,     SUITE: unstable, CODENAME: "", TIMESTAMP: "2022-02-01T00:00:00Z", SHA256: 8cf5ac04cd174465aff38484b0cd1b5ad83fe14585322f99a7db404b6dc02275 }
+          - { ARCH: riscv64, SUITE: unstable, CODENAME: "", TIMESTAMP: "2022-02-01T00:00:00Z", SHA256: 3f0d1dc0cb525aa47e6d9947fa7d6e207f7fd72a1d023872a874d6202e020232 }
 
           # a few entries for "today" to try and catch issues like https://github.com/debuerreotype/debuerreotype/issues/41 sooner
           - { SUITE: unstable,  CODENAME: "", TIMESTAMP: "today 00:00:00", SHA256: "" }
diff --git a/Dockerfile b/Dockerfile
index ff30de9..713db4a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -30,10 +30,10 @@ RUN echo 'hsts=0' >> "$WGETRC"
 # https://github.com/debuerreotype/debuerreotype/issues/100
 # https://tracker.debian.org/pkg/distro-info-data
 # http://snapshot.debian.org/package/distro-info-data/
-# http://snapshot.debian.org/package/distro-info-data/0.51/
+# http://snapshot.debian.org/package/distro-info-data/0.53/
 RUN set -eux; \
-	wget -O distro-info-data.deb 'http://snapshot.debian.org/archive/debian/20210724T033023Z/pool/main/d/distro-info-data/distro-info-data_0.51_all.deb'; \
-	echo 'c5f4a3bd999d3d79612dfec285e4afc4f6248648 *distro-info-data.deb' | sha1sum --strict --check -; \
+	wget -O distro-info-data.deb 'http://snapshot.debian.org/archive/debian/20220425T210133Z/pool/main/d/distro-info-data/distro-info-data_0.53_all.deb'; \
+	echo '9c2044aae46ae3d54927deadaabbdfbd4c4177aa *distro-info-data.deb' | sha1sum --strict --check -; \
 	apt-get install -y ./distro-info-data.deb; \
 	rm distro-info-data.deb; \
 	[ -s /usr/share/distro-info/debian.csv ]
diff --git a/VERSION b/VERSION
index 948a547..2856407 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.14
+0.15
diff --git a/debian/changelog b/debian/changelog
index ec5445d..6f1289c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+debuerreotype (0.15-1) unstable; urgency=medium
+
+  * Update to 0.15 upstream release
+    - support for deb822-style sources
+    - replaces security.debian.org with deb.debian.org
+  * skip riscv64 in autopkgtests (ports architecture, harder to test)
+
+ -- Tianon Gravi <tianon at debian.org>  Tue, 23 Aug 2022 14:27:02 -0700
+
 debuerreotype (0.14-1) unstable; urgency=medium
 
   [ Tianon Gravi ]
diff --git a/debian/tests/stretch b/debian/tests/stretch
index 3ec6f97..272ac74 100755
--- a/debian/tests/stretch
+++ b/debian/tests/stretch
@@ -15,11 +15,17 @@ declare -A expectedSha256s=(
 	['i386']='b4e574904703114291f1c42bd80744b1da333d95cf5c00e8e71ba09241ca66ae'
 	['mips64el']='767982e9ca353058d9ca44f410e0367071ebf9938a4a996e3ed9139d57bc987f'
 	['ppc64el']='99bc8a072448360be9ff741b98466835bc0f270041784cacbcb3803f8d3fbb6a'
+	['riscv64']='ports'
 	['s390x']='7ad6fa1abaf9d8cb3fd9d1257e24363bc842f0fe204e98d0a2aa995541b62b1c'
 )
 dpkgArch="$(dpkg --print-architecture)"
 expectedSha256="${expectedSha256s["$dpkgArch"]:-}"
 
+if [ "$expectedSha256" = 'ports' ]; then
+	echo >&2 "aw, '$dpkgArch' is a ports arch -- bailing early!"
+	exit 0
+fi
+
 expectedCompareUrl="https://people.debian.org/~tianon/debuerreotype/$suite--$timestamp--0.14--$dpkgArch--$expectedSha256.txz"
 
 tempDir="$(mktemp -d)"
@@ -43,6 +49,8 @@ debuerreotype-chroot "$rootfs" true
 debuerreotype-debian-sources-list "$rootfs" "$suite"
 # remove effect of https://github.com/debuerreotype/debuerreotype/pull/56 (to avoid regenerating expected tarballs to compensate)
 sed -i -e '/^#/d' "$rootfs/etc/apt/sources.list"
+# remove effect of https://github.com/debuerreotype/debuerreotype/pull/135 (^^^)
+sed -i -e 's!deb.debian.org/debian-security!security.debian.org/debian-security!g' "$rootfs/etc/apt/sources.list"
 
 debuerreotype-tar "$rootfs" "$tempDir/actual.tar"
 sha256="$(sha256sum "$tempDir/actual.tar" | cut -d' ' -f1)"
diff --git a/examples/debian.sh b/examples/debian.sh
index c679609..254b0b9 100755
--- a/examples/debian.sh
+++ b/examples/debian.sh
@@ -188,6 +188,23 @@ fi
 rootfsDir="$tmpDir/rootfs"
 debuerreotype-init "${initArgs[@]}" "$rootfsDir" "$suite" "@$epoch"
 
+aptVersion="$("$debuerreotypeScriptsDir/.apt-version.sh" "$rootfsDir")"
+
+# regenerate sources.list to make the deb822/line-based opinion explicit
+# https://lists.debian.org/debian-devel/2021/11/msg00026.html
+sourcesListArgs=()
+[ -z "$eol" ] || sourcesListArgs+=( --eol )
+[ -z "$ports" ] || sourcesListArgs+=( --ports )
+if dpkg --compare-versions "$aptVersion" '>=' '2.3~' && { [ "$suite" = 'unstable' ] || [ "$suite" = 'sid' ]; }; then # just unstable for now (TODO after some time testing this, we should update this to bookworm+ which is aptVersion 2.3+)
+	sourcesListArgs+=( --deb822 )
+	sourcesListFile='/etc/apt/sources.list.d/debian.sources'
+else
+	sourcesListArgs+=( --no-deb822 )
+	sourcesListFile='/etc/apt/sources.list'
+fi
+debuerreotype-debian-sources-list "${sourcesListArgs[@]}" --snapshot "$rootfsDir" "$suite"
+[ -s "$rootfsDir$sourcesListFile" ] # trust, but verify
+
 if [ -n "$eol" ]; then
 	debuerreotype-gpgv-ignore-expiration-config "$rootfsDir"
 fi
@@ -196,7 +213,6 @@ debuerreotype-minimizing-config "$rootfsDir"
 
 debuerreotype-apt-get "$rootfsDir" update -qq
 
-aptVersion="$("$debuerreotypeScriptsDir/.apt-version.sh" "$rootfsDir")"
 if dpkg --compare-versions "$aptVersion" '>=' '1.1~'; then
 	debuerreotype-apt-get "$rootfsDir" full-upgrade -yqq
 else
@@ -240,9 +256,15 @@ fi
 
 debuerreotype-slimify "$rootfsDir"-slim
 
-sourcesListArgs=()
-[ -z "$eol" ] || sourcesListArgs+=( --eol )
-[ -z "$ports" ] || sourcesListArgs+=( --ports )
+_sanitize_basename() {
+	local f="$1"; shift
+
+	f="$(basename "$f")"
+	f="$(sed -r -e 's/[^a-zA-Z0-9_-]+/-/g' <<<"$f")"
+
+	echo "$f"
+}
+sourcesListBase="$(_sanitize_basename "$sourcesListFile")"
 
 create_artifacts() {
 	local targetBase="$1"; shift
@@ -251,8 +273,8 @@ create_artifacts() {
 	local variant="$1"; shift
 
 	# make a copy of the snapshot-facing sources.list file before we overwrite it
-	cp "$rootfs/etc/apt/sources.list" "$targetBase.sources-list-snapshot"
-	touch_epoch "$targetBase.sources-list-snapshot"
+	cp "$rootfs$sourcesListFile" "$targetBase.$sourcesListBase-snapshot"
+	touch_epoch "$targetBase.$sourcesListBase-snapshot"
 
 	debuerreotype-debian-sources-list "${sourcesListArgs[@]}" "$rootfs" "$suite"
 
@@ -309,11 +331,12 @@ create_artifacts() {
 	debuerreotype-version > "$targetBase.debuerreotype-version"
 	touch_epoch "$targetBase".{manifest,apt-dist,dpkg-arch,debuerreotype-*}
 
-	for f in debian_version os-release apt/sources.list; do
-		targetFile="$targetBase.$(basename "$f" | sed -r "s/[^a-zA-Z0-9_-]+/-/g")"
-		if [ -e "$rootfs/etc/$f" ]; then
+	for f in /etc/debian_version /etc/os-release "$sourcesListFile"; do
+		targetFile="$(_sanitize_basename "$f")"
+		targetFile="$targetBase.$targetFile"
+		if [ -e "$rootfs$f" ]; then
 			# /etc/os-release does not exist in --debian-eol squeeze, for example (hence the existence check)
-			cp "$rootfs/etc/$f" "$targetFile"
+			cp "$rootfs$f" "$targetFile"
 			touch_epoch "$targetFile"
 		fi
 	done
diff --git a/scripts/.debian-mirror.sh b/scripts/.debian-mirror.sh
index 8d60838..b17c56b 100755
--- a/scripts/.debian-mirror.sh
+++ b/scripts/.debian-mirror.sh
@@ -45,7 +45,7 @@ else
 	snapshotStandardMirrors=( "$("$thisDir/.snapshot-url.sh" "@$epoch" 'debian-ports')" )
 fi
 
-securityMirrors=( 'http://security.debian.org/debian-security' )
+securityMirrors=( 'http://deb.debian.org/debian-security' )
 snapshotSecurityMirrors=( "$("$thisDir/.snapshot-url.sh" "@$epoch" 'debian-security')" )
 
 if [ -n "$eol" ]; then
diff --git a/scripts/debuerreotype-debian-sources-list b/scripts/debuerreotype-debian-sources-list
index ab4f679..b6412a7 100755
--- a/scripts/debuerreotype-debian-sources-list
+++ b/scripts/debuerreotype-debian-sources-list
@@ -5,8 +5,9 @@ thisDir="$(dirname "$(readlink -vf "$BASH_SOURCE")")"
 source "$thisDir/.constants.sh" \
 	--flags 'eol,ports,snapshot' \
 	--flags 'deb-src' \
+	--flags 'deb822,no-deb822' \
 	-- \
-	'[--deb-src] [--eol] [--ports] [--snapshot] <target-dir> <suite>' \
+	'[--deb-src] [--deb822/--no-deb822] [--eol] [--ports] [--snapshot] <target-dir> <suite>' \
 	'--snapshot rootfs stretch
 --eol rootfs wheezy'
 
@@ -15,6 +16,7 @@ eol=
 ports=
 snapshot=
 debSrc=
+deb822='auto'
 while true; do
 	flag="$1"; shift
 	dgetopt-case "$flag"
@@ -23,6 +25,8 @@ while true; do
 		--ports) ports=1 ;;
 		--snapshot) snapshot=1 ;;
 		--deb-src) debSrc=1 ;;
+		--deb822) deb822=1 ;;
+		--no-deb822) deb822= ;;
 		--) break ;;
 		*) eusage "unknown flag '$flag'" ;;
 	esac
@@ -34,34 +38,32 @@ suite="${1:-}"; shift || eusage 'missing suite'
 
 epoch="$(< "$targetDir/debuerreotype-epoch")"
 
-if [ -z "$ports" ]; then
-	standardMirrors=( 'http://deb.debian.org/debian' )
-	snapshotStandardMirrors=( "$("$thisDir/.snapshot-url.sh" "@$epoch")" )
-else
-	standardMirrors=( 'http://deb.debian.org/debian-ports' )
-	snapshotStandardMirrors=( "$("$thisDir/.snapshot-url.sh" "@$epoch" 'debian-ports')" )
-fi
-
-securityMirrors=( 'http://security.debian.org/debian-security' )
-snapshotSecurityMirrors=( "$("$thisDir/.snapshot-url.sh" "@$epoch" 'debian-security')" )
-
-if [ -n "$eol" ]; then
-	archiveSnapshotMirror="$("$thisDir/.snapshot-url.sh" "@$epoch" 'debian-archive')"
-
-	standardMirrors=( 'http://archive.debian.org/debian' "${standardMirrors[@]}" )
-	snapshotStandardMirrors=( "$archiveSnapshotMirror/debian" "${snapshotStandardMirrors[@]}" )
+comp='main'
+arch="$("$thisDir/.dpkg-arch.sh" "$targetDir")"
 
-	securityMirrors=( 'http://archive.debian.org/debian-security' "${securityMirrors[@]}" )
-	snapshotSecurityMirrors=( "$archiveSnapshotMirror/debian-security" "${snapshotSecurityMirrors[@]}" )
+if [ "$deb822" = 'auto' ]; then
+	aptVersion="$("$thisDir/.apt-version.sh" "$targetDir")"
+	if dpkg --compare-versions "$aptVersion" '>=' '2.3~'; then # this is a minimally-supported version for the files we generate (could go lower, but this is a safe choice) - this exists to support "debuerreotype-init" needing to generate (after "debootstrap" but before the script finishes), and is then overridden by "examples/debian.sh" later with more specific opinions on which releases should be deb822
+		deb822=1
+	else
+		deb822=
+	fi
 fi
 
-comp='main'
-arch="$("$thisDir/.dpkg-arch.sh" "$targetDir")"
+if [ -n "$deb822" ]; then
+	if [ -n "$ports" ]; then
+		keyring='debian-ports-archive-keyring.gpg'
+	else
+		keyring='debian-archive-keyring.gpg'
+	fi
+	keyring="/usr/share/keyrings/$keyring"
+	if [ ! -s "$targetDir$keyring" ]; then
+		echo >&2 "warning: it appears that '$targetDir' is missing '$keyring' (the expected keyring for APT); skipping 'Signed-By:' in generated sources"
+		keyring=
+	fi
+fi
 
 deb() {
-	local suite="$1"; shift
-	local comp="$1"; shift
-
 	local mirrorArgs=()
 	if [ -n "$ports" ]; then
 		mirrorArgs+=( --ports )
@@ -69,57 +71,114 @@ deb() {
 	if [ -n "$eol" ]; then
 		mirrorArgs+=( --eol )
 	fi
-	mirrorArgs+=( "@$epoch" "$suite" "$arch" "$comp" )
-	local mirrors
-	if ! mirrors="$("$thisDir/.debian-mirror.sh" "${mirrorArgs[@]}")"; then
-		echo >&2 "skipping '$suite/$comp' ..."
-		return
-	fi
-	eval "$mirrors"
-	[ -n "$mirror" ]
-	[ -n "$snapshotMirror" ]
-	[ -n "$foundSuite" ]
-	suite="$foundSuite"
-
-	if [ -n "$snapshot" ]; then
-		mirror="$snapshotMirror"
-	else
-		echo "# deb $snapshotMirror $suite $comp"
-	fi
-	echo "deb $mirror $suite $comp"
-	if [ -n "$debSrc" ]; then
-		echo "deb-src $mirror $suite $comp"
+	mirrorArgs+=( "@$epoch" )
+
+	local suite deb822Mirrors=()
+	local -A deb822Suites=() deb822Snapshots=()
+	for suite; do
+		local mirrors
+		if ! mirrors="$("$thisDir/.debian-mirror.sh" "${mirrorArgs[@]}" "$suite" "$arch" "$comp")"; then
+			echo >&2 "skipping '$suite/$comp' ..."
+			return
+		fi
+		local mirror snapshotMirror foundSuite
+		eval "$mirrors"
+		[ -n "$mirror" ]
+		[ -n "$snapshotMirror" ]
+		[ -n "$foundSuite" ]
+		suite="$foundSuite"
+
+		if [ -n "$snapshot" ]; then
+			mirror="$snapshotMirror"
+		fi
+
+		if [ -n "$deb822" ]; then
+			if [ -z "${deb822Suites["$mirror"]:-}" ]; then
+				# haven't seen this mirror yet!
+				deb822Mirrors+=( "$mirror" )
+				deb822Snapshots["$mirror"]="$snapshotMirror"
+			fi
+			deb822Suites["$mirror"]+="${deb822Suites["$mirror"]:+ }$suite"
+		else
+			if [ -z "$snapshot" ]; then
+				echo "# deb $snapshotMirror $suite $comp"
+			fi
+			echo "deb $mirror $suite $comp"
+			if [ -n "$debSrc" ]; then
+				echo "deb-src $mirror $suite $comp"
+			fi
+		fi
+	done
+
+	if [ -n "$deb822" ]; then
+		local first=1
+		local mirror
+		for mirror in "${deb822Mirrors[@]}"; do
+			if [ -n "$first" ]; then
+				first=
+			else
+				echo
+			fi
+			if [ -n "$debSrc" ]; then
+				echo 'Types: deb deb-src'
+			else
+				echo 'Types: deb'
+			fi
+			if [ -z "$snapshot" ]; then
+				echo "# ${deb822Snapshots["$mirror"]}"
+			fi
+			echo "URIs: $mirror"
+			echo "Suites: ${deb822Suites["$mirror"]}"
+			echo "Components: $comp"
+			if [ -n "$keyring" ]; then
+				echo "Signed-By: $keyring"
+			fi
+		done
 	fi
 }
 
+targetFileLine='/etc/apt/sources.list'
+targetFile822='/etc/apt/sources.list.d/debian.sources'
+if [ -n "$deb822" ]; then
+	targetFile="$targetFile822"
+	rm -f "$targetDir$targetFileLine"
+else
+	targetFile="$targetFileLine"
+	rm -f "$targetDir$targetFile822"
+fi
+unset targetFileLine targetFile822
+
 # https://github.com/tianon/go-aptsources/blob/e066ed9cd8cd9eef7198765bd00ec99679e6d0be/target.go#L16-L58
 {
+	suites=( "$suite" )
 	case "$suite" in
-		sid | unstable | testing)
-			deb "$suite" "$comp" standard
+		sid | unstable)
 			if [ -n "$ports" ]; then
 				# https://www.ports.debian.org/archive
-				deb unreleased "$comp" standard
+				suites+=( 'unreleased' )
 			fi
 			;;
 
 		*)
+			# https://salsa.debian.org/apt-team/apt/-/blob/23fe896858dfc7857f2d59c5fd7627332f11c1ff/vendor/debian/apt-vendor.ent#L9-20
 			# https://salsa.debian.org/installer-team/apt-setup/tree/d7a642fb5fc76e4f0b684db53984bdb9123f8360/generators
-			deb "$suite"          "$comp" standard # "50mirror"
-			deb "$suite-security" "$comp" security # "91security"
-			deb "$suite-updates"  "$comp" standard # "92updates"
+			# https://github.com/debuerreotype/debuerreotype/pull/128#issuecomment-1164046315
 			# https://wiki.debian.org/SourcesList#Example_sources.list
-
+			suites+=(
+				"$suite-security"
+				"$suite-updates"
+			)
 			if [ "$suite" = 'squeeze' ]; then
 				# https://wiki.debian.org/DebianSqueeze#FAQ
-				deb "$suite-lts" "$comp" standard
+				suites+=( "$suite-lts" )
 			fi
 			;;
 	esac
-} > "$targetDir/etc/apt/sources.list"
-chmod 0644 "$targetDir/etc/apt/sources.list"
+	deb "${suites[@]}"
+} > "$targetDir$targetFile"
+chmod 0644 "$targetDir$targetFile"
 
-if [ ! -s "$targetDir/etc/apt/sources.list" ]; then
-	echo >&2 "error: sources.list ended up empty -- something is definitely wrong"
+if [ ! -s "$targetDir$targetFile" ]; then
+	echo >&2 "error: '$targetFile' ended up empty -- something is definitely wrong"
 	exit 1
 fi



More information about the Neon-commits mailing list