diff --git a/swupd/create_manifests_test.go b/swupd/create_manifests_test.go index a45ecb8..1008dfb 100644 --- a/swupd/create_manifests_test.go +++ b/swupd/create_manifests_test.go @@ -478,7 +478,7 @@ func TestContentSizeAcrossVersionsIncludes(t *testing.T) { fullSize := manifests["full"].Header.ContentSize checkSize(manifests["test-bundle1"], 4+7+emptySize) - checkSize(manifests["test-bundle2"], 5+emptySize) + checkSize(manifests["test-bundle2"], 5) // emptySize subtracted out // Check that content size does add files from previous updates. ts.copyChroots(10, 20) @@ -490,7 +490,7 @@ func TestContentSizeAcrossVersionsIncludes(t *testing.T) { manifests = mustParseAllManifests(t, 20, ts.path("www")) checkSize(manifests["test-bundle1"], 4+7+10+emptySize) - checkSize(manifests["test-bundle2"], 5+8+emptySize) + checkSize(manifests["test-bundle2"], 5+8) // emptySize subtracted out // os-core should have the same size as before. checkSize(manifests["os-core"], osCoreSize) diff --git a/swupd/manifest.go b/swupd/manifest.go index 0327979..283859b 100644 --- a/swupd/manifest.go +++ b/swupd/manifest.go @@ -757,6 +757,7 @@ func (m *Manifest) subtractManifestFromManifest(m2 *Manifest) { // this is expensive because we care about order at this point m.Files = append(m.Files[:i], m.Files[i+1:]...) m.Header.FileCount-- + m.Header.ContentSize -= uint64(f1.Info.Size()) } // only need to advance the m2.Files index since i now points to the next