Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 306677 - sys-apps/portage accepts cat/pkg[A?] even if A is not in IUSE
Summary: sys-apps/portage accepts cat/pkg[A?] even if A is not in IUSE
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-24 17:17 UTC by Aaron W. Swenson
Modified: 2015-06-11 04:22 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 Aaron W. Swenson gentoo-dev 2010-02-24 17:17:17 UTC
The dev-ml/camlidl-1.05.ebuild has these two lines:
  IUSE=""
  DEPEND=">=dev-lang/ocaml-3.10.2[ocamlopt?]"

However, dev-lang/ocaml is pulled in regardless of ocamlopt being enabled or disabled. The conditional appears to be useless.

Reproducible: Always

Steps to Reproduce:
Comment 1 Doktor Notor 2010-02-24 17:50:06 UTC
Well, you don't understand the syntax apparently. What it means is that ocamlopt use flag needs to have the same value (i.e., set or unset) for both dev-lang/ocaml and dev-ml/camlidl, *NOT* that the dependency is optional. The dependency is clearly a hard one. emerge app-doc/pms and see chapter 9.2.4
Comment 2 Doktor Notor 2010-02-24 17:58:13 UTC
Simply put - if you compiled dev-lang/ocaml with USE=ocamlopt, then you need to enable USE=ocamlopt for dev-ml/camlid as well. Other than that, it will depend on dev-lang/ocaml no matter what, the conditional is just for checking the state of USE flags between those two ebuilds.
Comment 3 Aaron W. Swenson gentoo-dev 2010-02-24 18:37:50 UTC
(In reply to comment #2)
> Simply put - if you compiled dev-lang/ocaml with USE=ocamlopt, then you need to
> enable USE=ocamlopt for dev-ml/camlid as well. Other than that, it will depend
> on dev-lang/ocaml no matter what, the conditional is just for checking the
> state of USE flags between those two ebuilds.
> 

But, ocamlopt isn't exposed as a USE flag option for dev-ml/camlidl
  # emerge -pv dev-ml/camlidl
  [ebuild  N    ] app-emacs/ocaml-mode-3.10.2  2,232 kB
  [ebuild  N    ] dev-lang/ocaml-3.10.2
       USE="X emacs gdbm ncurses tk -latex -ocamlopt -xemacs" 0 kB
  [ebuild  N    ] dev-ml/camlidl-1.05  99 kB
And it doesn't appear that the USE flag is used to enable or disable any config options.
Comment 4 Sebastian Luther (few) 2010-02-24 19:02:47 UTC
PMS says: 
"
[opt?]
    The flag must be enabled if the flag is enabled for the package with the
    dependency. 
"

This means that having DEPEND="cat/pkg[A?]" doesn't make much sense if A is not in IUSE of the ebuild the DEPEND string belongs to.
Comment 5 Zac Medico gentoo-dev 2010-02-24 21:08:13 UTC
We should also check for invalid USE conditionals elsewhere in *DEPEND, and also in SRC_URI.
Comment 6 Aaron W. Swenson gentoo-dev 2010-02-24 23:03:54 UTC
Additionally, reading the ChangeLog, dev-ml/camlidl requires ocamlopt to be enabled for dev-lang/ocaml. The conditional should be a requirement and is probably just a typo.
Comment 7 Zac Medico gentoo-dev 2010-02-24 23:09:11 UTC
(In reply to comment #6)
> Additionally, reading the ChangeLog, dev-ml/camlidl requires ocamlopt to be
> enabled for dev-lang/ocaml. The conditional should be a requirement and is
> probably just a typo.

@ml herd: please either add ocamlopt to IUSE or change [ocamlopt?] to [ocamlopt].
Comment 8 Alexis Ballier gentoo-dev 2010-02-25 10:52:32 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Additionally, reading the ChangeLog, dev-ml/camlidl requires ocamlopt to be
> > enabled for dev-lang/ocaml. The conditional should be a requirement and is
> > probably just a typo.
> 
> @ml herd: please either add ocamlopt to IUSE or change [ocamlopt?] to
> [ocamlopt].
> 

http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-ml/camlidl/camlidl-1.05.ebuild?r1=1.3&r2=1.4


Petteri, I would really have preferred having a bug asking for built_with_use to be removed than such a broken commit; please fix
Comment 9 Zac Medico gentoo-dev 2010-02-25 19:00:02 UTC
(In reply to comment #8)
> http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-ml/camlidl/camlidl-1.05.ebuild?r1=1.3&r2=1.4
> 
> 
> Petteri, I would really have preferred having a bug asking for built_with_use
> to be removed than such a broken commit; please fix
> 

Thanks, I've removed the conditional since it was apparently a mistake.
Comment 10 Alex Xu (Hello71) 2015-06-11 00:55:24 UTC
strictly speaking, this makes sense. "if ocamlopt is set, then require ocaml to be built with ocamlopt. otherwise, require ocaml.". since ocamlopt is not set, ocaml is required with the state of ocamlopt being unspecified.

similar arguments can be made for [opt=] etc.

now, an argument can certainly be made that repoman should warn about this, and I don't know if it does or not.
Comment 11 Zac Medico gentoo-dev 2015-06-11 04:22:20 UTC
This has been fixed since 2.2_rc70:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=c68ab8f601e98b3240f812b616b0aeed0fd29776