mirror of
https://github.com/borgbackup/borg.git
synced 2024-11-05 03:25:19 +03:00
Merge pull request #6411 from aspargas2/master
Forward port: import-tar fixes
This commit is contained in:
commit
a457e90a95
@ -1447,7 +1447,7 @@ class TarfileObjectProcessors:
|
||||
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)
|
||||
|
@ -329,6 +329,14 @@ def create_filter_process(cmd, stream, stream_close, inbound=True):
|
||||
try:
|
||||
yield stream
|
||||
|
||||
except Exception:
|
||||
# something went wrong with processing the stream by borg
|
||||
logger.debug('Exception, killing the filter...')
|
||||
proc.kill()
|
||||
borg_succeeded = False
|
||||
raise
|
||||
else:
|
||||
borg_succeeded = True
|
||||
finally:
|
||||
if stream_close:
|
||||
stream.close()
|
||||
@ -339,5 +347,6 @@ def create_filter_process(cmd, stream, stream_close, inbound=True):
|
||||
logger.debug('filter cmd exited with code %d', rc)
|
||||
if filter_stream_close:
|
||||
filter_stream.close()
|
||||
if rc:
|
||||
if borg_succeeded and rc:
|
||||
# if borg did not succeed, we know that we killed the filter process
|
||||
raise Error('filter %s failed, rc=%d' % (cmd, rc))
|
||||
|
Loading…
Reference in New Issue
Block a user