I recently (Oct 13th) updated portage to version 2.2_rc46 (I was previously using 2.2_rc33). Today I went to use autounmask to check what would have to be unmasked in order to upgrade wxGTK-2.8.10.1-r3 (autounmask -p x11-libs/wxGTK-2.8.10.1-r3) when I got this stack trace from python: Traceback (most recent call last): File "/usr/bin/emerge", line 42, in <module> retval = emerge_main() File "/usr/lib64/portage/pym/_emerge/main.py", line 1447, in emerge_main myopts, myaction, myfiles, spinner) File "/usr/lib64/portage/pym/_emerge/actions.py", line 320, in action_build mydepgraph.display_problems() File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 4622, in display_problems self._show_unsatisfied_dep(*pargs, **kwargs) File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 2158, in _show_unsatisfied_dep have_eapi_mask = show_masked_packages(masked_packages) File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 5347, in show_masked_packages cpv, metadata) File "/usr/lib64/portage/pym/portage/__init__.py", line 3054, in _getMissingLicenses use = metadata["USE"].split() KeyError: 'USE' * Restoring files. * done! While I know python relatively well, I do not know the portage internals at all. I am rather surprised by this however since I was using only a slightly older RC before this latest update. I would think it unlikely that the USE metadata would change a great deal in portage between RC 33 and RC 46. That is only 13 bugfix updates later, and a change to the available metadata would probably be considered a major change, not a minor one. So, rather than spend a lot of time on this I merely attempted to verify this error on a package I know autounamsk worked on before: app-emulation/wine-doors... mythtv mgregory # autounmask -p app-emulation/wine-doors-0.1.3 autounmask version 0.27 (using PortageXS-0.02.09 and portage-2.2_rc46) * Using repositories: /usr/portage /usr/local/portage/layman/gnome /usr/local/portage * Using package.keywords file: /etc/portage/package.keywords * Using package.unmask file: /etc/portage/package.unmask * Using package.use file: /etc/portage/package.use * Unmasking app-emulation/wine-doors-0.1.3 and its dependencies.. this might take a while.. * Restoring files. * done! Since that worked ok, i then went in and checked for USE flag related differences between x11-libs/wxGTK and app-emulation/wine-doors... Difference: wine-doors-0.1.3 has an IUSE="" line, while wxGTK-2.8.10.1-r1/r3 have IUSE="X doc debug gnome gstreamer odbc opengl pch sdl". So, I decided to see what happenes if I add a use flag to wine-doors... what I did (basically added a python use flag to a package that autounmask is known to work with in order to do a quick test...) mythtv mgregory # cp -v /usr/portage/app-emulation/wine-doors/wine-doors-0.1.3.ebuild /usr/portage/app-emulation/wine-doors/wine-doors-0.1.3.ebuild.bkup && sed -i -e 's/^IUSE=""/IUSE="python"/' /usr/portage/app-emulation/wine-doors/wine-doors-0.1.3.ebuild `/usr/portage/app-emulation/wine-doors/wine-doors-0.1.3.ebuild' -> `/usr/portage/app-emulation/wine-doors/wine-doors-0.1.3.ebuild.bkup' mythtv mgregory # cd /usr/portage/app-emulation/wine-doors/ mythtv wine-doors # cp -v Manifest Manifest.bak `Manifest' -> `Manifest.bak' mythtv wine-doors # ls ChangeLog Manifest Manifest.bak metadata.xml wine-doors-0.1.3.ebuild wine-doors-0.1.3.ebuild.bkup mythtv wine-doors # cp -v metadata.xml metadata.xml.bak `metadata.xml' -> `metadata.xml.bak' mythtv wine-doors # ebuild wine-doors-0.1.3.ebuild digest >>> Creating Manifest for /usr/portage/app-emulation/wine-doors mythtv wine-doors # autounmask -p app-emulation/wine-doors-0.1.3 autounmask version 0.27 (using PortageXS-0.02.09 and portage-2.2_rc46) * Using repositories: /usr/portage /usr/local/portage/layman/gnome /usr/local/portage * Using package.keywords file: /etc/portage/package.keywords * Using package.unmask file: /etc/portage/package.unmask * Using package.use file: /etc/portage/package.use * Unmasking app-emulation/wine-doors-0.1.3 and its dependencies.. this might take a while.. * Restoring files. * done! Since that produced no issues, I am at a loss without much more additional work, which I think is best to defer to the author(s)/maintainer(s). Reproducible: Always Steps to Reproduce: 1. Attempt to use autounmask (pretend is fine) with x11-libs/wxGTK-2.8.10.1-r3. Portage version 2.2_rc46 *may* be required as well, but I have not tested this. 2. You should get a stack trace reporting a KeyError on the metadata dictionary for the keyword 'USE' 3. Come back here and tell us about it :-) Actual Results: KeyError on 'USE' key for the portage "metadata" dictionary (or list, I haven't viewed the source yet). Expected Results: a list of what must be unmasked to enable x11-libs/wxGTK-2.8.10.1-r3
This looks like a bug in portage. The trace shows emerge dying.
Created attachment 207339 [details, diff] fix KeyError: USE If this patch is saved as /tmp/use_keyerror.patch, then it can be applied as follows: patch /usr/lib/portage/pym/_emerge/depgraph.py /tmp/use_keyerror.patch
This is fixed in 2.1.7.2 and 2.2_rc47.