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

Bug#903481: debootstrap: Save apt compatible lists



Package: debootstrap
Version: 1.0.106
Severity: normal
Tags: patch

Since commit https://salsa.debian.org/installer-team/debootstrap/commit/48d77abf3a4209f7cff72aec20f618e086169aa7
debootstrap no longer saves repo list files in an apt compatible
format. A side effect of the old debootstrap.invalid setup was that
the mv_invalid_to function renamed the downloaded repo lists to files
that apt uses. Before you'd get the following:

var/lib/apt/lists/deb.debian.org_debian_dists_sid_InRelease

Now you get

var/lib/apt/lists/http:__deb.debian.org_debian_dists_sid_InRelease

That means that you're required to run apt update after debootstrap
finishes since apt will ignore the downloaded lists.

--
Dan Nicholson  |  +1.206.437.0833  |  Endless
From ef2c7d1d7810b50f58554da0351e6daf572be11d Mon Sep 17 00:00:00 2001
From: Dan Nicholson <nicholson@endlessm.com>
Date: Tue, 10 Jul 2018 06:05:42 -0500
Subject: [PATCH] Strip URL scheme from apt lists

Apt saves the repo lists without the URL scheme, so when debootstrap
keeps the URL scheme in the name they're not usable by apt. That means
you need to run apt update in the completed target even though the lists
have already been fetched. Without this change the default InRelease was
saved as http:__deb.debian.org_debian_dists_sid_InRelease.

This is a regression from commit 48d77ab since the old
debootstrap.invalid setup would rename the lists to the proper name in
most cases since it stripped the leading http://.
---
 functions | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/functions b/functions
index 38c710b..7b893d7 100644
--- a/functions
+++ b/functions
@@ -490,12 +490,12 @@ apt_dest () {
 	    pkg)
 		local m="$5"
 		printf "%s" "$APTSTATE/lists/"
-		echo "${m}_$6" | sed 's/\//_/g'
+		echo "${m}_$6" | sed -e 's,^[^:]\+://,,' -e 's/\//_/g'
 		;;
 	    rel)
 		local m="$3"
 		printf "%s" "$APTSTATE/lists/"
-		echo "${m}_$4" | sed 's/\//_/g'
+		echo "${m}_$4" | sed -e 's,^[^:]\+://,,' -e 's/\//_/g'
 		;;
 	esac
 }
-- 
2.11.0


Reply to: