diff -Nru apt-mirror-0.4.8/debian/changelog apt-mirror-0.4.8/debian/changelog --- apt-mirror-0.4.8/debian/changelog 2011-10-23 19:52:18.000000000 +0000 +++ apt-mirror-0.4.8/debian/changelog 2012-01-28 13:31:14.000000000 +0000 @@ -1,12 +1,13 @@ -apt-mirror (0.4.8-4ubuntu1) precise; urgency=low +apt-mirror (0.4.8-5) unstable; urgency=low - * Merge from debian testing. Remaining changes: - + apt-mirror will not automatically create directories if base_path is - non-default - - add debian/patches/create_dirs.patch - - update debian/patches/series + * Improve lock file handling to avoid false "apt-mirror is already running" + messages. Thanks to Ivan Borzenkov + (Closes: #589167, LP: #424462) + * Create directories after config is parsed. + Thanks to Rob Verduijn (Closes: #619353, LP: #727011) + * Support armhf, kfreebsd-* and s390x arch. (Closes: #644630) - -- Micah Gersten Sun, 23 Oct 2011 14:44:01 -0500 + -- Benjamin Drung Sat, 28 Jan 2012 14:27:12 +0100 apt-mirror (0.4.8-4) unstable; urgency=low @@ -19,15 +20,6 @@ -- Jeremy T. Bouse Sun, 24 Jul 2011 21:04:19 -0400 -apt-mirror (0.4.8-3ubuntu1) natty; urgency=low - - * fix LP: #727011 - apt-mirror will not automatically create directories if - base_path is non-default; Thanks to Rob Verduijn for the patch - - add debian/patches/create_dirs.patch - - update debian/patches/series - - -- Micah Gersten Tue, 22 Mar 2011 23:19:53 -0500 - apt-mirror (0.4.8-3) unstable; urgency=low * Bump Standards-Version to 3.9.1 (no changes required). @@ -252,4 +244,3 @@ * Initial public release. -- Dmitry N. Hramtsov Sat, 27 Jul 2002 12:44:33 +0700 - diff -Nru apt-mirror-0.4.8/debian/control apt-mirror-0.4.8/debian/control --- apt-mirror-0.4.8/debian/control 2011-07-25 04:13:34.000000000 +0000 +++ apt-mirror-0.4.8/debian/control 2011-07-25 06:29:56.000000000 +0000 @@ -1,8 +1,7 @@ Source: apt-mirror Section: net Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Brandon Holtsclaw +Maintainer: Brandon Holtsclaw Uploaders: Jeremy T. Bouse , Benjamin Drung Dm-Upload-Allowed: yes diff -Nru apt-mirror-0.4.8/debian/patches/additional_archs.patch apt-mirror-0.4.8/debian/patches/additional_archs.patch --- apt-mirror-0.4.8/debian/patches/additional_archs.patch 1970-01-01 00:00:00.000000000 +0000 +++ apt-mirror-0.4.8/debian/patches/additional_archs.patch 2012-01-28 13:24:19.000000000 +0000 @@ -0,0 +1,15 @@ +Description: Support armhf, kfreebsd-* and s390x arch +Author: Benjamin Drung +Bug-Debian: http://bugs.debian.org/644630 + +--- a/apt-mirror ++++ b/apt-mirror +@@ -263,7 +263,7 @@ + next; + } + +- if($config_line =~ /deb-(alpha|amd64|armel|arm|hppa|hurd-i386|i386|ia64|lpia|m68k|mipsel|mips|powerpc|s390|sh|sparc)/) { ++ if($config_line =~ /deb-(alpha|amd64|armel|arm|armhf|hppa|hurd-i386|i386|ia64|kfreebsd-i386|kfreebsd-amd64|lpia|m68k|mipsel|mips|powerpc|s390|s390x|sh|sparc)/) { + push @config_binaries, [$1, @config_line]; + next; + } diff -Nru apt-mirror-0.4.8/debian/patches/create_dirs.patch apt-mirror-0.4.8/debian/patches/create_dirs.patch --- apt-mirror-0.4.8/debian/patches/create_dirs.patch 2011-03-23 04:34:00.000000000 +0000 +++ apt-mirror-0.4.8/debian/patches/create_dirs.patch 2012-01-28 13:17:31.000000000 +0000 @@ -3,22 +3,12 @@ Move the directory creation after the config parsing to facilitate creating in non-default directories. Author: Rob Verduijn +Bug-Debian: http://bugs.debian.org/619353 Bug-Ubuntu: https://bugs.launchpad.net/bugs/727011 -Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=619353 ---- - apt-mirror | 21 +++++++++++---------- - 1 file changed, 11 insertions(+), 10 deletions(-) -Index: apt-mirror-0.4.8/apt-mirror -=================================================================== ---- apt-mirror-0.4.8.orig/apt-mirror -+++ apt-mirror-0.4.8/apt-mirror -@@ -229,26 +229,16 @@ - while(scalar @childrens) { - my $dead = wait(); - @childrens = grep { $_ != $dead } @childrens; - print "[" . scalar(@childrens) . "]... "; - } +--- a/apt-mirror ++++ b/apt-mirror +@@ -234,16 +234,6 @@ print "\nEnd time: " . localtime() . "\n\n"; } @@ -35,17 +25,7 @@ ## Parse config open CONFIG, "<$config_file" or die("apt-mirror: can't open config file ($config_file)"); - while() { - next if /^\s*#/; - next unless /\S/; - my @config_line = split; - my $config_line = shift @config_line; -@@ -290,16 +280,27 @@ - } - - die("apt-mirror: invalid line in config file ($.: $config_line ...)"); - } - close CONFIG; +@@ -295,6 +285,17 @@ die("Please explicitly specify 'defaultarch' in mirror.list") unless get_variable("defaultarch"); @@ -63,8 +43,3 @@ check_lock(); $SIG{INT} = "unlock_aptmirror"; - $SIG{HUP} = "unlock_aptmirror"; - $SIG{TERM} = "unlock_aptmirror"; - - lock_aptmirror(); - diff -Nru apt-mirror-0.4.8/debian/patches/lock.patch apt-mirror-0.4.8/debian/patches/lock.patch --- apt-mirror-0.4.8/debian/patches/lock.patch 1970-01-01 00:00:00.000000000 +0000 +++ apt-mirror-0.4.8/debian/patches/lock.patch 2012-01-28 13:16:42.000000000 +0000 @@ -0,0 +1,50 @@ +Description: Improve lock file handling to avoid false + "apt-mirror is already running" messages. +Author: Ivan Borzenkov +Bug-Debian: http://bugs.debian.org/589167 + +--- a/apt-mirror ++++ b/apt-mirror +@@ -86,6 +86,7 @@ + use File::Copy; + use File::Path; + use File::Basename; ++use Fcntl qw(:flock); + + my $config_file; + +@@ -178,17 +179,16 @@ + } + + sub lock_aptmirror { +- system ("touch " . get_variable("var_path") . "/apt-mirror.lock"); +-} +- +-sub check_lock { +- if(-e get_variable("var_path") . "/apt-mirror.lock") ++ open (LOCK_FILE, '>', get_variable("var_path") . "/apt-mirror.lock"); ++ my $lock = flock(LOCK_FILE, LOCK_EX | LOCK_NB); ++ if (!$lock) + { + die("apt-mirror is already running, exiting"); + } + } + + sub unlock_aptmirror { ++ close(LOCK_FILE); + unlink(get_variable("var_path") . "/apt-mirror.lock"); + } + +@@ -296,12 +296,6 @@ + # + ####################################################################################### + +-check_lock(); +- +-$SIG{INT} = "unlock_aptmirror"; +-$SIG{HUP} = "unlock_aptmirror"; +-$SIG{TERM} = "unlock_aptmirror"; +- + lock_aptmirror(); + + diff -Nru apt-mirror-0.4.8/debian/patches/series apt-mirror-0.4.8/debian/patches/series --- apt-mirror-0.4.8/debian/patches/series 2011-07-25 04:13:34.000000000 +0000 +++ apt-mirror-0.4.8/debian/patches/series 2012-01-28 13:24:19.000000000 +0000 @@ -1,2 +1,4 @@ shebang.patch +additional_archs.patch create_dirs.patch +lock.patch