archive: remove testing of gzip archive

It has been determined that this test isn't really necessary. busybox
gzip is probably not going to break (and would be discovered elsewhere
too if it does...)

fixes #4
This commit is contained in:
Clayton Craft
2021-09-03 16:27:40 -07:00
parent 155a7bc17f
commit 9c7e647f9e

View File

@@ -13,7 +13,6 @@ import (
"io"
"log"
"os"
"os/exec"
"path/filepath"
"strings"
)
@@ -52,12 +51,6 @@ func (archive *Archive) Write(path string, mode os.FileMode) error {
return err
}
// test the archive to make sure it's valid
if err := test(path); err != nil {
log.Print("Verification of archive failed!")
return err
}
if err := os.Chmod(path, mode); err != nil {
return err
}
@@ -180,19 +173,6 @@ func (archive *Archive) AddFile(file string, dest string) error {
return nil
}
// Use busybox gzip to test archive
func test(path string) error {
cmd := exec.Command("busybox", "gzip", "-t", path)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
log.Print("'boot-deploy' command failed: ")
return err
}
return nil
}
func (archive *Archive) writeCompressed(path string, mode os.FileMode) error {
// TODO: support other compression formats, based on deviceinfo
fd, err := os.Create(path)