diff options
author | Stifler <Stifler6996@users.noreply.github.com> | 2021-08-19 06:04:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-19 06:04:24 +0300 |
commit | 7ae190bee2a2ae558e7a83e8735fec34b7bc800d (patch) | |
tree | b7d80af9aedd10259e77e18e8b614e6cba5166b4 | |
parent | 84575a8aa26b29d7e4b6da08da0fbc53c37ec7f9 (diff) |
added support for plus symbol in uri
-rwxr-xr-x | apt-mirror | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -108,6 +108,7 @@ my %config_variables = ( "_contents" => 1, "_autoclean" => 0, "_tilde" => 0, + "_plus" => 0, "limit_rate" => '100m', "run_postmirror" => 1, "auth_no_challenge" => 0, @@ -339,6 +340,7 @@ while (<CONFIG>) $link =~ s[^(\w+)://][]; $link =~ s[/$][]; $link =~ s[~][%7E]g if get_variable("_tilde"); + $link =~ s[\+][%2B]g if get_variable("_plus"); if ( $config_line{'type'} eq "skip-clean" ) { $skipclean{ $link } = 1; } elsif ( $config_line{'type'} eq "clean" ) { @@ -381,6 +383,7 @@ sub remove_double_slashes while (s[(?<!:)//][/]g) { } while (s[(?<!:/)/[^/]+/\.\./][/]g) { } s/~/\%7E/g if get_variable("_tilde"); + s/\+/\%2B/g if get_variable("_plus"); return $_; } @@ -478,6 +481,7 @@ foreach ( keys %urls_to_download ) { s[^(\w+)://][]; s[~][%7E]g if get_variable("_tilde"); + s[\+][%2B]g if get_variable("_plus"); $skipclean{$_} = 1; $skipclean{$_} = 1 if s[\.gz$][]; $skipclean{$_} = 1 if s[\.bz2$][]; @@ -497,6 +501,7 @@ sub sanitise_uri $uri =~ s/^([^@]+)?@?// if (split '/',$uri)[0] =~ /@/; $uri =~ s&:\d+/&/&; # and port information $uri =~ s/~/\%7E/g if get_variable("_tilde"); + $uri =~ s/\+/\%2B/g if get_variable("_plus"); return $uri; } @@ -637,6 +642,7 @@ foreach ( keys %urls_to_download ) { s[^(\w+)://][]; s[~][%7E]g if get_variable("_tilde"); + s[\+][%2B]g if get_variable("_plus"); $skipclean{$_} = 1; } @@ -728,6 +734,7 @@ foreach ( keys %urls_to_download ) { s[^(\w+)://][]; s[~][%7E]g if get_variable("_tilde"); + s[\+][%2B]g if get_variable("_plus"); $skipclean{$_} = 1; } @@ -971,6 +978,7 @@ sub process_file { my $file = shift; $file =~ s[~][%7E]g if get_variable("_tilde"); + $file =~ s[\+][%2B]g if get_variable("_plus"); return 1 if $skipclean{$file}; push @rm_files, sanitise_uri($file); my ( undef, undef, undef, undef, undef, undef, undef, $size, undef, undef, undef, undef, $blocks ) = stat($file); |