[amanda/f16] Amanda client was using perl functions provided by server

Lukáš Nykrýn lnykryn at fedoraproject.org
Mon Nov 28 12:12:31 UTC 2011


commit 0fa0b18eab8490274de7a042d8533bd9882f1ef0
Author: Lukas Nykryn <lnykryn at redhat.com>
Date:   Mon Nov 28 11:47:15 2011 +0100

    Amanda client was using perl functions provided by server

 amanda-3.3.0-match_disk.patch |  189 +++++++++++++++++++++++++++++++++++++++++
 amanda.spec                   |    3 +
 2 files changed, 192 insertions(+), 0 deletions(-)
---
diff --git a/amanda-3.3.0-match_disk.patch b/amanda-3.3.0-match_disk.patch
new file mode 100644
index 0000000..b354d34
--- /dev/null
+++ b/amanda-3.3.0-match_disk.patch
@@ -0,0 +1,189 @@
+Index: amanda/branches/3_3/client-src/amdump_client.pl
+===================================================================
+--- amanda/branches/3_3/client-src/amdump_client.pl	(revision 4389)
++++ amanda/branches/3_3/client-src/amdump_client.pl	(revision 4390)
+@@ -28,7 +28,7 @@
+ use Amanda::Util qw( :constants );
+ use Amanda::Config qw( :init :getconf );
+ use Amanda::Paths;
+-use Amanda::Logfile qw( log_rename get_current_log_timestamp $amanda_log_trace_log );
++use Amanda::Util qw ( match_disk );
+ use Amanda::Debug qw( debug );
+ 
+ Amanda::Util::setup_application("amdump_client", "client", $CONTEXT_CMDLINE);
+@@ -95,7 +95,7 @@
+         #find the diskname that match
+ 	for (my $i=1; $i <= $#ARGV; $i++) {
+ 	    for my $diskname (@disks) {
+-		if (Amanda::Logfile::match_disk($ARGV[$i], $diskname)) {
++		if (match_disk($ARGV[$i], $diskname)) {
+ 		    debug("send: DISK " . Amanda::Util::quote_string($diskname));
+ 		    print {$amservice_in} "DISK " . Amanda::Util::quote_string($diskname) . "\n";
+ 		    my $a = <$amservice_out>;
+@@ -118,7 +118,7 @@
+         #find the diskname that match
+ 	for (my $i=1; $i <= $#ARGV; $i++) {
+ 	    for my $diskname (@disks) {
+-		if (Amanda::Logfile::match_disk($ARGV[$i], $diskname)) {
++		if (match_disk($ARGV[$i], $diskname)) {
+ 		    debug("send: DISK " . Amanda::Util::quote_string($diskname));
+ 		    print {$amservice_in} "DISK " . Amanda::Util::quote_string($diskname) . "\n";
+ 		    my $a = <$amservice_out>;
+Index: amanda/branches/3_3/server-src/amvault.pl
+===================================================================
+--- amanda/branches/3_3/server-src/amvault.pl	(revision 4389)
++++ amanda/branches/3_3/server-src/amvault.pl	(revision 4390)
+@@ -108,8 +108,8 @@
+ use Amanda::Cmdline;
+ use Amanda::Paths;
+ use Amanda::Logfile qw( :logtype_t log_add log_add_full
+-			log_rename $amanda_log_trace_log make_stats
+-			match_datestamp match_level );
++			log_rename $amanda_log_trace_log make_stats );
++use Amanda::Util qw ( match_datestamp match_level );
+ 
+ use base qw(
+     Amanda::Recovery::Clerk::Feedback
+Index: amanda/branches/3_3/server-src/amidxtaped.pl
+===================================================================
+--- amanda/branches/3_3/server-src/amidxtaped.pl	(revision 4389)
++++ amanda/branches/3_3/server-src/amidxtaped.pl	(revision 4390)
+@@ -118,7 +118,7 @@
+ 
+ use Amanda::Debug qw( debug info warning );
+ use Amanda::MainLoop qw( :GIOCondition );
+-use Amanda::Util qw( :constants );
++use Amanda::Util qw( :constants match_disk match_host );
+ use Amanda::Feature;
+ use Amanda::Config qw( :init :getconf );
+ use Amanda::Changer;
+@@ -130,7 +130,6 @@
+ use Amanda::Recovery::Scan;
+ use Amanda::DB::Catalog;
+ use Amanda::Disklist;
+-use Amanda::Logfile qw( match_disk match_host );
+ 
+ # Note that this class performs its control IO synchronously.  This is adequate
+ # for this service, as it never receives unsolicited input from the remote
+Index: amanda/branches/3_3/server-src/amdumpd.pl
+===================================================================
+--- amanda/branches/3_3/server-src/amdumpd.pl	(revision 4389)
++++ amanda/branches/3_3/server-src/amdumpd.pl	(revision 4390)
+@@ -39,7 +39,7 @@
+ use Amanda::Cmdline;
+ use Amanda::Paths;
+ use Amanda::Disklist;
+-use Amanda::Logfile qw( match_disk match_host );
++use Amanda::Util qw( match_disk match_host );
+ 
+ # Note that this class performs its control IO synchronously.  This is adequate
+ # for this service, as it never receives unsolicited input from the remote
+Index: amanda/branches/3_3/perl/Amanda/Logfile.swg
+===================================================================
+--- amanda/branches/3_3/perl/Amanda/Logfile.swg	(revision 4389)
++++ amanda/branches/3_3/perl/Amanda/Logfile.swg	(revision 4390)
+@@ -251,7 +251,6 @@
+ 
+ amglue_export_ok(
+     find_log search_logfile dumps_match log_rename
+-    match_host match_disk match_datestamp match_level
+ );
+ 
+ char **find_log(void);
+@@ -289,13 +288,6 @@
+     amglue_dumpspec_list *dumpspecs,
+     gboolean ok);
+ 
+-/* these are actually available for clients as well, but they do not deserve
+- * their own perl module, so they're stuck here */
+-gboolean match_host(char *pat, char *value);
+-gboolean match_disk(char *pat, char *value);
+-gboolean match_datestamp(char *pat, char *value);
+-gboolean match_level(char *pat, char *value);
+-
+ %immutable;
+ amanda_log_handler_t *amanda_log_trace_log;
+ %mutable;
+Index: amanda/branches/3_3/perl/Amanda/DB/Catalog.pm
+===================================================================
+--- amanda/branches/3_3/perl/Amanda/DB/Catalog.pm	(revision 4389)
++++ amanda/branches/3_3/perl/Amanda/DB/Catalog.pm	(revision 4390)
+@@ -401,11 +401,10 @@
+ 
+ =cut
+ 
+-use Amanda::Logfile qw( :constants match_disk match_host
+-			match_datestamp match_level );
++use Amanda::Logfile qw( :constants );
+ use Amanda::Tapelist;
+ use Amanda::Config qw( :init :getconf config_dir_relative );
+-use Amanda::Util qw( quote_string weaken_ref );
++use Amanda::Util qw( quote_string weaken_ref match_disk match_host match_datestamp match_level);
+ use File::Glob qw( :glob );
+ use warnings;
+ use strict;
+Index: amanda/branches/3_3/perl/Amanda/Util.pod
+===================================================================
+--- amanda/branches/3_3/perl/Amanda/Util.pod	(revision 4389)
++++ amanda/branches/3_3/perl/Amanda/Util.pod	(revision 4390)
+@@ -421,7 +421,17 @@
+   burp $filename, $header;
+ 
+ These functions can (and should) be exported to the main namespace
+-  
++
++=head1 MATCHING
++
++The following functions are available to match strings against patterns using
++the rules described in amanda(8):
++
++  match_host($pat, $str);
++  match_disk($pat, $str);
++  match_datestamp($pat, $str);
++  match_level($pat, $str);
++
+ =cut
+ 
+ %}
+Index: amanda/branches/3_3/perl/Amanda/Logfile.pod
+===================================================================
+--- amanda/branches/3_3/perl/Amanda/Logfile.pod	(revision 4389)
++++ amanda/branches/3_3/perl/Amanda/Logfile.pod	(revision 4390)
+@@ -206,16 +206,6 @@
+ 
+ All of these functions can be imported by name.
+ 
+-=head1 MATCHING
+-
+-The following functions are available to match strings against patterns using
+-the rules described in amanda(8):
+-
+-  match_host($pat, $str);
+-  match_disk($pat, $str);
+-  match_datestamp($pat, $str);
+-  match_level($pat, $str);
+-
+ =head1 DEBUG LOGGING HANDLER
+ 
+ This package provides C<$amanda_log_trace_log>, which sends C<die>
+Index: amanda/branches/3_3/perl/Amanda/Util.swg
+===================================================================
+--- amanda/branches/3_3/perl/Amanda/Util.swg	(revision 4389)
++++ amanda/branches/3_3/perl/Amanda/Util.swg	(revision 4390)
+@@ -633,6 +633,16 @@
+ 
+ %}
+ 
++amglue_export_ok(
++    match_host match_disk match_datestamp match_level
++);
++
++gboolean match_host(char *pat, char *value);
++gboolean match_disk(char *pat, char *value);
++gboolean match_datestamp(char *pat, char *value);
++gboolean match_level(char *pat, char *value);
++
++
+ /* -------------------------------------------------------------------------
+  * Functions below this line are only meant to be called within this module;
+  * do not call them externally. */
diff --git a/amanda.spec b/amanda.spec
index 935eb62..f119429 100644
--- a/amanda.spec
+++ b/amanda.spec
@@ -18,6 +18,7 @@ Patch2: amanda-3.1.1-xattrs.patch
 Patch3: amanda-3.1.1-tcpport.patch
 Patch6: amanda-3.2.0-config-dir.patch
 Patch7: amanda-3.3.0-qw.patch
+Patch8: amanda-3.3.0-match_disk.patch
 License: BSD and GPLv3+ and GPLv2+ and GPLv2
 Group: Applications/System
 URL: http://www.amanda.org
@@ -82,6 +83,7 @@ server also needs to have the amanda-client package installed.
 %patch3 -p1 -b .tcpport
 %patch6 -p1 -b .config
 %patch7 -p3 -b .qw
+%patch8 -p3 -b .match_disk
 ./autogen
 
 %build
@@ -433,6 +435,7 @@ rm -rf ${RPM_BUILD_ROOT}
 %changelog
 * Mon Nov 28 2011 Lukáš Nykrýn <lnykryn at redhat.com> - 3.3.0-3
 - fix #757618 - Use of qw(...) as parentheses is deprecated
+- fix #752253 - Using functions in amanda-client which are provided by server
 
 * Thu Jun 16 2011 Marcela Mašláňová <mmaslano at redhat.com> - 3.3.0-2
 - Perl mass rebuild


More information about the scm-commits mailing list