]> arthur.barton.de Git - bup.git/commitdiff
Fix metadata._set_up_path() to allow restoration of top-level files.
authorRob Browning <rlb@defaultvalue.org>
Sat, 31 Dec 2011 02:40:27 +0000 (20:40 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sat, 20 Oct 2012 00:55:55 +0000 (19:55 -0500)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
lib/bup/metadata.py
t/test-meta.sh

index 7854017185129957711a2cb180f997458f2ecac6..3ae4db176e02f8eb02502c1f417483adc5e15769 100644 (file)
@@ -687,7 +687,7 @@ def _set_up_path(meta, create_symlinks=True):
         parent = os.path.dirname(meta.path)
         if parent:
             mkdirp(parent)
-            meta.create_path(meta.path, create_symlinks=create_symlinks)
+        meta.create_path(meta.path, create_symlinks=create_symlinks)
 
 
 all_fields = frozenset(['path',
index e94a85b3258276e8ad8af89429792b93093d1cd1..1983b10d8940bb5e66f316b3176de269b06c2196 100755 (executable)
@@ -91,6 +91,13 @@ WVSTART 'meta - general'
 (
     cd "$TOP/bupmeta.tmp"
     test-src-create-extract
+
+    # Test a top-level file (not dir).
+    touch src-file
+    WVPASS bup meta -cf src-file.meta src-file
+    mkdir dest
+    cd dest
+    WVPASS bup meta -xf ../src-file.meta
 )
 
 # Root-only tests: ACLs, Linux attr, Linux xattr, etc.