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:
authorJoerg Jaspert <joerg@debian.org>2016-11-08 20:08:01 +0300
committerBenjamin Drung <benjamin.drung@profitbricks.com>2016-11-08 20:24:01 +0300
commitca24918f57c53f128741398a5255d6aa6c95ca34 (patch)
tree4475b479e9cc6dd6b174355743269111b8ad25d7
parent408721e8f04f3e250744bcfde5b5caf0e864f1e8 (diff)
Support non-existing .gz index files
apt-mirror hardcodes .gz usage and as such is no longer able to actually mirror Debian (experimental). Use .xz or .bz2 index files when there are not .gz index files. fixes #30 Closes: #819974 Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
-rwxr-xr-xapt-mirror22
1 files changed, 15 insertions, 7 deletions
diff --git a/apt-mirror b/apt-mirror
index a5024d9..389416c 100755
--- a/apt-mirror
+++ b/apt-mirror
@@ -752,7 +752,7 @@ sub remove_spaces($)
}
}
-sub process_index_gz
+sub process_index
{
my $uri = shift;
my $index = shift;
@@ -762,14 +762,22 @@ sub process_index_gz
local $/ = "\n\n";
$mirror = get_variable("mirror_path") . "/" . $path;
- if ( $index =~ s/\.gz$// )
+ if (-e "$path/$index.gz" )
{
system("gunzip < $path/$index.gz > $path/$index");
}
+ elsif (-e "$path/$index.xz" )
+ {
+ system("xz -d < $path/$index.xz > $path/$index");
+ }
+ elsif (-e "$path/$index.bz2" )
+ {
+ system("bzip2 -d < $path/$index.bz2 > $path/$index");
+ }
unless ( open STREAM, "<$path/$index" )
{
- warn("apt-mirror: can't open index in process_index_gz");
+ warn("apt-mirror: can't open index $path/$index in process_index");
return;
}
@@ -827,12 +835,12 @@ foreach (@config_sources)
my $component;
foreach $component (@components)
{
- process_index_gz( $uri, "/dists/$distribution/$component/source/Sources.gz" );
+ process_index( $uri, "/dists/$distribution/$component/source/Sources" );
}
}
else
{
- process_index_gz( $uri, "/$distribution/Sources.gz" );
+ process_index( $uri, "/$distribution/Sources" );
}
}
@@ -845,12 +853,12 @@ foreach (@config_binaries)
my $component;
foreach $component (@components)
{
- process_index_gz( $uri, "/dists/$distribution/$component/binary-$arch/Packages.gz" );
+ process_index( $uri, "/dists/$distribution/$component/binary-$arch/Packages" );
}
}
else
{
- process_index_gz( $uri, "/$distribution/Packages.gz" );
+ process_index( $uri, "/$distribution/Packages" );
}
}