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

github.com/Stifler6996/apt-mirror.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStifler <Stifler6996@users.noreply.github.com>2021-08-19 06:04:24 +0300
committerGitHub <noreply@github.com>2021-08-19 06:04:24 +0300
commit7ae190bee2a2ae558e7a83e8735fec34b7bc800d (patch)
treeb7d80af9aedd10259e77e18e8b614e6cba5166b4
parent84575a8aa26b29d7e4b6da08da0fbc53c37ec7f9 (diff)
added support for plus symbol in uri
-rwxr-xr-xapt-mirror8
1 files changed, 8 insertions, 0 deletions
diff --git a/apt-mirror b/apt-mirror
index ecd11f0..bd5310f 100755
--- a/apt-mirror
+++ b/apt-mirror
@@ -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);