Summary: | sys-apps/portage: implicates incorrect mask file for overlay masks | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Michael Moon <triffid.hunter> |
Component: | Core - Interface (emerge) | Assignee: | Portage team <dev-portage> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | gentoo, triffid.hunter |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Check masking reason with repo tag |
Description
Michael Moon
2022-06-09 14:17:44 UTC
Here's another example: # emerge -avt wifite These are the packages that would be merged: Calculating dependencies... done! [ebuild N #] net-wireless/wifite-2.6.0:2::pentoo USE="-dict -extra opencl" PYTHON_TARGETS="python3_9 python3_10" 4,411 KiB [ebuild N ] net-wireless/aircrack-ng-1.6_p20200722-r1::gentoo USE="airdrop-ng airgraph-ng experimental netlink pcre sqlite" PYTHON_TARGETS="-python3_8 python3_9 python3_10" 7,425 KiB [ebuild N ] net-wireless/lorcon-0.0_p20200214::gentoo USE="python" PYTHON_TARGETS="-python3_8 python3_9 python3_10" 495 KiB [ebuild N #] net-wireless/hcxdumptool-6.2.0::pentoo USE="-gpio" 105 KiB [ebuild N #] net-wireless/hcxtools-6.2.0::pentoo 139 KiB Total: 5 packages (5 new), Size of downloads: 12,573 KiB The following mask changes are necessary to proceed: (see "package.unmask" in the portage(5) man page for more details) # required by net-wireless/wifite-2.6.0::pentoo # required by wifite (argument) # /etc/portage/package.mask/chaoslab: =net-wireless/hcxdumptool-6.2.0 # required by net-wireless/wifite-2.6.0::pentoo # required by wifite (argument) # /etc/portage/package.mask/chaoslab: =net-wireless/hcxtools-6.2.0 NOTE: The --autounmask-keep-masks option will prevent emerge from creating package.unmask or ** keyword changes. Use --autounmask-write to write changes to config files (honoring CONFIG_PROTECT). Carefully examine the list of proposed changes, paying special attention to mask or keyword changes that may expose experimental or unstable packages. # edescribe hcxdumptool hcxtools net-wireless/hcxdumptool::pentoo Small tool to capture packets from wlan devices (https://github.com/ZerBea/hcxdumptool) net-wireless/hcxtools::pentoo Portable solution for capturing wlan traffic and conversion to hashcat formats (https://github.com/ZerBea/hcxtools) # grep . /etc/portage/package.mask/chaoslab /etc/portage/package.mask/pentoo /etc/portage/package.mask/chaoslab:*/*::chaoslab /etc/portage/package.mask/pentoo:*/*::pentoo # emerge --version Portage 3.0.30 (python 3.10.5-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-11.3.0, glibc-2.34-r13, 5.15.55-dorellan x86_64) -- As in the original report, portage is claiming that these packages are masked by an entry in /etc/portage/package.mask/chaoslab, when they're actually masked by an entry in /etc/portage/package.mask/pentoo. Portage's description of the specific mask is also rather unhelpful, and since portage is lauded for its clear descriptions of relevant issues, this may also be considered a bug. Here's another example: # emerge -avtDUu @world … The following mask changes are necessary to proceed: (see "package.unmask" in the portage(5) man page for more details) # required by games-emulation/yuzu-9999::guru # required by @__auto_slot_operator_replace_installed__ (argument) # /etc/portage/package.mask/chaoslab: =dev-cpp/cpp-httplib-0.10.9 # required by games-emulation/yuzu-9999::guru # required by @__auto_slot_operator_replace_installed__ (argument) # /etc/portage/package.mask/chaoslab: =dev-cpp/cpp-jwt-1.5_pre20220727 $ edescribe cpp-httplib cpp-jwt dev-cpp/cpp-httplib::guru C++ header-only HTTP/HTTPS server and client library (https://github.com/yhirose/cpp-httplib) dev-cpp/cpp-jwt::guru JSON Web Token library for C++ (https://github.com/arun11299) $ grep . /etc/portage/package.mask/{chaoslab,guru} /etc/portage/package.mask/chaoslab:*/*::chaoslab /etc/portage/package.mask/guru:*/*::guru $ emerge --info Portage 3.0.38.1 (python 3.10.8-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-11.3.0, glibc-2.36-r5, 5.19.17-dorellan x86_64) ------------ Emerge claims the packages are masked by an exact version mask in /etc/portage/package.mask/chaoslab, when they're actually masked by an overlay/repo mask (*/*::guru) in /etc/portage/package.mask/guru If portage is trying to suggest what should change so it can continue, perhaps it should be suggesting to add those lines to /etc/portage/package.unmask/yuzu? TLDR in portage/package/ebuild/getmaskingreason.py:
* Remove Atom .without_repo for pkg comparison
* For more clarity about which package.mask entry is blocking the install, add the exact entry in the comment (e.g. # */*::repo)
The reason is because the package.mask lookup is performed by ignoring the overlay.
in portage/package/ebuild/getmaskingreason.py, `x = x.without_repo` is compared to `l_atom = Atom(...).without_repo`. Thus, it will take the first package.mask file matching (*/*::any) in alphabetic order.
I'm not sure why, or if there is a good reason to have done like this. But it seems that if you remove both the `.without_repo` it works properly.
> If portage is trying to suggest what should change so it can continue, perhaps it should be suggesting to add those lines to /etc/portage/package.unmask/yuzu?
It is suggesting to add it to package.unmask:
The following mask changes are necessary to proceed:
(see "package.unmask" in the portage(5) man page for more details)
If you add --autounmask-write, it will add it to /etc/portage/package.unmask
It may be confusing because the comment shows the reason why it is masked (not where to put the unmask entry):
# /etc/portage/package.mask/chaoslab:
=dev-cpp/cpp-jwt-1.5_pre20220727
If you add a comment before your mask, it will be included in the output, e.g.
# /etc/portage/package.mask/chaoslab:
# chaoslab overlay masked by default
=dev-cpp/cpp-jwt-1.5_pre20220727
It shows what it would suggest to add to the unmask file. For more clarity, the mask entry could be included in the comment part:
# /etc/portage/package.mask/chaoslab:
# chaoslab overlay masked by default
# */*::chaoslab
=dev-cpp/cpp-jwt-1.5_pre20220727
This could be done by adding l_atom to the comment (or conditionally adding it when l_atom is not the same as mycpv or mycp).
Could you give a patch, given you've analysed the problem? It'd be really appreciated. Created attachment 872660 [details, diff]
Check masking reason with repo tag
The mask reason can be wrong when using wildcards or when a package is present in multiple repos. Thus checking against the package name including the repo tag is required.
I also added a extra comment line if the mask does not contain to package name to install (e.g. a wildcard mask). I think allow better clarity on the mask reason.
# required by category/package (argument)
# /etc/portage/package.mask/repo:
# masked by wildcard: */*::repo
=category/package-X.Y.Z
I made few tests, by I'm not sure if there are edge cases where this change may cause other issues.
Hi, an update on this issue with portage-3.0.61-r1 (or possibly earlier, I haven't checked in a while) Now it just states 'masked by: package.mask' instead of suggesting any file or details of the mask at all: # emerge -avt linux-tools-power-x86 !!! All ebuilds that could satisfy "linux-tools-power-x86" have been masked. !!! One of the following masked packages is required to complete your request: - sys-power/linux-tools-power-x86-6.1::guru (masked by: package.mask) - sys-power/linux-tools-power-x86-5.18::guru (masked by: package.mask) Ideally it should implicate /etc/portage/package.mask/guru:*/*::guru here for maximum clarity |