// CheckZeroPack validates the zero pack associated with the bundle at the present version
CheckZeroPack validates the zero pack associated with the bundle at the present version
// CheckZeroPack validates the zero pack associated with the bundle at the present version
func CheckZeroPack(c *config.Config, m *swupd.Manifest) ([]string, error) {
	tmpDir, err := ioutil.TempDir("", fmt.Sprintf("check-zero-pack-%s-%d-", m.Name, m.Header.Version))
	if err != nil {
		return []string{}, err
	}
	defer func() {
		_ = os.RemoveAll(tmpDir)
	}()
	url := fmt.Sprintf("%s/update/%d/pack-%s-from-0.tar", c.UpstreamURL, m.Header.Version, m.Name)
	err = helpers.TarExtractURL(url, filepath.Join(tmpDir, fmt.Sprint(m.Header.Version)))
	if err != nil {
		return []string{}, err
	}
	var failures []string
	es := checkBundleFileHashesPack(filepath.Join(tmpDir, "staged"), m, 0)
	for _, e := range es {
		failures = append(failures, e.Error())
	}
	return failures, nil
}
func CheckZeroPack ( c * config . Config , m * swupd . Manifest ) ( [ ] string , error ) { tmpDir , err := ioutil . TempDir ( " " , fmt . Sprintf ( " " , m . Name , m . Header . Version ) ) if err != nil { return [ ] string { } , err } defer func ( ) { _ = os . RemoveAll ( tmpDir ) } ( ) url := fmt . Sprintf ( " " , c . UpstreamURL , m . Header . Version , m . Name ) err = helpers . TarExtractURL ( url , filepath . Join ( tmpDir , fmt . Sprint ( m . Header . Version ) ) ) if err != nil { return [ ] string { } , err } var failures [ ] string es := checkBundleFileHashesPack ( filepath . Join ( tmpDir , " " ) , m , 0 ) for _ , e := range es { failures = append ( failures , e . Error ( ) ) } return failures , nil }
CheckZeroPack validates the zero pack associated with the bundle at the present version
CheckZeroPack validates the zero pack associated with the bundle at the present version