Welcome to the Pacman bug tracker. Please search the current bugs and feature requests before filing a new one! Use advanced search and select "Search in Comments".

* Please select the correct category and version.
* Write a descriptive summary, background info, and provide a reproducible test case whenever possible.

FS#17752 - [repo-add] should have option to prevent downgrading

Attached to Project: Pacman
Opened by Tomas Mudrunka (harvie) - Friday, 08 January 2010, 14:58 GMT
Last edited by Allan McRae (Allan) - Friday, 12 February 2016, 13:04 GMT
Task Type Feature Request
Category Scripts & Tools
Status Unconfirmed
Assigned To Allan McRae (Allan)
Architecture All
Severity Medium
Priority Normal
Reported Version 3.3.3
Due in Version 5.1.0
Due Date Undecided
Percent Complete 0%
Votes 1
Private No


according to wiki:
repo-add /path/to/repo.db.tar.gz /path/to/*.pkg.tar.gz

The last argument will add all pkg.tar.gz files to the repository, so be careful. If having multiple versions of a package in the directory, it is unclear which one will take precedence and end up in the repository.

i think that there can be some option to prevent repo-add from replacing newer version with older version of package in repository. or maybe both packages can be added and "pacman -S" will determine which is newer by itself anyway...
This task depends upon

Comment by Allan McRae (Allan) - Saturday, 06 March 2010, 10:39 GMT
What would make things difficult implementing this is forced downgrades.

But, I do not think you should use *.pkg.tar.gz when maintaining a repo. Use it for the initial commit and then add individual packages.
Comment by Tomas Mudrunka (harvie) - Saturday, 06 March 2010, 11:00 GMT
Yes, you are right with those forced downgrades...
But when i'll want to force downgrade (which is not such common as adding newer version), i will make sure that there are no two different versions of package in repository. But when there are two different versions (which means that no downgrade is forced), pacman should take the newer...
Comment by Tomas Mudrunka (harvie) - Sunday, 14 March 2010, 17:33 GMT
And when i am 100% sure that i don't want to downgrade (eg. in my small personal repo with <100 packages), i can use some option which will add only latest version of all packages to repo.
Comment by Dan McGee (toofishes) - Wednesday, 12 January 2011, 06:16 GMT
Once we have epoch, this should be trivial to implement via a vercmp call and a command line flag, if you still are interested. We won't be doing it for you though. :)
Comment by Allan McRae (Allan) - Sunday, 22 April 2012, 11:36 GMT
We have epoch now... So implementing this will be simple. Patches welcome.