summaryrefslogtreecommitdiff
path: root/debian/patches/72_xdev_is_non_positional.dpatch
blob: db4b28339d2b2d0a47a5cb81ac67058343143357 (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
49
50
51
52
53
54
55
56
57
#!/bin/sh /usr/share/dpatch/dpatch-run
## 72_xdev_is_non_positional.dpatch by Ian Campbell <ijc@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Bug #916602 patch by Ian Campbell <ijc@debian.org>
## DP:
## DP: find issues a warning when `traverse_fs = "false"` is combined with
## DP: pruning:
## DP:     find: warning: you have specified the -xdev option after a non-option argument -regex, but options are not positional (-xdev affects tests specified before it as well as those specified after it).  Please specify options before other arguments.
## DP:
## DP: Resolve this by moving the use of `-xdev` before the `-regex` calls
## DP: produced by pruning. However it is not possible move the `-fstype` used
## DP: for the `traverse_fs = "local"` case (or, presumably, "all" although I
## DP: did not test this) since this changes the semantics and therefore the set
## DP: of files backed up in my testing.

@DPATCH@
--- a/flexbackup
+++ b/flexbackup
@@ -2890,11 +2890,11 @@ sub optioncheck {
     # Traverse mountpoints?
     &checkvar(\$cfg::traverse_fs,'traverse_fs','false local all','false');
     if ($cfg::traverse_fs eq "local") {
-	$::mountpoint_flag = "! -fstype nfs ! -fstype smbfs ! -fstype bind ! -fstype proc ! -fstype devpts ! -fstype devfs ! -fstype tmpfs";
+	$::late_mountpoint_flag = "! -fstype nfs ! -fstype smbfs ! -fstype bind ! -fstype proc ! -fstype devpts ! -fstype devfs ! -fstype tmpfs";
     } elsif ($cfg::traverse_fs eq "all") {
-	$::mountpoint_flag = "! -fstype proc ! -fstype devpts ! -fstype devfs ! -fstype tmpfs";
+	$::late_mountpoint_flag = "! -fstype proc ! -fstype devpts ! -fstype devfs ! -fstype tmpfs";
     } else {
-	$::mountpoint_flag = "-xdev";
+	$::early_mountpoint_flag = "-xdev";
     }
 
     # Block size
@@ -4842,7 +4842,11 @@ sub file_list_cmd {
 	$prunekey = $dir;
     }
 
+    if (defined($::early_mountpoint_flag)) {
+	$cmd .= "$::early_mountpoint_flag ";
+    }
+
     if ($::prune{$prunekey}) {
 	# FreeBSD needs -E (above) and no backslashes around the (|) chars
 	if ($::uname =~ /FreeBSD/) {
 	    $cmd .= '-regex "\./(';
@@ -4861,7 +4865,9 @@ sub file_list_cmd {
 	$cmd .= "-depth ";
     }
 
-    $cmd .= "$::mountpoint_flag ";
+    if (defined($::late_mountpoint_flag)) {
+	$cmd .= "$::late_mountpoint_flag ";
+    }
     $cmd .= "! -type s ";
 
     if (defined($otherarg)) {