Implement compilation with images

A compilespec with an image defined (and no seed) can now be compiled,
and an artifact delta is provided at the end of the process.
This commit is contained in:
Ettore Di Giacinto
2019-11-10 10:48:07 +01:00
parent c51c6264d7
commit ea2a51ce66
6 changed files with 232 additions and 21 deletions

View File

@@ -47,12 +47,13 @@ func (r *CompilerRecipe) Load(path string) error {
r.PackageTree = NewDefaultTree()
}
tmpfile, err := ioutil.TempFile("", "luet")
if err != nil {
return err
}
//tmpfile, err := ioutil.TempFile("", "luet")
//if err != nil {
// return err
//}
r.Tree().SetPackageSet(pkg.NewBoltDatabase(tmpfile.Name()))
r.Tree().SetPackageSet(pkg.NewInMemoryDatabase(false))
//r.Tree().SetPackageSet(pkg.NewBoltDatabase(tmpfile.Name()))
// TODO: Handle cleaning after? Cleanup implemented in GetPackageSet().Clean()
// the function that handles each file or dir
@@ -97,7 +98,7 @@ func (r *CompilerRecipe) Load(path string) error {
return nil
}
err = filepath.Walk(path, ff)
err := filepath.Walk(path, ff)
if err != nil {
return err
}