Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/apt-mirror/apt-mirror.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Georgiev <chutz@gg3.net>2022-05-17 09:07:36 +0300
committerGeorgi Georgiev <310867+chutzimir@users.noreply.github.com>2022-07-09 06:10:12 +0300
commit76bd728ec6e799073183622ea13c3ca9b4f65e82 (patch)
treee75450e5e901ce3f95ed2b7c87c55502253b6c1d
parent7366c2ecdaf693bc4782bd419889948c1e04cebb (diff)
Only download compressed index files
I cannot find a single repository serving the uncompressed index files. Furthermore, per the documentation at https://wiki.debian.org/DebianRepository/Format#Compression_of_indices Servers should offer only xz compressed files, except for the special cases listed above. Therefore we should only download the compressed files, and only serve the compressed files, and all clients are expected to understand them. The uncompressed versions are documented in the Release file, but we can safely ignore them and only get the compressed ones instead.
-rwxr-xr-xapt-mirror21
1 files changed, 9 insertions, 12 deletions
diff --git a/apt-mirror b/apt-mirror
index eb7ef2c..8f43803 100755
--- a/apt-mirror
+++ b/apt-mirror
@@ -468,7 +468,7 @@ sub find_metadata_in_release
my ( $release_uri, $release_path, $line ) = '';
my $component_regex = undef;
my $arch_regex = "(?:${arch}|all)";
- my $compressed_extension_regex = '(?:\.(?:gz|bz2|xz))?$';
+ my $compressed_extension_regex = '(?:\.(?:gz|bz2|xz))$';
my $dist_uri;
if (@components)
@@ -523,23 +523,23 @@ sub find_metadata_in_release
} else {
if (
(
- $filename =~ m{^Contents-${arch_regex}${compressed_extension_regex}$}
+ $filename =~ m{^Contents-${arch_regex}${compressed_extension_regex}}
) or (
- $filename =~ m{^Packages${compressed_extension_regex}$}
+ $filename =~ m{^Packages${compressed_extension_regex}}
) or (
- $filename =~ m{^${component_regex}/Contents-${arch_regex}${compressed_extension_regex}$}
+ $filename =~ m{^${component_regex}/Contents-${arch_regex}${compressed_extension_regex}}
) or (
- $filename =~ m{^${component_regex}/binary-${arch_regex}/Packages${compressed_extension_regex}$}
+ $filename =~ m{^${component_regex}/binary-${arch_regex}/Packages${compressed_extension_regex}}
) or (
$filename =~ m{^${component_regex}/binary-${arch_regex}/Release$}
) or (
- $filename =~ m{^${component_regex}/cnf/Commands-${arch_regex}${compressed_extension_regex}$}
+ $filename =~ m{^${component_regex}/cnf/Commands-${arch_regex}${compressed_extension_regex}}
) or (
- $filename =~ m{^${component_regex}/dep11/Components-${arch_regex}}
+ $filename =~ m{^${component_regex}/dep11/Components-${arch_regex}.*${compressed_extension_regex}}
) or (
- $filename =~ m{^${component_regex}/dep11/icons-}
+ $filename =~ m{^${component_regex}/dep11/icons-.*${compressed_extension_regex}}
) or (
- $filename =~ m{^${component_regex}/i18n/Translation-}
+ $filename =~ m{^${component_regex}/i18n/Translation-.*${compressed_extension_regex}}
)
)
{
@@ -906,9 +906,6 @@ foreach (@index_urls)
{
die("apt-mirror: invalid url in index_urls") unless s[^(\w+)://][];
copy_file( get_variable("skel_path") . "/" . sanitise_uri("$_"), get_variable("mirror_path") . "/" . sanitise_uri("$_") );
- copy_file( get_variable("skel_path") . "/" . sanitise_uri("$_"), get_variable("mirror_path") . "/" . sanitise_uri("$_") ) if (s/\.gz$//);
- copy_file( get_variable("skel_path") . "/" . sanitise_uri("$_"), get_variable("mirror_path") . "/" . sanitise_uri("$_") ) if (s/\.bz2$//);
- copy_file( get_variable("skel_path") . "/" . sanitise_uri("$_"), get_variable("mirror_path") . "/" . sanitise_uri("$_") ) if (s/\.xz$//);
}
######################################################################################