Use version codes alongside version strings for update checking
App Store has historically always used string equality version checking to see if something has gone out of date or not. This should also include an only-incrementing integer version code so that we can more explicitly tell if a package is out of sync or actually out of date.
from the Android SDK docs:
versionCode
— A positive integer used as an internal version number. This number is used only to determine whether one version is more recent than another, with higher numbers indicating more recent versions. This is not the version number shown to users ... The Android system uses the versionCode value to protect against downgrades by preventing users from installing an APK with a lower versionCode than the version currently installed on their device.
The implementation of this would involve:
- A check in libget client that checks the numbers rather than the strings, before calling it an UPDATE
- Changes in our repo updates (repogen.py and spinarak) to create and only-increment this version code
Some issues that will occur:
- What do we do for packages that we detect that have higher version code's than on the server (are these "out of sync"? just "installed"?). This scenario may happen more frequently if using multiple repos
- What do we do about packages that aren't obtained from hbas servers yet (no version code). Likely we can just use the old "update" rules with the string check, but it may be more complicated (see https://github.com/vgmoose/libget/issues/21 )
That being said, probably the functionality is worth implementing even with these gotchas.