diff --git a/swupd/bundleinfo.go b/swupd/bundleinfo.go index ec49d4f..27569e1 100644 --- a/swupd/bundleinfo.go +++ b/swupd/bundleinfo.go @@ -32,7 +32,7 @@ type bundleInfo struct { Files map[string]bool } -func (m *Manifest) getBundleInfo(path string) error { +func (m *Manifest) getBundleInfo(c config, path string) error { var err error if _, err = os.Stat(path); os.IsNotExist(err) { basePath := filepath.Dir(path) @@ -65,7 +65,7 @@ func (m *Manifest) getBundleInfo(path string) error { return err } - extraFilesPath := filepath.Join(filepath.Dir(path), m.Name+"-extra-files") + extraFilesPath := filepath.Join(c.stateDir, m.Name+"-extra-files") if _, err = os.Stat(extraFilesPath); err == nil { extraFilesBytes, err := ioutil.ReadFile(extraFilesPath) if err != nil { diff --git a/swupd/create_manifests.go b/swupd/create_manifests.go index 8d3bc90..6ccf853 100644 --- a/swupd/create_manifests.go +++ b/swupd/create_manifests.go @@ -84,7 +84,7 @@ func initBundles(ui UpdateInfo, c config) ([]*Manifest, error) { useBundleInfo = false } - err = bundle.getBundleInfo(biPath) + err = bundle.getBundleInfo(c, biPath) if err != nil { return nil, err } diff --git a/swupd/helpers_test.go b/swupd/helpers_test.go index e40f67c..1329112 100644 --- a/swupd/helpers_test.go +++ b/swupd/helpers_test.go @@ -504,7 +504,7 @@ func (fs *testFileSystem) addDir(version uint32, bundle, dir string) { func (fs *testFileSystem) addExtraFile(version uint32, bundle, file, content string) { fs.t.Helper() - path := filepath.Join(fs.Dir, "image", fmt.Sprint(version), bundle+"-extra-files") + path := filepath.Join(fs.Dir, bundle+"-extra-files") f, err := os.OpenFile(path, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0644) if err != nil { fs.t.Fatal(err)