cassava / repoctl

Make it easy to manage your local Arch Linux repository.
MIT License
128 stars 13 forks source link

'repoctl update' picks the wrong file if version is the same #51

Closed PedroHLC closed 1 year ago

PedroHLC commented 4 years ago

When repoctl update $pkgname is called it picks the wrong and outdate package instead of the newer one, that's happening with my xz->zst transactions. I think modified timestamp should be compared when pkgver and pkgrel are the same.

EDIT: Thinking better about it, modified timestamp should always be preferred, this would solve problems like 1.0.0-rc1 being bigger than 1.0.0.

cassava commented 4 years ago

Not sure if I agree on the timestamp priority, but it might make sense to make that an option, if it's easy enough to implement. But I do agree that if pkgver and pkgrel are the same, the timestamp should be checked next. (Alphabetically, "xz" is less than "zst", which would explain the current behavior.)

Also, if 1.0.0-rc1 is being sorted higher than 1.0.0, then that would be a proper bug. I'm using a special version comparison function that specifies how versions are to be compared, and it's a little more involved. See https://github.com/cassava/repoctl/blob/devel/pacman/alpm/vercmp.go

PedroHLC commented 1 year ago

This is probably not a problem anymore.