Several pieces of documentation state that USE-flags may be manipulated by setting the USE environment variable. This does not work as documented. The USE environment variable works as documented to *add* USE-flags, but it does not work consistently to *remove* USE-flags. To reproduce: - Go to any gentoo 1.4 system with a generic configuration. - Run "emerge info" and note that kde is included in the USE set printed. - Now run this command: USE='-kde' emerge info - Note that kde is *still* included in the output list, although it was explicitly removed using the highest-priority mechanism. Reproducible: Always Steps to Reproduce: 1. Go to any gentoo 1.4 system with a generic configuration. 2. Run "emerge info" and note that kde is included in the USE set printed. 3. Now run this command: USE='-kde' emerge info Actual Results: 'kde' is included in the output list from both commands Expected Results: The 'kde' USE-flag should not be included in the output from step 3. % USE='-kde' emerge info <------ Note USE='-kde' setting! Gentoo Base System version 1.4.3.13 Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.22-gentoo-r5) ============================================================ ===== System uname: 2.4.22-gentoo-r5 i686 Pentium III (Coppermine) Autoconf: sys-devel/autoconf-2.58-r1 Automake: sys-devel/automake-1.7.7 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O3 -mcpu=i686 -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config / var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-O3 -mcpu=i686 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/ distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X apm arts avi berkdb crypt cups encode esd foomaticdb gdbm gif gnome gpm gtk gtk2 imlib java jpeg kde libg++ libwww mad mikmod motif mpeg ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl slang spell ssl svga tcpd truetype x86 xml2 xmms xv zlib"
Created attachment 26255 [details, diff] Temporary Fix This is more of a hack than a fix. The problem is that regenerate() is called four times during initialisation. One of those times, configdict["env"]["USE"] is replaced with the processed USE flags. Thus by the last time round, any -flag set is not honored. This hack gets around this by copying configdict["backupenv"]["USE"] to configdict["env"]["USE"] if it exists at the start of each regenerate().
*** Bug 42737 has been marked as a duplicate of this bug. ***
I think this is all we should fix. portage.py Line 6270 in cvs. -settings.regenerate() # XXX: Regenerate use after we get a vartree -- GLOBAL +settings.reset() # XXX: Regenerate use after we get a vartree -- GLOBAL maybe, we shouldn't call regenerate() function from out of config class..
Fixed in CVS
Closing it out, can't duplicate it w/ .50-r9 or .51_pre17.