]> arthur.barton.de Git - bup.git/commitdiff
Record the file size as Metadata.size when possible.
authorRob Browning <rlb@defaultvalue.org>
Wed, 29 Jun 2011 03:07:10 +0000 (22:07 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 14 Oct 2012 20:01:19 +0000 (15:01 -0500)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
lib/bup/metadata.py

index f4b5847d75efbde740a73d44e5d267113281e9be..dfb04b1445dce7d695a9501b5ab45617bfebe84d 100644 (file)
@@ -559,6 +559,7 @@ class Metadata:
     def __init__(self):
         # optional members
         self.path = None
+        self.size = None
         self.symlink_target = None
         self.linux_attr = None
         self.linux_xattr = None
@@ -639,6 +640,7 @@ def from_path(path, statinfo=None, archive_path=None, save_symlinks=True):
     result = Metadata()
     result.path = archive_path
     st = statinfo or xstat.lstat(path)
+    result.size = st.st_size
     result._add_common(path, st)
     if save_symlinks:
         result._add_symlink_target(path, st)