Skip to content

Commit

Permalink
Merge pull request #1863 from stgraber/master
Browse files Browse the repository at this point in the history
Fix most other compression algorithms
  • Loading branch information
hallyn committed Apr 7, 2016
2 parents fc46491 + f244dce commit 003b8a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ protobuf:
.PHONY: check
check: default
go get -v -x github.com/remyoudompheng/go-misc/deadcode
@# go vet can (and does on go < 1.5) fail
go get -v -x golang.org/x/tools/cmd/vet || true
go test -v ./...
cd test && ./main.sh

Expand Down
9 changes: 8 additions & 1 deletion lxd/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,14 @@ func untarImage(imagefname string, destpath string) error {
}

func compressFile(path string, compress string) (string, error) {
cmd := exec.Command(compress, path, "-c", "-n")
reproducible := []string{"gzip"}

args := []string{path, "-c"}
if shared.StringInSlice(compress, reproducible) {
args = append(args, "-n")
}

cmd := exec.Command(compress, args...)

outfile, err := os.Create(path + ".compressed")
if err != nil {
Expand Down

0 comments on commit 003b8a8

Please sign in to comment.