Skip to content

Commit

Permalink
bugfix: tar --delay-directory-restore for weird tars, make `_calc_d…
Browse files Browse the repository at this point in the history
…ir_size` non critical
  • Loading branch information
Wazzaps committed May 23, 2022
1 parent cce6621 commit 543d56a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ampm/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.3.1'
__version__ = '1.3.2'
2 changes: 1 addition & 1 deletion ampm/repo/nfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def in_writer():
elif metadata.path_type == 'tar.gz':
tmp_local_path.mkdir(parents=True)
decompressor = subprocess.Popen(
['tar', 'xz'],
['tar', '--delay-directory-restore', '-xz'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
cwd=str(tmp_local_path),
Expand Down
5 changes: 4 additions & 1 deletion ampm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ def _calc_dir_size(path: Path) -> int:
for dirpath, _dirnames, filenames in os.walk(path):
for f in filenames:
fp = os.path.join(dirpath, f)
total_size += os.path.getsize(fp)
try:
total_size += os.path.getsize(fp)
except FileNotFoundError:
pass
return total_size


Expand Down

0 comments on commit 543d56a

Please sign in to comment.