diff -Nru apt-mirror-0.5.0/apt-mirror apt-mirror-0.5.1/apt-mirror --- apt-mirror-0.5.0/apt-mirror 2014-02-22 14:16:08.000000000 +0000 +++ apt-mirror-0.5.1/apt-mirror 2014-04-12 19:24:41.000000000 +0000 @@ -90,6 +90,7 @@ use warnings; use strict; use File::Copy; +use File::Compare; use File::Path; use File::Basename; use Fcntl qw(:flock); @@ -112,7 +113,11 @@ "auth_no_challenge" => 0, "no_check_certificate" => 0, "unlink" => 0, - "postmirror_script" => '$var_path/postmirror.sh' + "postmirror_script" => '$var_path/postmirror.sh', + "use_proxy" => 'off', + "http_proxy" => '', + "proxy_user" => '', + "proxy_password" => '' ); my @config_binaries = (); @@ -227,7 +232,12 @@ if ( get_variable("auth_no_challenge") == 1 ) { push( @args, "--auth-no-challenge" ); } if ( get_variable("no_check_certificate") == 1 ) { push( @args, "--no-check-certificate" ); } if ( get_variable("unlink") == 1 ) { push( @args, "--unlink" ); } - + if ( length( get_variable("use_proxy") ) && ( get_variable("use_proxy") eq 'yes' || get_variable("use_proxy") eq 'on' ) ) + { + if ( length( get_variable("http_proxy") ) ) { push( @args, "-e use_proxy=yes" ); push( @args, "-e http_proxy=" . get_variable("http_proxy") ); } + if ( length( get_variable("proxy_user") ) ) { push( @args, "-e proxy_user=" . get_variable("proxy_user") ); } + if ( length( get_variable("proxy_password") ) ) { push( @args, "-e proxy_password=" . get_variable("proxy_password") ); } + } print "Downloading " . scalar(@urls) . " $stage files using $nthreads threads...\n"; while ( scalar @urls ) @@ -375,6 +385,7 @@ 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 @@ -383,6 +394,7 @@ 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" ); } } @@ -401,6 +413,7 @@ { 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) { @@ -408,10 +421,12 @@ { 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" ); } } @@ -421,6 +436,7 @@ 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" ); } } @@ -435,6 +451,7 @@ $skipclean{$_} = 1; $skipclean{$_} = 1 if s[\.gz$][]; $skipclean{$_} = 1 if s[\.bz2$][]; + $skipclean{$_} = 1 if s[\.xz$][]; } ###################################################################################### @@ -462,7 +479,7 @@ my ( $release_uri, $release_path, $line ) = ''; $release_uri = $dist_uri . "Release"; - $release_path = get_variable("mirror_path") . "/" . sanitise_uri($release_uri); + $release_path = get_variable("skel_path") . "/" . sanitise_uri($release_uri); unless ( open STREAM, "<$release_path" ) { @@ -518,7 +535,7 @@ $base_uri = $dist_uri . $component . "/i18n/"; $index_uri = $base_uri . "Index"; - $index_path = get_variable("mirror_path") . "/" . sanitise_uri($index_uri); + $index_path = get_variable("skel_path") . "/" . sanitise_uri($index_uri); unless ( open STREAM, "<$index_path" ) { @@ -777,6 +794,10 @@ my $dir = dirname($to); return unless -f $from; mkpath($dir) unless -d $dir; + if ( get_variable("unlink") == 1 ) + { + if ( compare( $from, $to ) != 0 ) { unlink($to); } + } unless ( copy( $from, $to ) ) { warn("apt-mirror: can't copy $from to $to"); @@ -792,6 +813,7 @@ 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$//); } ###################################################################################### diff -Nru apt-mirror-0.5.0/CHANGELOG apt-mirror-0.5.1/CHANGELOG --- apt-mirror-0.5.0/CHANGELOG 2014-02-22 14:07:49.000000000 +0000 +++ apt-mirror-0.5.1/CHANGELOG 2014-04-12 19:26:48.000000000 +0000 @@ -1,3 +1,9 @@ +0.5.1 (2014-04-12) + * Fix find-translation-files bug. + * Fix skel (indexes) updates in a hardlinked mirror + * Added proxy support + * Also mirror xz compressed files (fixes #25). + 0.5.0 (2014-02-22) * Removed restrictions when parsing deb-$arch (Launchpad bug #913837) new arch's no longer need to be manually added diff -Nru apt-mirror-0.5.0/debian/changelog apt-mirror-0.5.1/debian/changelog --- apt-mirror-0.5.0/debian/changelog 2014-02-22 14:59:46.000000000 +0000 +++ apt-mirror-0.5.1/debian/changelog 2014-04-12 19:36:10.000000000 +0000 @@ -1,3 +1,9 @@ +apt-mirror (0.5.1-1) unstable; urgency=medium + + * New upstream release. + + -- Benjamin Drung Sat, 12 Apr 2014 21:35:44 +0200 + apt-mirror (0.5.0-1) unstable; urgency=medium * New upstream release. diff -Nru apt-mirror-0.5.0/Makefile apt-mirror-0.5.1/Makefile --- apt-mirror-0.5.0/Makefile 2014-02-22 14:19:50.000000000 +0000 +++ apt-mirror-0.5.1/Makefile 2014-04-12 19:30:58.000000000 +0000 @@ -1,4 +1,4 @@ -VERSION := 0.5.0 +VERSION := 0.5.1 DIST := apt-mirror CHANGELOG LICENSE Makefile mirror.list postmirror.sh README.md .perltidyrc BASE_PATH := /var/spool/apt-mirror PREFIX ?= /usr/local diff -Nru apt-mirror-0.5.0/mirror.list apt-mirror-0.5.1/mirror.list --- apt-mirror-0.5.0/mirror.list 2013-08-26 10:47:11.000000000 +0000 +++ apt-mirror-0.5.1/mirror.list 2014-04-12 13:16:25.000000000 +0000 @@ -9,6 +9,10 @@ set _tilde 0 # Use --unlink with wget (for use with hardlinked directories) set unlink 1 +set use_proxy off +set http_proxy 127.0.0.1:3128 +set proxy_user user +set proxy_password password deb http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse