Skip to content

Instantly share code, notes, and snippets.

@jadams
Created January 14, 2020 15:36
Show Gist options
  • Save jadams/83c35ee6f4301108b5ebcdc008c8105a to your computer and use it in GitHub Desktop.
Save jadams/83c35ee6f4301108b5ebcdc008c8105a to your computer and use it in GitHub Desktop.
--- /root/apt-mirror 2019-11-25 14:37:04.773325607 -0500
+++ /usr/bin/apt-mirror 2019-11-25 14:17:29.947079216 -0500
@@ -520,7 +520,8 @@
if ( @parts == 3 )
{
my ( $sha1, $size, $filename ) = @parts;
- if ( $filename =~ m{^$component/i18n/Translation-[^./]*\.bz2$} )
+ #if ( $filename =~ m{^$component/i18n/Translation-[^./]*\.bz2$} )
+ if ( $filename =~ m{^$component/i18n/Translation-[^./]*\.(gz|bz2|xz)$} )
{
add_url_to_download( $dist_uri . $filename, $size );
}
@@ -755,7 +756,9 @@
my ( undef, undef, undef, undef, undef, undef, undef, $size ) = _stat($filename);
- return 1 unless ($size);
+ #return 1 unless ($size);
+ return 1 unless (defined $size);
+ return 1 if ($size <= 0);
return 0 if $size_on_server == $size;
return 1;
}
@@ -824,7 +827,8 @@
add_url_to_download( $uri . "/" . $lines{"Filename:"}, $lines{"Size:"} );
}
}
- else
+ #else
+ elsif ( exists $lines{"Files:"} )
{ # Sources index
foreach ( split( /\n/, $lines{"Files:"} ) )
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment