mirror of
https://github.com/clearlinux/mixer-tools.git
synced 2026-09-06 13:41:46 +00:00
builder: delete chroots later
Delete them right before the hardlink step (where it does make a difference). It will make easier to split the two code paths right above it (new and old swupd-server). Neither signing, full file creation or zero pack should be affected by it. So the final result should not change. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This commit is contained in:
committed by
tmarcu
parent
93fec93ee4
commit
747caeb606
+19
-19
@@ -581,25 +581,6 @@ func (b *Builder) BuildUpdate(prefixflag string, minVersion int, format string,
|
||||
}
|
||||
timer.Stop()
|
||||
|
||||
// Clean up the bundle chroots as only the full chroot is needed from this point on.
|
||||
if !keepChroots {
|
||||
var files []os.FileInfo
|
||||
files, err = ioutil.ReadDir(b.Bundledir)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Ignored error when cleaning bundle chroots: %s", err)
|
||||
}
|
||||
basedir := filepath.Join(b.Statedir, "image", b.Mixver)
|
||||
for _, f := range files {
|
||||
if f.Name() == "full" {
|
||||
continue
|
||||
}
|
||||
err = os.RemoveAll(filepath.Join(basedir, f.Name()))
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Ignored error when cleaning bundle chroots: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sign the Manifest.MoM that was just created.
|
||||
if !skipSigning {
|
||||
err = b.SignManifestMoM()
|
||||
@@ -705,6 +686,25 @@ func (b *Builder) BuildUpdate(prefixflag string, minVersion int, format string,
|
||||
}
|
||||
timer.Stop()
|
||||
|
||||
// Clean up the bundle chroots as only the full chroot is needed from this point on.
|
||||
if !keepChroots {
|
||||
var files []os.FileInfo
|
||||
files, err = ioutil.ReadDir(b.Bundledir)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Ignored error when cleaning bundle chroots: %s", err)
|
||||
}
|
||||
basedir := filepath.Join(b.Statedir, "image", b.Mixver)
|
||||
for _, f := range files {
|
||||
if f.Name() == "full" {
|
||||
continue
|
||||
}
|
||||
err = os.RemoveAll(filepath.Join(basedir, f.Name()))
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Ignored error when cleaning bundle chroots: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Hardlink the duplicate files. This helps when keeping the bundle chroots.
|
||||
timer.Start("hardlink")
|
||||
hardlinkcmd := exec.Command("hardlink", "-f", b.Statedir+"/image/"+b.Mixver+"/")
|
||||
|
||||
Reference in New Issue
Block a user