summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-05-12 16:10:48 -0400
committerGitHub <noreply@github.com>2021-05-12 16:10:48 -0400
commit071799f259464b4af1c2e8abcd0ff99baae78260 (patch)
tree6961e91c5cff506597a756a376d0776e8fb25161
parentd6507fcfbce90b06a2b611a4cddadc3f64d51a4e (diff)
parent01f6e4b53e08e7e6571c4b209c31b6d5b2082aef (diff)
downloadpodman-071799f259464b4af1c2e8abcd0ff99baae78260.tar.gz
podman-071799f259464b4af1c2e8abcd0ff99baae78260.tar.bz2
podman-071799f259464b4af1c2e8abcd0ff99baae78260.zip
Merge pull request #10324 from containers/uncompressing
[NO TESTS NEEDED] Print "extracting" only on compressed file
-rw-r--r--pkg/machine/pull.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/machine/pull.go b/pkg/machine/pull.go
index d9f34057f..68bb551dc 100644
--- a/pkg/machine/pull.go
+++ b/pkg/machine/pull.go
@@ -162,7 +162,11 @@ func Decompress(localPath, uncompressedPath string) error {
return err
}
- if compressionType := archive.DetectCompression(sourceFile); compressionType.Extension() == "tar.xz" {
+ compressionType := archive.DetectCompression(sourceFile)
+ if compressionType != archive.Uncompressed {
+ fmt.Println("Extracting compressed file")
+ }
+ if compressionType == archive.Xz {
return decompressXZ(localPath, uncompressedFileWriter)
}
return decompressEverythingElse(localPath, uncompressedFileWriter)
@@ -172,7 +176,6 @@ func Decompress(localPath, uncompressedPath string) error {
// Maybe extracting then renameing is a good idea here..
// depends on xz: not pre-installed on mac, so it becomes a brew dependency
func decompressXZ(src string, output io.Writer) error {
- fmt.Println("Extracting compressed file")
cmd := exec.Command("xzcat", "-k", src)
//cmd := exec.Command("xz", "-d", "-k", "-v", src)
stdOut, err := cmd.StdoutPipe()
@@ -190,7 +193,6 @@ func decompressXZ(src string, output io.Writer) error {
}
func decompressEverythingElse(src string, output io.Writer) error {
- fmt.Println("Extracting compressed file")
f, err := os.Open(src)
if err != nil {
return err