repology / repology-rules

Package normalization ruleset for Repology
https://repology.org
GNU General Public License v3.0
106 stars 121 forks source link

handle nixpkgs new "unstable without a version" schema #823

Closed Atemu closed 2 months ago

Atemu commented 3 months ago

Projects affected

nixpkgs-unstable and nixpkgs-24.05

Observed behavior

Nixpkgs has a new convention for "unstable versions"; versions that do not correspond with an upstream release: They now must have a version number.

This was done such that tooling for comparing versions is able to reliably do so. 2024-06-06 cannot be compared to 1.4.2 without knowing when 1.4.2 was released, so the convention now is that an unstable version from after release 1.4.2 shall have the version 1.4.2-unstable-2024-06-06.

For upstream projects without a release, it was previously permissible to use unstable-yyyy-mm-dd as the version but this would also confuse version parsers in case a version was tagged at some point.
To combat this issue, the new convention is to assume that the project is version 0; resulting in the version 0-unstable-yyyy-mm-dd.

The schema will be changed as updates come in, so most packages using snapshot version will still be on the old schema for now.

Repology currently appears to recognise this scheme as a regular version rather than a snapshot which on the one hand is good because, if another version exists, it'll correctly mark it as outdated but will also sometimes provide wrong results.

Expected behavior

version-unstabe-yyyy-mm-dd should be marked as ignored as it's always a snapshot version. 0-unstable-yyyy-mm-dd should be treated as version "0" and marked as outdated when an actual version exists in another repo family or as noscheme otherwise.

AMDmi3 commented 2 months ago

It is already handled as you propose. There's one exception though which I believe is the problem - if project is present in only one repository family, ignored (incl. incorrect an untrusted) statuses are cleared (on the basis that even if single repository family uses snapshot or other invalid scheme, it's still comparable and marking older versions as outdated may be useful). This doesn't work well for nix as it uses incompatible schemes within itself. Guess we'll need some kind of exception for this, or extra rule flags.