[PATCH] python-single-r1.eclass: don't crash Portage with invalid USEDEP syntax

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] python-single-r1.eclass: don't crash Portage with invalid USEDEP syntax

Mike Gilbert-2
This should still serve the purpose of alerting overlay maintainers
without making emerge completely unusable in the interim.

Signed-off-by: Mike Gilbert <[hidden email]>
---
 eclass/python-single-r1.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass
index 739a394ddd18..971adba42c5f 100644
--- a/eclass/python-single-r1.eclass
+++ b/eclass/python-single-r1.eclass
@@ -249,7 +249,7 @@ _python_single_set_globals() {
  else
  PYTHON_DEPS=${deps}
  PYTHON_REQUIRED_USE=${requse}
- PYTHON_USEDEP='%PYTHON_USEDEP-HAS-BEEN-REMOVED%'
+ PYTHON_USEDEP='PYTHON_USEDEP-HAS-BEEN-REMOVED'
  PYTHON_SINGLE_USEDEP=${single_usedep}
  readonly PYTHON_DEPS PYTHON_REQUIRED_USE PYTHON_SINGLE_USEDEP \
  PYTHON_USEDEP
--
2.25.0


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] python-single-r1.eclass: don't crash Portage with invalid USEDEP syntax

Michał Górny-5
On Wed, 2020-02-12 at 13:25 -0500, Mike Gilbert wrote:
> This should still serve the purpose of alerting overlay maintainers
> without making emerge completely unusable in the interim.
>

I don't understand what's the gain.  In both cases emerge won't proceed.
However, with the original syntax the message is clearer:

!!! All ebuilds that could satisfy "kapidox" have been masked.
!!! One of the following masked packages is required to complete your request:
- kde-frameworks/kapidox-5.67.0::gentoo (masked by: invalid: RDEPEND: Invalid atom (Invalid use dep: '%PYTHON_USEDEP-HAS-BEEN-REMOVED%'), token 2)
- kde-frameworks/kapidox-5.64.0::gentoo (masked by: invalid: RDEPEND: Invalid atom (Invalid use dep: '%PYTHON_USEDEP-HAS-BEEN-REMOVED%'), token 2)

than:

emerge: there are no ebuilds built with USE flags to satisfy "dev-python/jinja[PYTHON-USEDEP_HAS_BEEN_REMOVED]".
!!! One of the following packages is required to complete your request:
- dev-python/jinja-2.10.3-r1::gentoo (Missing IUSE: PYTHON-USEDEP_HAS_BEEN_REMOVED)
- dev-python/jinja-2.10.3::gentoo (Missing IUSE: PYTHON-USEDEP_HAS_BEEN_REMOVED)
- dev-python/jinja-2.10.1::gentoo (Missing IUSE: PYTHON-USEDEP_HAS_BEEN_REMOVED)
- dev-python/jinja-2.8.1::gentoo (Missing IUSE: PYTHON-USEDEP_HAS_BEEN_REMOVED)
(dependency required by "kde-frameworks/kapidox-5.67.0::gentoo" [ebuild])
(dependency required by "kapidox" [argument])

--
Best regards,
Michał Górny


signature.asc (631 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] python-single-r1.eclass: don't crash Portage with invalid USEDEP syntax

Mike Gilbert-2
On Wed, Feb 12, 2020 at 1:31 PM Michał Górny <[hidden email]> wrote:
>
> On Wed, 2020-02-12 at 13:25 -0500, Mike Gilbert wrote:
> > This should still serve the purpose of alerting overlay maintainers
> > without making emerge completely unusable in the interim.
> >
>
> I don't understand what's the gain.  In both cases emerge won't proceed.
> However, with the original syntax the message is clearer:

A pentoo user reported an actual crash in portage when it was unable
to parse the dependency atom. See the backlog in #gentoo-qa for the
discussion.

However, I have been unable to reproduce this crash myself, so I'm
going to hold off on merging this patch until the problem can be
further diagnosed.

