diff options
author | Georgi Georgiev <chutz@gg3.net> | 2022-05-17 09:07:36 +0300 |
---|---|---|
committer | Georgi Georgiev <310867+chutzimir@users.noreply.github.com> | 2022-07-09 06:10:12 +0300 |
commit | 76bd728ec6e799073183622ea13c3ca9b4f65e82 (patch) | |
tree | e75450e5e901ce3f95ed2b7c87c55502253b6c1d | |
parent | 7366c2ecdaf693bc4782bd419889948c1e04cebb (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-x | apt-mirror | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -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$//); } ###################################################################################### |