clearlinux / swupd-server

Software update server (deprecated)
Other
13 stars 17 forks source link

Change delta's name from FROM-TO-HASH2 to FROM-TO-HASH1-HASH2 format. #14

Closed jrguzman-intel closed 8 years ago

jrguzman-intel commented 8 years ago

There is an issue when two different files in a newer release have same hash: This is, when swupd updates a file by applying a delta, it takes the HASH2 to know the file where delta must be applyed. If files are different in current release (before updating), there must be 2 deltas, one for each file but as the two files have same hash in new release delta's name are the same: FROM-TO-HASH2 and it is when issue arises due to just the last delta file is kept when swupd server creates files and packs. So when swupd client tries to apply the delta to one of the file that does not corresponds it will fail and generates an error. At the first look it will seem like delta file is corrupted however the issue is that delta file was created for another file. To solve this issue we include the hash for the original file in the delta's name so that swupd client can take the correct delta and apply it: FROM-TO-HASH1-HASH2.

Warning: A corresponding patch to swupd client must be applied in order to sync both sides and understand the new delta's name format.

-> Refer to https://github.com/jrguzman-intel/swupd-client/commit/49175ce96aae78515d70a6cd6e7aed1291247f98 -<

Signed-off-by: Jose R Guzman jose.r.guzman.mosqueda@intel.com

bryteise commented 8 years ago

Looks good but like the client I'd like to see some tests for this.

jrguzman-intel commented 8 years ago

@bryteise It was tested by generating files and then feed swupd-client with new deltas. Also fullfiles were deleted to make sure swupd-client uses deltas to update files. This was two step testing one without changes in swupd-client, so an error was occurred in the update and it was expected and then with the proper patch in client side and update was successful.

tmarcu commented 8 years ago

Merged into master with supplementary conflict fixes.