From a0314fcce641d517c0f15fb0cd8baa2bd972f032 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Fri, 30 Dec 2011 20:40:27 -0600 Subject: [PATCH] Fix metadata._set_up_path() to allow restoration of top-level files. Signed-off-by: Rob Browning Reviewed-by: Zoran Zaric --- lib/bup/metadata.py | 2 +- t/test-meta.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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. -- 2.39.2