diff options
author | Georgi Georgiev <chutz@gg3.net> | 2022-05-15 09:07:34 +0300 |
---|---|---|
committer | Georgi Georgiev <310867+chutzimir@users.noreply.github.com> | 2022-07-09 06:10:12 +0300 |
commit | 606aace0119683a450287bf708dc920aa5dbc081 (patch) | |
tree | 59cda4797e00fe73a1b7c55116fa6b6ab9fd9ff3 | |
parent | 76bd728ec6e799073183622ea13c3ca9b4f65e82 (diff) |
Anything downloaded should be kept
Do the skipclean logic in only one place. The logic is pretty simple -
if we downloaded a file, then we *must* keep it, so it is logical to add
it to `add_url_to_download`.
Also dropping the logic to keep the uncompressed index files as per the
previous commit we do not need to host them.
-rwxr-xr-x | apt-mirror | 20 |
1 files changed, 3 insertions, 17 deletions
@@ -388,6 +388,9 @@ sub add_url_to_download { my $url = remove_double_slashes(shift); $urls_to_download{$url} = shift; + $url =~ s[^(\w+)://][]; + $url =~ s[~][%7E]g if get_variable("_tilde"); + $skipclean{$url} = 1; } foreach (@config_sources) @@ -436,16 +439,6 @@ chdir get_variable("skel_path") or die("apt-mirror: can't chdir to skel"); @index_urls = sort keys %urls_to_download; download_urls( "index", @index_urls ); -foreach ( keys %urls_to_download ) -{ - s[^(\w+)://][]; - s[~][%7E]g if get_variable("_tilde"); - $skipclean{$_} = 1; - $skipclean{$_} = 1 if s[\.gz$][]; - $skipclean{$_} = 1 if s[\.bz2$][]; - $skipclean{$_} = 1 if s[\.xz$][]; -} - ###################################################################################### ## Download all relevant metadata @@ -585,13 +578,6 @@ print "]\n\n"; push( @index_urls, sort keys %urls_to_download ); download_urls( "metadata", sort keys %urls_to_download ); -foreach ( keys %urls_to_download ) -{ - s[^(\w+)://][]; - s[~][%7E]g if get_variable("_tilde"); - $skipclean{$_} = 1; -} - ###################################################################################### ## by-hash SHA256 files download |