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, 11 October 2019, 01:36 GMT
Opened by Tomas Mudrunka (harvie) - Friday, 08 January 2010, 14:58 GMT
Last edited by Allan McRae (Allan) - Friday, 11 October 2019, 01:36 GMT
|
Details
according to wiki:
http://wiki.archlinux.org/index.php/Custom_local_repository#
----CUT--- 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. ----CUT--- 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
Closed by Allan McRae (Allan)
Friday, 11 October 2019, 01:36 GMT
Reason for closing: Implemented
Additional comments about closing: git commit c8062d75
Friday, 11 October 2019, 01:36 GMT
Reason for closing: Implemented
Additional comments about closing: git commit c8062d75
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.
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...
So it's just better to edit repo-add to do a vercmp and decide whether or not it should add the package if it's an older version than the version already in the database, without touching pacman itself, right?
Something like:
repo-add --keep-latest /path/to/db /path/to/package
Im checking in the add() function whether the version of the package is newer or not, but I'm not sure a function to parse the kind of file already exists.
If not I'm just gonna write it. Sorry for my inexperience and harrasment :(
I'll do much more testing on it this evening anyway