diff -Nru apt-mirror-0.5.4/debian/changelog apt-mirror-0.5.4/debian/changelog --- apt-mirror-0.5.4/debian/changelog 2017-05-29 12:02:33.000000000 +0000 +++ apt-mirror-0.5.4/debian/changelog 2024-01-30 22:50:26.000000000 +0000 @@ -1,3 +1,12 @@ +apt-mirror (0.5.4-2) jammy; urgency=medium + + * Download cnf files (LP: #1825755) + - Adds support for xz files + - d/p/Support-for-xz-translations.patch + - d/p/Download-cnf-Files.patch + + -- Heather Lemon Tue, 30 Jan 2024 22:50:26 +0000 + apt-mirror (0.5.4-1) unstable; urgency=medium * New upstream bug-fix release. diff -Nru apt-mirror-0.5.4/debian/patches/Download-cnf-Files.patch apt-mirror-0.5.4/debian/patches/Download-cnf-Files.patch --- apt-mirror-0.5.4/debian/patches/Download-cnf-Files.patch 1970-01-01 00:00:00.000000000 +0000 +++ apt-mirror-0.5.4/debian/patches/Download-cnf-Files.patch 2024-01-30 22:50:26.000000000 +0000 @@ -0,0 +1,119 @@ +From: Josh Braden +Date: Mon, 29 Apr 2019 16:25:20 -0500 +Subject: Download 'cnf' Files + +- Mostly (completely) copied/edited from DEP-11 code +- Downloads Commands-${arch} and Commands-${arch}.(gz|bz2|xz) +- Fixes issue with upgrading Ubuntu 18.10 -> 19.04 via do-release-upgrade + +Origin: upstream, https://github.com/apt-mirror/apt-mirror/pull/120 +Signed-off-by: Benjamin Drung +Origin: vendor, https://salsa.debian.org/debian/apt-mirror/-/commit/e131ba943759f6193cc6299650712c85b298e2df +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1825755 +Last-Updated: 2024-01-30 +--- + apt-mirror | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 91 insertions(+) + +diff --git a/apt-mirror b/apt-mirror +index 9fadc26..e3fe70b 100755 +--- a/apt-mirror ++++ b/apt-mirror +@@ -721,6 +721,97 @@ foreach ( keys %urls_to_download ) + $skipclean{$_} = 1; + } + ++###################################################################################### ++## cnf directory download ++ ++%urls_to_download = (); ++ ++sub find_cnf_files_in_release ++{ ++ # Look in the dists/$DIST/Release file for the cnf files that belong ++ # to the given component and architecture. ++ ++ my $dist_uri = shift; ++ my $component = shift; ++ my $arch = shift; ++ my ( $release_uri, $release_path, $line ) = ''; ++ ++ $release_uri = $dist_uri . "Release"; ++ $release_path = get_variable("skel_path") . "/" . sanitise_uri($release_uri); ++ ++ unless ( open STREAM, "<$release_path" ) ++ { ++ warn( "Failed to open Release file from " . $release_uri ); ++ return; ++ } ++ ++ my $checksums = 0; ++ while ( $line = ) ++ { ++ chomp $line; ++ if ($checksums) ++ { ++ if ( $line =~ /^ +(.*)$/ ) ++ { ++ my @parts = split( / +/, $1 ); ++ if ( @parts == 3 ) ++ { ++ my ( $sha1, $size, $filename ) = @parts; ++ if ( $filename =~ m{^$component/cnf/(Commands-${arch}(\.(gz|bz2|xz))?)$} ) ++ { ++ add_url_to_download( $dist_uri . $filename, $size ); ++ } ++ } ++ else ++ { ++ warn("Malformed checksum line \"$1\" in $release_uri"); ++ } ++ } ++ else ++ { ++ $checksums = 0; ++ } ++ } ++ if ( not $checksums ) ++ { ++ if ( $line eq "SHA256:" ) ++ { ++ $checksums = 1; ++ } ++ } ++ } ++} ++ ++print "Processing cnf indexes: ["; ++ ++foreach (@config_binaries) ++{ ++ my ( $arch, $uri, $distribution, @components ) = @{$_}; ++ print "C"; ++ if (@components) ++ { ++ $url = $uri . "/dists/" . $distribution . "/"; ++ ++ my $component; ++ foreach $component (@components) ++ { ++ find_cnf_files_in_release( $url, $component, $arch ); ++ } ++ } ++} ++ ++print "]\n\n"; ++ ++push( @index_urls, sort keys %urls_to_download ); ++download_urls( "cnf", sort keys %urls_to_download ); ++ ++foreach ( keys %urls_to_download ) ++{ ++ s[^(\w+)://][]; ++ s[~][%7E]g if get_variable("_tilde"); ++ $skipclean{$_} = 1; ++} ++ + ###################################################################################### + ## Main download preparations + diff -Nru apt-mirror-0.5.4/debian/patches/Support-for-xz-translations.patch apt-mirror-0.5.4/debian/patches/Support-for-xz-translations.patch --- apt-mirror-0.5.4/debian/patches/Support-for-xz-translations.patch 1970-01-01 00:00:00.000000000 +0000 +++ apt-mirror-0.5.4/debian/patches/Support-for-xz-translations.patch 2024-01-30 22:50:26.000000000 +0000 @@ -0,0 +1,32 @@ +From: Jaejeon Lim +Date: Wed, 22 Jun 2022 13:32:12 +0900 +Subject: Support for xz translations + +- In the case of bullseye-security distributed by the debian security camp, + the extension of Translation-en file of bullseye-security is xz format. + (http://security.debian.org/debian-security/dists/bullseye-security/main/i18n/Translation-en.xz) +- Accordingly, the apt-mirror script was modified to support the xz extension. + +Origin: upstream, https://github.com/apt-mirror/apt-mirror/pull/158 +Closes: #932112, #932379 +Signed-off-by: Benjamin Drung +Origin: vendor, https://salsa.debian.org/debian/apt-mirror/-/commit/2e3cfed2973a04b6485752fdfc789330e03aa033 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1825755 +Last-Updated: 2024-01-30 +--- + apt-mirror | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/apt-mirror b/apt-mirror +index effac7e..9fadc26 100755 +--- a/apt-mirror ++++ b/apt-mirror +@@ -520,7 +520,7 @@ sub find_translation_files_in_release + if ( @parts == 3 ) + { + my ( $sha1, $size, $filename ) = @parts; +- if ( $filename =~ m{^$component/i18n/Translation-[^./]*\.bz2$} ) ++ if ( $filename =~ m{^$component/i18n/Translation-[^./]*\.(bz2|xz)$} ) + { + add_url_to_download( $dist_uri . $filename, $size ); + } diff -Nru apt-mirror-0.5.4/debian/patches/series apt-mirror-0.5.4/debian/patches/series --- apt-mirror-0.5.4/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ apt-mirror-0.5.4/debian/patches/series 2024-01-30 22:49:05.000000000 +0000 @@ -0,0 +1,2 @@ +Support-for-xz-translations.patch +Download-cnf-Files.patch