Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 530086 - python-r1.eclass: Says to set REQUIRED_USE but does not?
Summary: python-r1.eclass: Says to set REQUIRED_USE but does not?
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-21 23:39 UTC by Sebastian Pipping
Modified: 2017-03-10 16:02 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Pipping gentoo-dev 2014-11-21 23:39:34 UTC
I stumbled upon this in relation to bug #528714.

The internal documentation of eclass python-r1 reads:

  "This eclass sets correct IUSE and REQUIRED_USE."

While it does set IUSE, it does /not/ set REQUIRED_USE but rather seems to fill PYTHON_REQUIRED_USE for the developer to use as

  a) REQUIRED_USE="[..] ...? ( ${PYTHON_REQUIRED_USE} ) [..]" 

or

  REQUIRED_USE="[..] ${PYTHON_REQUIRED_USE} [..]"

Now I wonder, if the python-r1 eclasses maybe should initialize REQUIRED_USE or append to it.  On reason is that there seem to be quite a number of python-r1 ebuilds, that do not set REQUIRED_USE by themselves:

  # for i in $(
        find /usr/portage/ -mindepth 3 -type f -name '*.ebuild' \
          | xargs fgrep -lw python-r1
        ); do
      fgrep -q REQUIRED_USE "$i" || echo "$i" ; \
    done \
      | wc -l
  206

What do you think?
Comment 1 Sebastian Pipping gentoo-dev 2014-11-21 23:44:11 UTC
PS: Section "Variables set by ebuilds" [1] may need to ask for setting REQUIRED_USE in the ebuild if it is not done be the eclass, too.  Maybe even in any case.

[1] http://wiki.gentoo.org/wiki/Project:Python/python-r1#Variables_set_by_ebuilds
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-11-22 00:06:03 UTC
This information is outdated. We have been forced not to set REQUIRED_USE unconditionally, so using PYTHON_REQUIRED_USE is necessary now.
Comment 3 Sebastian Pipping gentoo-dev 2014-11-22 00:08:44 UTC
So the right fix would be to

 1. update docs in the eclass

 2. mentioned REQUIRED_USE as TODO per ebuild

 3. fix affected ebuils.

Correct?

I'm unsure if a check could be added to portage to catch this in upcoming ebuilds.
Comment 4 Mike Gilbert gentoo-dev 2014-11-22 01:17:48 UTC
(In reply to Sebastian Pipping from comment #3)

Correct.
Comment 5 Sebastian Pipping gentoo-dev 2014-11-22 02:39:01 UTC
(In reply to Sebastian Pipping from comment #3)
>  1. update docs in the eclass

+  22 Nov 2014; Sebastian Pipping <sping@gentoo.org> python-r1.eclass:
+  Fix docs about REQUIRED_USE in python-r1 (bug #530086)
+


>  2. mentioned REQUIRED_USE as TODO per ebuild

done, at least a start:
https://wiki.gentoo.org/wiki/Project:Python/python-r1#REQUIRED_USE
Comment 6 Sebastian Pipping gentoo-dev 2014-11-22 02:50:52 UTC
(In reply to Sebastian Pipping from comment #3)
>  3. fix affected ebuils.

How do we best go about that?
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-11-22 09:51:27 UTC
(In reply to Sebastian Pipping from comment #5)
> (In reply to Sebastian Pipping from comment #3)
> >  2. mentioned REQUIRED_USE as TODO per ebuild
> 
> done, at least a start:
> https://wiki.gentoo.org/wiki/Project:Python/python-r1#REQUIRED_USE

This doesn't really fit the doc style. You should probably create a separate section if you want to elaborate about standard metadata variables. Then, you don't describe RDEPEND, DEPEND and PDEPEND while the user has to set them properly as well. Then, REQUIRED_USE is mentioned in 'Description' section and in PYTHON_REQUIRED_USE explanation again.
Comment 8 Sebastian Pipping gentoo-dev 2014-11-22 14:01:59 UTC
(In reply to Michał Górny from comment #7)
> This doesn't really fit the doc style. You should probably create a separate
> section if you want to elaborate about standard metadata variables. Then,
> you don't describe RDEPEND, DEPEND and PDEPEND while the user has to set
> them properly as well. Then, REQUIRED_USE is mentioned in 'Description'
> section and in PYTHON_REQUIRED_USE explanation again.

I agree that it's not perfect.  The thing is that REQUIRED_USE is required with python-r1 while it is not for many of the other eclasses.  That makes it different to, say DEPEND.

I think that PYTHON_REQUIRED_USE should actually be documented at both places, though with less duplication maybe, agreed.

I'm happy about any better approaches, I just felt like making a start.
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-03-10 16:02:41 UTC
About fixing remaining ebuilds, gpyutils now has a report for that [1]. I think that solves the bug for good now.

[1]:https://qa-reports.gentoo.org/output/gpyutils/missing-meta.txt