From 9c7e647f9e67b76eb72eecf06b852bad05c236c7 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Fri, 3 Sep 2021 16:27:40 -0700 Subject: [PATCH] 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 --- pkgs/archive/archive.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/pkgs/archive/archive.go b/pkgs/archive/archive.go index 2d12c87..0c0a72b 100644 --- a/pkgs/archive/archive.go +++ b/pkgs/archive/archive.go @@ -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)