Skip to content

Commit

Permalink
Also mirror xz compressed files (fixes #25).
Browse files Browse the repository at this point in the history
  • Loading branch information
bdrung committed Apr 12, 2014
1 parent 931dba3 commit e1f16f1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apt-mirror
Expand Up @@ -383,6 +383,7 @@ foreach (@config_sources)
add_url_to_download( $url . $_ . "/source/Release" );
add_url_to_download( $url . $_ . "/source/Sources.gz" );
add_url_to_download( $url . $_ . "/source/Sources.bz2" );
add_url_to_download( $url . $_ . "/source/Sources.xz" );
}
}
else
Expand All @@ -391,6 +392,7 @@ foreach (@config_sources)
add_url_to_download( $uri . "/$distribution/Release.gpg" );
add_url_to_download( $uri . "/$distribution/Sources.gz" );
add_url_to_download( $uri . "/$distribution/Sources.bz2" );
add_url_to_download( $uri . "/$distribution/Sources.xz" );
}
}

Expand All @@ -409,17 +411,20 @@ foreach (@config_binaries)
{
add_url_to_download( $url . "Contents-" . $arch . ".gz" );
add_url_to_download( $url . "Contents-" . $arch . ".bz2" );
add_url_to_download( $url . "Contents-" . $arch . ".xz" );
}
foreach (@components)
{
if ( get_variable("_contents") )
{
add_url_to_download( $url . $_ . "/Contents-" . $arch . ".gz" );
add_url_to_download( $url . $_ . "/Contents-" . $arch . ".bz2" );
add_url_to_download( $url . $_ . "/Contents-" . $arch . ".xz" );
}
add_url_to_download( $url . $_ . "/binary-" . $arch . "/Release" );
add_url_to_download( $url . $_ . "/binary-" . $arch . "/Packages.gz" );
add_url_to_download( $url . $_ . "/binary-" . $arch . "/Packages.bz2" );
add_url_to_download( $url . $_ . "/binary-" . $arch . "/Packages.xz" );
add_url_to_download( $url . $_ . "/i18n/Index" );
}
}
Expand All @@ -429,6 +434,7 @@ foreach (@config_binaries)
add_url_to_download( $uri . "/$distribution/Release.gpg" );
add_url_to_download( $uri . "/$distribution/Packages.gz" );
add_url_to_download( $uri . "/$distribution/Packages.bz2" );
add_url_to_download( $uri . "/$distribution/Packages.xz" );
}
}

Expand All @@ -443,6 +449,7 @@ foreach ( keys %urls_to_download )
$skipclean{$_} = 1;
$skipclean{$_} = 1 if s[\.gz$][];
$skipclean{$_} = 1 if s[\.bz2$][];
$skipclean{$_} = 1 if s[\.xz$][];
}

######################################################################################
Expand Down Expand Up @@ -804,6 +811,7 @@ foreach (@index_urls)
copy_file( get_variable("skel_path") . "/" . sanitise_uri("$_"), get_variable("mirror_path") . "/" . sanitise_uri("$_") );
copy_file( get_variable("skel_path") . "/" . sanitise_uri("$_"), get_variable("mirror_path") . "/" . sanitise_uri("$_") ) if (s/\.gz$//);
copy_file( get_variable("skel_path") . "/" . sanitise_uri("$_"), get_variable("mirror_path") . "/" . sanitise_uri("$_") ) if (s/\.bz2$//);
copy_file( get_variable("skel_path") . "/" . sanitise_uri("$_"), get_variable("mirror_path") . "/" . sanitise_uri("$_") ) if (s/\.xz$//);
}

######################################################################################
Expand Down

0 comments on commit e1f16f1

Please sign in to comment.