mirror of
https://github.com/clearlinux/swupd-server.git
synced 2026-09-02 11:41:49 +00:00
Instead of only calculating the contentsize for files that were updated in the current version (an inaccurate number for download size since this is not the compressed size), calculate for all files in the manifest. Additionally, do not add submanifest contentsizes to the current manifest contentsize, as this will result in overcount on client systems when multiple bundles include the same bundle. With this change the contentsize field of the manifests will only report the size of the files unique to that bundle. It is then the client's responsibility to calculate total bundle size including included bundles. This is reasonably easy to accomplish with the upcoming swupd-client bundle-list --deps feature. Although the above use case is a bit more work for the client, it additionally allows a user to calculate the installation size of multiple bundles much more easily, since it only has to count bundle dependencies once to ensure files are not over counted. If two bundles not in the same include chain have overlapping content, summing the include chain of each bundle in the client will result in an over-estimation of the total size on the system. The more content is shared, the higher the over-estimation. In reality this overlap will not be large, but it is currently impossible to calculate the exact installed size using just the contentsize. Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>