Skip to content

Commit

Permalink
[#50656] Use pigz instead of gunzip if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
GPlaczek committed Nov 6, 2023
1 parent ddcef26 commit 4a6a088
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dockersave/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,12 @@ def download(self, path="", layersdir=None, tar=False, rm=False, gunzip=False, x
if gunzip:
gzpath = join(inner_dir, "layer.tar.gz")
os.rename(tarpath, gzpath)
subprocess.run("gunzip {}".format(gzpath), shell=True, check=True)
if shutil.which("pigz") is not None:
cmd = "pigz -d"
else:
cmd = "gunzip"

subprocess.run(f"{cmd} {gzpath}", shell=True, check=True)



Expand Down

0 comments on commit 4a6a088

Please sign in to comment.