vaeth / eix

eix can access Gentoo portage ebuild information and description very quickly (using a local cache). It can also be used to access information on installed packages, local settings, and local and external overlays, and informs about changes in the tree
GNU General Public License v2.0
164 stars 13 forks source link

{upgrade} does not expand to 1 even though at least one slot can be upgraded #111

Open Flowdalic opened 1 year ago

Flowdalic commented 1 year ago

Shouldn't the output of the following be 'true'

# FORMAT='{upgrade}true{else}false{}' eix --exact --pure-packages sys-kernel/gentoo-kernel
false

given that eix sys-kernel/gentoo-kernel shows

 # eix sys-kernel/gentoo-kernel
[?] sys-kernel/gentoo-kernel
     Available versions:  
     (5.4.242) 5.4.242-r2^tu
     (5.4.243) ~5.4.243^tu
     (5.4.244) 5.4.244^tu
     (5.10.179) 5.10.179-r2^tu
     (5.10.180) ~5.10.180^tu
     (5.10.181) 5.10.181^tu
     (5.15.110) 5.15.110-r2^tu
     (5.15.111) ~5.15.111^tu
     (5.15.112) ~5.15.112^tu
     (5.15.113) ~5.15.113^tu
     (5.15.114) 5.15.114^tu
     (6.1.27) 6.1.27-r2^tu{gpkg}
     (6.1.28) ~6.1.28^tu
     (6.1.29) ~6.1.29^tu
     (6.1.30) ~6.1.30^tu
     (6.1.31) 6.1.31^tu
     (6.2.16) ~6.2.16^tu
     (6.3.4) ~6.3.4-r1^tu
     (6.3.5) ~6.3.5^tu
       {debug hardened +initramfs savedconfig test}
     Installed versions:  6.1.21(6.1.21)^t(10:25:24 2023-04-04)(initramfs -debug -hardened -savedconfig -test) 6.1.22(6.1.22)^t(08:32:58 2023-04-04)(initramfs -debug -hardened -savedconfig -test) 6.1.27-r2(6.1.27)^t{gpkg}(21:39:40 2023-05-30)(initramfs -debug -hardened -savedconfig -test) 6.2.13(6.2.13)^t(10:56:21 2023-04-28)(initramfs -debug -hardened -savedconfig -test)
     Homepage:            https://wiki.gentoo.org/wiki/Project:Distribution_Kernel https://www.kernel.org/
     Description:         Linux kernel built with Gentoo patches

where 6.1.31 is stable and installable? Also note that [?] besides the package name. I would have expected [?U].

vaeth commented 1 year ago

Do you have either set UPGRADE_TO_HIGHEST_SLOT=false or do you have sys-kernel/gentoo-kernel in /etc/portage/package.slot_upgrade_forbid?

vaeth commented 1 year ago

There was a typo on the eix manpage UPDATE_TO_HIGHEST_SLOT (false) instead of UPGRADE_TO_HIGHEST_SLOT (correct).

Flowdalic commented 1 year ago

Do you have either set UPGRADE_TO_HIGHEST_SLOT=false

No, also explicitly setting UPGRADE_TO_HIGHEST_SLOT=true does not change this behavior

$ UPGRADE_TO_HIGHEST_SLOT=true FORMAT='{upgrade}true{else}false{}' eix --exact --pure-packages sys-kernel/gentoo-kernel
false

or do you have sys-kernel/gentoo-kernel in /etc/portage/package.slot_upgrade_forbid

I didn't even know that such a file exists. It appears to be eix specific and does not affect portage (at least I could find the string "slot_upgrade_forbid" in portage's source), right?

vaeth commented 1 year ago

I tried to reproduce the problem by removing my package.accept_keywords for gentoo-sources and lying about the installed version in /var/db/pkg. However, I get [U?] as expected (I did not try the manual {upgrade} check, because this is redundant as being implicitly called when displaying the [U?]).

In the moment I have no idea what might cause the problem for you.

No, also explicitly setting UPGRADE_TO_HIGHEST_SLOT=true does not change this behavior

Please verify that eix --print UPGRADE_TO_HIGHEST_SLOT really prints true. (This is just a desparate attempt, as I really cannot imagine any other cause). Also, please try to regenerate the database with eix-update (perhaps some subtle corruption has happened.)

It appears to be eix specific and does not affect portage

This conjecture is correct. I introduced it as a way to customize UPGRADE_TO_HIGHEST_SLOT per package. Perhaps not the greatest mechanism, but that's how it is now.

vaeth commented 1 year ago

Another possibility (though even more unlikely): Please verify that eix --print SLOT_UPGRADE_FORBID indeed prints the expected path /etc/portage/package.slot_upgrade_forbid.

Flowdalic commented 1 year ago

I just remember what may be the missing piece. I have a user set file /etc/portage/sets/kernel-preserved:

=sys-kernel/gentoo-kernel-6.1.22
=sys-kernel/gentoo-kernel-6.2.13
=sys-kernel/gentoo-kernel-6.1.27-r2
=sys-kernel/gentoo-kernel-6.1.21

maybe this is confusing eix?

vaeth commented 1 year ago

No. eix does not do any dependency resolution. These files are only used to check whether a package is in world{,_sets}. I tried nevertheless, and it had no effect.