mirror of
https://github.com/clearlinux/mixer-tools.git
synced 2026-09-05 13:11:31 +00:00
swupd: make slim packs across minversions
Add an additional fileContentInManifest check to pack creation to exclude full files that are represented in the from manifest even if the version changed in the to manifest. This allows mixer to exclude unchanged files from delta packs over minversion bumps. Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
This commit is contained in:
@@ -887,6 +887,31 @@ func writeIndexManifest(c *config, ui *UpdateInfo, bundles []*Manifest) (*Manife
|
||||
return idxMan, nil
|
||||
}
|
||||
|
||||
func fileContentInManifest(f *File, m *Manifest) bool {
|
||||
if m == nil {
|
||||
return false
|
||||
}
|
||||
for i := range m.Files {
|
||||
if f.Name != m.Files[i].Name {
|
||||
continue
|
||||
}
|
||||
if f.Hash != m.Files[i].Hash {
|
||||
continue
|
||||
}
|
||||
if f.Type != m.Files[i].Type {
|
||||
continue
|
||||
}
|
||||
if f.Status != m.Files[i].Status {
|
||||
continue
|
||||
}
|
||||
if f.Modifier != m.Files[i].Modifier {
|
||||
continue
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// this is a hack to allow users to update using swupd-client v3.15.3 which performs a
|
||||
// check on contentsize with a maximum a couple of orders off the intended maximum.
|
||||
// Remove this code (and the caller) when a format bump has occurred in Clear.
|
||||
|
||||
+1
-1
@@ -238,7 +238,7 @@ func WritePack(w io.Writer, fromManifest, toManifest *Manifest, outputDir, chroo
|
||||
entry := &info.Entries[i]
|
||||
entry.File = f
|
||||
|
||||
if f.Version <= fromVersion {
|
||||
if f.Version <= fromVersion || fileContentInManifest(f, fromManifest) {
|
||||
entry.Reason = "already in from manifest"
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user