You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fetchcode.package_versions.versions() removes every "0:" substring instead of only a leading default "0:" epoch, corrupting Debian and Ubuntu package versions whose epoch ends in 0 (such as intercal30:0.30-6).
$ python3 -c 'from fetchcode.package_versions import versions; print([v.value for v in versions("pkg:deb/debian/intercal")])'
['30.30-6', '30.30-2', '30.30-1', '29:0.29-3', '29:0.29-2', '28:0.28-4', '0.24-3', '0.20-9', '0.20-4', '0.16-1']
Expected ['30:0.30-6', '30:0.30-2', '30:0.30-1', '29:0.29-3', '29:0.29-2', '28:0.28-4', '0.24-3', '0.20-9', '0.20-4', '0.16-1'] (and '30:0.30-6' rather than '30.30-6' for versions("pkg:deb/ubuntu/intercal")). Stripping 0: turns epoch-30 releases into non-existent epoch-0 versions that no longer match the archive and sort older than 28:0.28-4 under Debian Policy 5.6.12.
Tested with fetchcode 0.8.5 and master (ffbd683), Python 3.11.2 on Linux 6.1.0 (x86_64).
remove_debian_default_epoch() in src/fetchcode/package_versions.py (line 551) calls version.replace("0:", "") across the whole string instead of version.removeprefix("0:").
Activity