From: Johannes Berg Date: Sat, 25 Jan 2020 21:18:53 +0000 (+0100) Subject: save: add empty metadata if reading fails X-Git-Tag: 0.30.1~21 X-Git-Url: https://arthur.barton.de/gitweb/?a=commitdiff_plain;ds=sidebyside;h=ed5423c6a5f18dbaf85362aa0517f8d00cf31bfc;p=bup.git 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 (cherry picked from commit 47891d8951a95b8e0d9ca94387107cdf12ca3d3c) Tested-by: Rob Browning --- diff --git a/cmd/save-cmd.py b/cmd/save-cmd.py index e78796b..36cd43a 100755 --- a/cmd/save-cmd.py +++ b/cmd/save-cmd.py @@ -430,8 +430,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