FS#72353 - Usage weirdness
Attached to Project:
Pacman
Opened by morganamilo (morganamilo) - Tuesday, 05 October 2021, 18:57 GMT
Opened by morganamilo (morganamilo) - Tuesday, 05 October 2021, 18:57 GMT
|
Details
Usage is currently weirdly implemented in some places.
There's a couple of issues I've noticed with it.
--- alpm_sync_get_new_version() doesn't support usage and has to be managed by the front end. Also the front end is kind of wrong about this [testing] has foo-3 with Usage = Sync [core] has foo-2 with Usage = All [local] has foo-1 pacman -Syu wants to update to foo-2 pacman -Qu says foo-1 -> foo-3 [ignored] Any Ideas? If alpm_sync_get_new_version() respected usage then we couldn't print the version it would upgrade to. --- There's also no real usage support for groups. This could be filtered in the front end but really should be in the back end. This could be done by having alpm_db_get_group() allocate a group on call that is filtered by usage. --- Lack of a Usage = None option. This is not really needed at the moment and was closed in is implemented then this would make sense. --- alpm_find_dbs_satisfier() only works with Usage = Install | Upgrade This is due to the function calling find_deps internally where it does make sense. find_deps should probably take a flag for "is this for a transaction or user call" where it would check Usage = Search instead? --- Packages can still be queried for without Usage = Search. This depends on how you think of Usage = Search. Should Search also cover pacman -Si? Should there be a separate Usage = Query? Or do we not care. I think a simple aproch would be to have alpm_db_get_pkgcache() return null without Usage = Query/Search. Maybe alpm_db_get_pkgcache() should return null without Usage = Search |
This task depends upon
would then allow you to install packages with that usage.
But that doesn't matter really because if your front end looks up packages using alpm_db_get_pkgcache()
and selecting the package by name instead of satisfier then that will bypass usage too. Maybe the check
should be in alpm_add_pkg() and we use the ignorepkg prompt?
the package in testing had an ignored group but the one in core did not.