mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-21 13:47:16 +00:00
import-tar: fix mtime type bug
looks like with a .tar file created by the tar tool, tarinfo.mtime is a float [s]. So, after converting to nanoseconds, we need to cast to int because that's what Item.mtime wants. also added a safe_ns() there to clip values to the safe range.
This commit is contained in:
parent
d18d1370ac
commit
2bcee08b88
1 changed files with 1 additions and 1 deletions
|
@ -1447,7 +1447,7 @@ def __init__(self, *, cache, key,
|
|||
def create_helper(self, tarinfo, status=None, type=None):
|
||||
item = Item(path=make_path_safe(tarinfo.name), mode=tarinfo.mode | type,
|
||||
uid=tarinfo.uid, gid=tarinfo.gid, user=tarinfo.uname or None, group=tarinfo.gname or None,
|
||||
mtime=tarinfo.mtime * 1000**3)
|
||||
mtime=safe_ns(int(tarinfo.mtime * 1000**3)))
|
||||
yield item, status
|
||||
# if we get here, "with"-block worked ok without error/exception, the item was processed ok...
|
||||
self.add_item(item, stats=self.stats)
|
||||
|
|
Loading…
Reference in a new issue