The portage output is below.

Calculating dependencies  ... ..... done!
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/portage/dep/__init__.py",
line 739, in use_reduce
    is_valid_flag=is_valid_flag)
  File "/usr/lib64/python3.6/site-packages/portage/dep/__init__.py",
line 1411, in __init__
    use = _use_dep(use_str[1:-1].split(","), eapi_attrs)
  File "/usr/lib64/python3.6/site-packages/portage/dep/__init__.py",
line 897, in __init__
    raise InvalidAtom(_("Invalid use dep: '%s'") % (x,))
portage.exception.InvalidAtom: Invalid use dep:
'%PYTHON_USEDEP-HAS-BEEN-REMOVED%'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.6/emerge", line 53, in <module>
    retval = emerge_main()
  File "/usr/lib64/python3.6/site-packages/_emerge/main.py", line
1309, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib64/python3.6/site-packages/_emerge/actions.py", line
3358, in run_action
    retval = action_build(emerge_config, spinner=spinner)
  File "/usr/lib64/python3.6/site-packages/_emerge/actions.py", line
357, in action_build
    settings, trees, myopts, myparams, myaction, myfiles, spinner)
  File "/usr/lib64/python3.6/site-packages/_emerge/depgraph.py", line
9891, in backtrack_depgraph
    myaction, myfiles, spinner)
  File "/usr/lib64/python3.6/site-packages/_emerge/depgraph.py", line
9928, in _backtrack_depgraph
    success, favorites = mydepgraph.select_files(myfiles)
  File "/usr/lib64/python3.6/site-packages/_emerge/depgraph.py", line
3990, in select_files
    return self._select_files(args)
  File "/usr/lib64/python3.6/site-packages/_emerge/depgraph.py", line
4333, in _select_files
    return self._resolve(myfavorites)
  File "/usr/lib64/python3.6/site-packages/_emerge/depgraph.py", line
4484, in _resolve
    if not self._create_graph():
  File "/usr/lib64/python3.6/site-packages/_emerge/depgraph.py", line
2722, in _create_graph
    allow_unsatisfied=allow_unsatisfied):
  File "/usr/lib64/python3.6/site-packages/_emerge/depgraph.py", line
3480, in _add_pkg_deps
    allow_unsatisfied):
  File "/usr/lib64/python3.6/site-packages/_emerge/depgraph.py", line
3496, in _add_pkg_dep_string
    allow_unsatisfied)
  File "/usr/lib64/python3.6/site-packages/_emerge/depgraph.py", line
3576, in _wrapped_add_pkg_dep_string
    pkg, dep_priority, root_config, selected_atoms[pkg]):
  File "/usr/lib64/python3.6/site-packages/_emerge/depgraph.py", line
3775, in _minimize_children
    root_config.root, atom, parent=parent)
  File "/usr/lib64/python3.6/site-packages/_emerge/depgraph.py", line
5775, in _select_pkg_highest_available
    ret = self._select_pkg_highest_available_imp(root, atom,
onlydeps=onlydeps, parent=parent)
  File "/usr/lib64/python3.6/site-packages/_emerge/depgraph.py", line
6003, in _select_pkg_highest_available_imp
    root, atom, onlydeps=onlydeps, parent=parent)
  File "/usr/lib64/python3.6/site-packages/_emerge/depgraph.py", line
6600, in _wrapped_select_pkg_highest_available_imp
    self._changed_deps(pkg))):
  File "/usr/lib64/python3.6/site-packages/_emerge/depgraph.py", line
2697, in _changed_deps
    eapi=ebuild.eapi, token_class=Atom)
  File "/usr/lib64/python3.6/site-packages/portage/dep/__init__.py",
line 744, in use_reduce
    % (e, pos+1), errors=(e,))
portage.exception.InvalidDependString: Invalid atom (Invalid use dep:
'%PYTHON_USEDEP-HAS-BEEN-REMOVED%'), token 6