Hello! When I tested "emerge -epv anthy" with USE="-emacs", but it still emerge emacs. Perhaps, if some ebuild inherit elisp eclass, it will automatically install emacs. So I made one line patch for enable emacs use flag. Sorry for my English. Thank you. Reproducible: Always Steps to Reproduce:
Created attachment 16500 [details, diff] anthy-4300b.diff
Created attachment 16502 [details, diff] anthy-4300b.diff (another solution)
Thanks for reporting. It certainly is a bug, but the patch (`use emacs && inherit elisp` rather than just `inherit elisp`) doesn't seem to solve the problem. Once you do ACCEPT_KEYWORDS="~x86" USE="emacs" emerge -pev anthy you will get app-editors/emacs as dependency and the next time you do ACCEPT_KEYWORDS="~x86" USE="-emacs" emerge -pev anthy you will still get app-editors/emacs as dependency. It seems that the result of emerge -pe is cached and will not be re-caliculated the next emerge, which will lead to incorrect dependency. In short, your patch should work if Portage correctly caliculates dependency when USE has been changed (i.e. I think `use emacs && ihnerit elisp` should be allowed by Portage), but momentarily I added a patch to not declare `inherit elisp` at the top of the ebuild to avoid this problem.
Committed the temporal fix. Thanks.
inherit is NEVER allowed to be conditional that way. Either you inherit, or you don't. There is no middle ground. It can be worked around, but any auxdb variables MAY NOT be involved in bash conditional statements.
I see. I found an ebuild side workaround to this problem in net-im/licq. licq-1.2.7.ebuild says: inherit kde-base need-kde 3.0 [snip] # we can't have conditional dependencies so "use kde && inherit kde-base" # won't work -- messes up dep caching. # need-kde and their eclass friends inject things into DEPEND. But we only # want them enabled if the kde USE flag is set. We get around this in the # following dep lines: RDEPEND="kde? ( ${DEPEND} )" DEPEND="kde? ( ${DEPEND} ) ssl? ( >=dev-libs/openssl-0.9.6 ) qt? ( >=x11-libs/qt-3.0.0 ) ncurses? ( sys-libs/ncurses )" However, it doesn't seem to work. When I run USE="-kde" emerge -pev licq, hundreds of kde-related ebuild are going to be installed. Is there any general workaround for the problem? * x11-misc/rss-glx * x11-misc/rss-glx * app-i18n/nkf * app-i18n/xsim * app-text/kbedic * net-irc/kvirc * net-www/swish-e * net-im/sim * net-mail/evolution * app-office/siag * media-sound/apollo * app-sci/chemtool are those packages which uses conditional statement with eclass ihneritance. I think it would be better to describe the problem in Ebuild HOWTO or Eclass HOWTO.