Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Disallow downgrades #271

Open
eclairevoyant opened this issue Aug 18, 2024 · 5 comments
Open

Feature request: Disallow downgrades #271

eclairevoyant opened this issue Aug 18, 2024 · 5 comments

Comments

@eclairevoyant
Copy link

Upstreams sometimes release tags out of order, for example if there's a stable and LTS version branches that are both getting maintenance. In such cases, running nix-update may downgrade stable to the LTS if the LTS tag is newer. It would be useful to disallow such downgrades in that scenario, and ensure only monotonically increasing version numbers.

Example: NixOS/nixpkgs#334315

@Mic92
Copy link
Owner

Mic92 commented Aug 18, 2024

I wonder if this only came up after we switched to the releases api?

@eclairevoyant
Copy link
Author

I wouldn't exactly say that, the following also results in a downgrade:

nix run github:mic92/nix-update/1.4.0 -- -vr 'v([0-9.]*)$' meilisearch

@adamcstephens
Copy link

adamcstephens commented Sep 6, 2024

Here's an example of a downgrade: NixOS/nixpkgs#339887

and from a manual run of nix-update

fetch https://git.sr.ht/~zethra/stargazer/refs/rss.xml
Update 1.2.1 -> 1.1.3 in /home/adam/git/nixpkgs/pkgs/servers/gemini/stargazer/default.nix

Is this a feature request or a bug? Is it expected behavior to downgrade in this situation?

@SuperSandro2000
Copy link
Collaborator

I think for sourcehut we need to semver sort the releases

@Mic92
Copy link
Owner

Mic92 commented Sep 10, 2024

Archlinux has something that works also for more than just semver: https://man.archlinux.org/man/vercmp.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants