tags 819974 +path
thanks
Hi
the attached patch does fix it for me. Ignore the changelog info in it,
thats just local stuff for me.
--
bye Joerg
Description: <short summary of the patch>
TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details). To make it easier, the
information below has been extracted from the changelog. Adjust it or drop
it.
.
apt-mirror (0.5.1-1~nsb70+2) wheezy; urgency=medium
.
* Fix to deal with missing .gz files
Author: Joerg Jaspert <jo...@debian.org>
---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:
Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>
--- apt-mirror-0.5.1.orig/apt-mirror
+++ apt-mirror-0.5.1/apt-mirror
@@ -658,7 +658,7 @@ sub remove_spaces($)
}
}
-sub process_index_gz
+sub process_index
{
my $uri = shift;
my $index = shift;
@@ -668,14 +668,18 @@ 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");
+ }
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;
}
@@ -733,12 +737,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" );
}
}
@@ -751,12 +755,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" );
}
}