Package: flexbackup
Version: 1.2.1-6
Priority: wishlist
Tags: patch upstream

Dear flexbackup maintainer, attached is a patch to fix two issues I've found
with flexbackup:

- flexbackup does not send the output of errors to stderr. If you redirect
  stdout to a log file you will not see the errors unless you dig for them
  in the file. The patch changes the printout to explicitly use stderr
  in some cases

- (at least in my configuration) flexbackup will emit some perl warnings due
  to one of its function trying to do stuff with undefined or empty
  variables

The diff introduces two new patches (using dpatch) for these two issues.
Please consider them and, if possible, submit them upstream.

Regards

Javier
diff -Nru flexbackup-1.2.1/debian/changelog flexbackup-1.2.1.NEW/debian/changelog
--- flexbackup-1.2.1/debian/changelog	2011-06-22 08:33:49.000000000 +0200
+++ flexbackup-1.2.1.NEW/debian/changelog	2011-06-22 08:33:14.412450946 +0200
@@ -1,3 +1,15 @@
+flexbackup (1.2.1-7) unstable; urgency=low
+
+  * New patches:
+    - 70_use_stderr_for_errors.dpatch: Use standard error for error
+      messages so that they are not missed if the standard output
+      is sent to a file
+    - 80_undefined_string.dpatch: Prevent split_list from continuining
+      if string is undefined to prevent Perl error messages under 
+      some configurations
+
+ -- Javier Fernandez-Sanguino Pen~a <[email protected]>  Wed, 22 Jun 2011 08:32:15 +0200
+
 flexbackup (1.2.1-6) unstable; urgency=low
 
   * Acknowledge NMU.  Thanks, Marco Rodrigues and Lucas Nussbaum!
diff -Nru flexbackup-1.2.1/debian/patched/70_use_stderr_for_errors.dpatch.failed flexbackup-1.2.1.NEW/debian/patched/70_use_stderr_for_errors.dpatch.failed
--- flexbackup-1.2.1/debian/patched/70_use_stderr_for_errors.dpatch.failed	1970-01-01 01:00:00.000000000 +0100
+++ flexbackup-1.2.1.NEW/debian/patched/70_use_stderr_for_errors.dpatch.failed	2011-06-22 08:23:01.057621214 +0200
@@ -0,0 +1 @@
+md5sum: 8cf6b53c9d7a9b92851c206cba50f66e  /home/jfs/debian/UNSUPPORTED/flexbackup/flexbackup-1.2.1/debian/patches/70_use_stderr_for_errors.dpatch
diff -Nru flexbackup-1.2.1/debian/patches/00list flexbackup-1.2.1.NEW/debian/patches/00list
--- flexbackup-1.2.1/debian/patches/00list	2011-06-22 08:33:49.000000000 +0200
+++ flexbackup-1.2.1.NEW/debian/patches/00list	2011-06-22 08:33:33.691157987 +0200
@@ -8,3 +8,5 @@
 42_afio_cpio_incompatible_ok
 50_lzma_support
 60_use_afio_default_nocompression
+70_use_stderr_for_errors.dpatch
+80_undefined_string.dpatch
diff -Nru flexbackup-1.2.1/debian/patches/70_use_stderr_for_errors.dpatch flexbackup-1.2.1.NEW/debian/patches/70_use_stderr_for_errors.dpatch
--- flexbackup-1.2.1/debian/patches/70_use_stderr_for_errors.dpatch	1970-01-01 01:00:00.000000000 +0100
+++ flexbackup-1.2.1.NEW/debian/patches/70_use_stderr_for_errors.dpatch	2011-06-22 08:25:55.529903006 +0200
@@ -0,0 +1,53 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 70_use_stderr_for_errors.dpatch by  <[email protected]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Send error messages to stderr instead of to the default
+## DP: standard output.
+
+@DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' flexbackup-1.2.1~/flexbackup flexbackup-1.2.1/flexbackup
+--- flexbackup-1.2.1~/flexbackup	2011-06-22 08:24:03.000000000 +0200
++++ flexbackup-1.2.1/flexbackup	2011-06-22 08:24:59.000000000 +0200
+@@ -2726,9 +2726,9 @@
+     &checkvar(\$cfg::sprefix,'sprefix','exist','');
+ 
+     if (@::errors) {
+-	print $::msg "Errors:\n";
++	print STDERR "Errors:\n";
+ 	while(@::errors) {
+-	    print $::msg " " . shift(@::errors) . "\n";
++	    print STDERR " " . shift(@::errors) . "\n";
+ 	}
+ 	exit(1);
+     }
+@@ -3608,9 +3608,9 @@
+     }
+ 
+     if (@::errors) {
+-	print $::msg "\nErrors:\n";
++	print STDERR "\nErrors:\n";
+ 	while(@::errors) {
+-	    print $::msg " " . shift(@::errors) . "\n";
++	    print STDERR " " . shift(@::errors) . "\n";
+ 	}
+ 	exit(1);
+     }
+@@ -3631,7 +3631,7 @@
+     &check_remote_progs(\%::remotehosts, \@::remoteprogs);
+ 
+     if (@::errors) {
+-	print $::msg "\nErrors:\n";
++	print STDERR "\nErrors:\n";
+ 	while(@::errors) {
+ 	    print $::msg " " . shift(@::errors) . "\n";
+ 	}
+@@ -3887,7 +3887,7 @@
+ 
+     if (!defined($$ref)) {
+ 	if (!defined($::opt{'nodefaults'}) and defined($default)) {
+-	    print $::msg " \$$varname not found in config: default=$default\n";
++	    print STDERR " \$$varname not found in config: default=$default\n";
+ 	    $$ref = $default;
+ 	} else {
+ 	    push(@::errors,"\$$varname not defined");
diff -Nru flexbackup-1.2.1/debian/patches/80_undefined_string.dpatch flexbackup-1.2.1.NEW/debian/patches/80_undefined_string.dpatch
--- flexbackup-1.2.1/debian/patches/80_undefined_string.dpatch	1970-01-01 01:00:00.000000000 +0100
+++ flexbackup-1.2.1.NEW/debian/patches/80_undefined_string.dpatch	2011-06-22 08:32:01.969310029 +0200
@@ -0,0 +1,26 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 80_undefined_string.dpatch by  <[email protected]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Do not continue in the function if split_list is called
+## DP: with an empty string. 
+## DP: This fix prevents the following errors from appearing on screen
+## DP: Under some configurations
+## DP:
+## DP: Use of uninitialized value $string in pattern match (m//) at /usr/bin/flexbackup line 5705.
+## DP: Use of uninitialized value $string in pattern match (m//) at /usr/bin/flexbackup line 5709.
+## DP: Use of uninitialized value $string in split at /usr/bin/flexbackup line 5714.
+
+
+@DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' flexbackup-1.2.1~/flexbackup flexbackup-1.2.1/flexbackup
+--- flexbackup-1.2.1~/flexbackup	2011-06-22 08:30:12.000000000 +0200
++++ flexbackup-1.2.1/flexbackup	2011-06-22 08:30:48.000000000 +0200
+@@ -5657,6 +5657,7 @@
+ 
+     my $string = shift(@_);
+     my @array;
++    return @array if ! defined($string) or $string eq "";
+ 
+     if ($string =~ m/\"/) {
+ 	$string =~ s/^\s*\"//;

Attachment: signature.asc
Description: Digital signature

Reply via email to