[amanda] fix #666968 - amrestore should restore one file when outputting to a pipe

Jan Görig jgorig at fedoraproject.org
Mon Jan 31 10:32:02 UTC 2011


commit 15b1474726d8e39e19bd39edb7e431dd3873c6f1
Author: Jan Görig <jgorig at redhat.com>
Date:   Mon Jan 31 11:30:36 2011 +0100

    fix #666968 - amrestore should restore one file when outputting to a pipe

 amanda-3.1-amrestore.patch |   23 +++++++++++++++++++++++
 amanda.spec                |    7 ++++++-
 2 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/amanda-3.1-amrestore.patch b/amanda-3.1-amrestore.patch
new file mode 100644
index 0000000..5bea107
--- /dev/null
+++ b/amanda-3.1-amrestore.patch
@@ -0,0 +1,23 @@
+diff --git a/server-src/amrestore.pl b/server-src/amrestore.pl
+index dfe521a..d3284ed 100755
+--- a/server-src/amrestore.pl
++++ b/server-src/amrestore.pl
+@@ -372,13 +372,14 @@ sub main {
+ 	my ($err) = @_;
+ 	return failure($err, $finished_cb) if $err;
+ 
+-	$steps->{'next_file'}->();
++	$steps->{'next_file'}->('extracted');
+     };
+ 
+     step next_file => sub {
+-	# amrestore does not loop over multiple files when reading from
+-	# holding or when outputting to a pipe
+-	if ($opt_holding or $opt_pipe) {
++	my ($extracted) = @_;
++	# amrestore does not loop over multiple files when reading from holding
++	# when outputting to a pipe amrestore extracts only the first file
++	if ($opt_holding or ($opt_pipe and $extracted)) {
+ 	    return $steps->{'finished'}->();
+ 	}
+ 
diff --git a/amanda.spec b/amanda.spec
index c8bf173..aa1ce82 100644
--- a/amanda.spec
+++ b/amanda.spec
@@ -8,7 +8,7 @@
 Summary: A network-capable tape backup solution
 Name: amanda
 Version: 3.2.1
-Release: 1%{?dist}
+Release: 2%{?dist}
 Source: http://downloads.sourceforge.net/amanda/amanda-%{version}.tar.gz
 Source1: amanda.crontab
 Source4: disklist
@@ -19,6 +19,7 @@ Patch2: amanda-3.1.1-xattrs.patch
 Patch3: amanda-3.1.1-tcpport.patch
 Patch5: amanda-3.1.1-bsd.patch
 Patch6: amanda-3.2.0-config-dir.patch
+Patch7: amanda-3.1-amrestore.patch
 License: BSD and GPLv3+ and GPLv2+ and GPLv2
 Group: Applications/System
 URL: http://www.amanda.org
@@ -84,6 +85,7 @@ server also needs to have the amanda-client package installed.
 %patch3 -p1 -b .tcpport
 %patch5 -p1 -b .bsd
 %patch6 -p1 -b .config
+%patch7 -p1 -b .amrestore
 ./autogen
 
 %build
@@ -415,6 +417,9 @@ rm -rf ${RPM_BUILD_ROOT}
 
 
 %changelog
+* Mon Jan 31 2011 Jan Görig <jgorig at redhat.com> - 3.2.1-2
+- fix #666968 - amrestore should restore one file when outputting to a pipe
+
 * Wed Dec 15 2010 Jan Görig <jgorig at redhat.com> - 3.2.1-1
 - upgrade to new upstream release
 - removed unneeded patches


More information about the scm-commits mailing list