From 47891d8951a95b8e0d9ca94387107cdf12ca3d3c Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sat, 25 Jan 2020 22:18:53 +0100 Subject: [PATCH] save: add empty metadata if reading fails If we cannot read a file's metadata, we must add an entry in the repository nonetheless because the bupm contents must match the tree contents. Add a dummy (empty) metadata entry in this case, as is already done when reading a directory's metadata. Signed-off-by: Johannes Berg Reviewed-by: Rob Browning --- cmd/save-cmd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/save-cmd.py b/cmd/save-cmd.py index 28019ba..76c1c8f 100755 --- a/cmd/save-cmd.py +++ b/cmd/save-cmd.py @@ -442,8 +442,8 @@ for (transname,ent) in r.filter(extra, wantrecurse=wantrecurse_during): except (OSError, IOError) as e: add_error(e) lastskip_name = ent.name - else: - metalists[-1].append((sort_key, meta)) + meta = metadata.Metadata() + metalists[-1].append((sort_key, meta)) if exists and wasmissing: count += oldsize -- 2.39.2