]> arthur.barton.de Git - bup.git/commitdiff
parse_excludes: drop empty --exclude-from paths
authorRob Browning <rlb@defaultvalue.org>
Mon, 30 Jun 2014 18:33:05 +0000 (13:33 -0500)
committerRob Browning <rlb@defaultvalue.org>
Mon, 30 Jun 2014 18:38:22 +0000 (13:38 -0500)
Empty paths shouldn't match during drecurse, but there's no point in
including them.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Documentation/bup-drecurse.md
Documentation/bup-index.md
lib/bup/helpers.py

index 66683a2a264d6c3560f467f639fb3eac51c732ec..ab97ea29af118dd2d146ff60c5d8901e81da0d55 100644 (file)
@@ -43,7 +43,7 @@ come after its children, making this easy.
 
 \--exclude-from=*filename*
 :   read --exclude paths from *filename*, one path per-line (may be
-    repeated).
+    repeated).  Ignore completely empty lines.
     
 \--exclude-rx=*pattern*
 :   exclude any path matching *pattern*.  See `bup-index`(1) for
index e4dd2ac0843c6c263f31822e1cbb2f7af69b0ab9..c69c2aba8c61de2efb55c8c9f7df6e8ce8b223e2 100644 (file)
@@ -152,7 +152,7 @@ does, due to the accommodations described above.
 
 \--exclude-from=*filename*
 :   read --exclude paths from *filename*, one path per-line (may be
-    repeated).
+    repeated).  Ignore completely empty lines.
 
 \--exclude-rx=*pattern*
 :   exclude any path matching *pattern*, which must be a Python regular
index 93bcc07387ff886e590350f6532f2fdb50219e4f..b55c4a981b4cf462e267b88a5192559c02dc72b5 100644 (file)
@@ -812,7 +812,10 @@ def parse_excludes(options, fatal):
             except IOError, e:
                 raise fatal("couldn't read %s" % parameter)
             for exclude_path in f.readlines():
-                excluded_paths.append(realpath(exclude_path.strip()))
+                # FIXME: perhaps this should be rstrip('\n')
+                exclude_path = realpath(exclude_path.strip())
+                if exclude_path:
+                    excluded_paths.append(exclude_path)
     return sorted(frozenset(excluded_paths))