Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#72353 - Usage weirdness

Attached to Project: Pacman
Opened by morganamilo (morganamilo) - Tuesday, 05 October 2021, 18:57 GMT
Task Type Bug Report
Category Backend/Core
Status Unconfirmed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 6.0.0
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

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  FS#58871 . But if  FS#16132 
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

Comment by morganamilo (morganamilo) - Tuesday, 05 October 2021, 19:03 GMT
Also Thinking about it, changing alpm_db_get_group() and alpm_find_dbs_satisfier() to support Usage = Search
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?
Comment by morganamilo (morganamilo) - Tuesday, 05 October 2021, 19:09 GMT
More thinking, you could probably reproduce the -Qu bug using ignoregroup if
the package in testing had an ignored group but the one in core did not.

Loading...