The default setting for USE_ORDER lets USE in the environment override package.use, make.conf, etc. However ACCEPT_KEYWORDS in the environment takes precedence over make.conf, but not over package.keywords. carcharias ~ # grep gcc /etc/portage/package.keywords carcharias ~ # emerge -pv gcc [ebuild R ] sys-devel/gcc-4.1.1 ... carcharias ~ # ACCEPT_KEYWORDS=-~x86 emerge -pv gcc [ebuild NS ] sys-devel/gcc-3.4.6-r1 ... carcharias ~ # echo "sys-devel/gcc ~x86" >>/etc/portage/package.keywords carcharias ~ # ACCEPT_KEYWORDS=-~x86 emerge -pv gcc [ebuild R ] sys-devel/gcc-4.1.1 ... I believe that USE_ORDER should affect ACCEPT_KEYWORDS as well, or there should be an ACCEPT_KEYWORDS_ORDER with the same defaults as USE_ORDER. I'm not sure whether to consider this a bug or an enhancement request... Portage 2.1.1_pre2-r4 (default-linux/x86/2005.1, gcc-4.1.1/vanilla, glibc-2.4-r3, 2.6.16-suspend2-r9 i686) ================================================================= System uname: 2.6.16-suspend2-r9 i686 Genuine Intel(R) CPU T2500 @ 2.00GHz Gentoo Base System version 1.12.1 dev-lang/python: 2.4.3-r1 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: [Not Present] dev-util/confcache: 0.4.2-r1 sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17 sys-devel/gcc-config: 2.0.0_rc1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r5 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=pentium4 -Os -fomit-frame-pointer -pipe -fweb" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/init.d /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo" CXXFLAGS="-march=pentium4 -Os -fomit-frame-pointer -pipe -fweb" DISTDIR="/usr/portage/packages/sources" FEATURES="autoconfig buildpkg confcache distlocks fixpackages metadata-transfer sandbox sfperms splitdebug strict" GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo/" MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="x86 X alsa arts bzip2 crypt cups encode flac gtk hal jpeg kde kdeenablefinal kdehiddenvisibility mmx mp3 pam pic png python qt readline samba sse ssl tiff truetype unicode vorbis zlib elibc_glibc input_devices_evdev input_devices_keyboard input_devices_mouse input_devices_synaptics kernel_linux userland_GNU video_cards_fbdev video_cards_nv video_cards_nvidia video_cards_vesa" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS
If I remember correctly the problem is more that negation in ACCEPT_KEYWORDS doesn't work properly, e.g. set ~arch in make.conf, you can't disable it with -~arch in package.keywords. The whole gvisible() function is a bit fucked up regarding that (like the special treatment for -*).
(In reply to comment #1) Actually setting -~x86 in package.keywords seems to work as expected (some output trimmed for clarity): carcharias rjf # grep gcc /etc/portage/package.keywords carcharias rjf # emerge -vp gcc [ebuild R ] sys-devel/gcc-4.1.1 ... carcharias rjf # echo "sys-devel/gcc -~x86" >>/etc/portage/package.keywords carcharias rjf # emerge -vp gcc [ebuild NS ] sys-devel/gcc-3.4.6-r1 ... But the environment still doesn't override this: carcharias rjf # ACCEPT_KEYWORDS=~x86 emerge -pv gcc [ebuild NS ] sys-devel/gcc-3.4.6-r1 ...
Ok, this required a somewhat nasty hack: the problem was that by the time gvisible() was called (which does the keyword visibility filtering) our config instance had long forgotten about the negated ACCEPT_KEYWORDS values, so to fix this givisble() now looks directly at the env to preserve proper stacking order.
This has been released in 2.1.3_rc6.