summaryrefslogtreecommitdiff
path: root/debian/patches/70_no_defined_on_hash.dpatch
blob: f4eae76d99abf5262b95af2ff2532892e6596232 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh /usr/share/dpatch/dpatch-run
## 70_no_defined_on_hash.dpatch by Ian Campbell <ijc@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Bug #816164 patch by Ian Campbell <ijc@debian.org>
## DP:
## DP: defined(%hash) and defined(@array) have been deprecated for a while and
## DP: are now fatal errors:
## DP:
## DP: Can't use 'defined(%hash)' (Maybe you should just omit the defined()?) at /usr/bin/flexbackup line 1053.
## DP: Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /usr/bin/flexbackup line 2688.
## DP:
## DP: See http://perldoc.perl.org/perldelta.html#defined%28%40array%29-and-defined%28%25hash%29-are-now-fatal-errors
## DP:
## DP: http://perldoc.perl.org/functions/defined.html recommends just checking
## DP: for length (i.e. removing the defined()). Do so.

@DPATCH@
diff -urNad flexbackup-svn~/flexbackup flexbackup-svn/flexbackup
--- flexbackup-svn~/flexbackup	2016-02-28 08:54:08.338589461 +0000
+++ flexbackup-svn/flexbackup	2016-02-28 08:56:08.934584524 +0000
@@ -1050,7 +1050,7 @@
     } else {
 	$prunekey = $dir;
     }
-    if (defined(%{$::prune{$prunekey}})) {
+    if ($::prune{$prunekey}) {
 	&log("| NOTE: \$prune is ignored for type=dump");
     }
 
@@ -2685,7 +2685,7 @@
     }
 
     # Flag old config file
-    if (defined(@cfg::filesystems) or defined($cfg::mt_var_blksize)) {
+    if (@cfg::filesystems or defined($cfg::mt_var_blksize)) {
 	# so strict shuts up
 	my $junk = @cfg::filesystems;
 	$junk = $cfg::mt_var_blksize;
@@ -4883,7 +4883,7 @@
 	$prunekey = $dir;
     }
 
-    if (defined(%{$::prune{$prunekey}})) {
+    if ($::prune{$prunekey}) {
 	# FreeBSD needs -E (above) and no backslashes around the (|) chars
 	if ($::uname =~ /FreeBSD/) {
 	    $cmd .= '-regex "\./(';