From: Rob Browning Date: Sat, 31 Dec 2011 02:40:27 +0000 (-0600) Subject: Fix metadata._set_up_path() to allow restoration of top-level files. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=a0314fcce641d517c0f15fb0cd8baa2bd972f032;p=packages%2Fb%2Fbup.git Fix metadata._set_up_path() to allow restoration of top-level files. Signed-off-by: Rob Browning Reviewed-by: Zoran Zaric --- diff --git a/lib/bup/metadata.py b/lib/bup/metadata.py index 7854017..3ae4db1 100644 --- a/lib/bup/metadata.py +++ b/lib/bup/metadata.py @@ -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', diff --git a/t/test-meta.sh b/t/test-meta.sh index e94a85b..1983b10 100755 --- a/t/test-meta.sh +++ b/t/test-meta.sh @@ -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.