/etc/bash_completion contains this: shopt -s extglob When combined with the QA interceptor code in ebuild.sh, bash produces this error during the depend phase: /usr/lib/portage/bin/ebuild.sh: line 1: g++(): command not found QA Notice: g++ in global scope: games-arcade/betna-0.9.7 g++: depend: No such file or directory g++: no input files /usr/lib/portage/bin/ebuild.sh: line 8: return: can only `return' from a function or sourced script /usr/lib/portage/bin/ebuild.sh: eval: line 9: syntax error near unexpected token `}' /usr/lib/portage/bin/ebuild.sh: eval: line 9: ` }' error creating QA interceptor g++ This is because the g++() at the start of the line matches the extended glob pattern +(PATTERN) that is enabled with shopt -s extglob portage should probably turn off many of the shopt options in ebuild.sh. Unless explicitly used (like expand_aliases) they will probably just cause unexpected (and bad) side-effects. Portage 2.0.51-r2 (default-x86-2004.0, gcc-3.3.4, glibc-2.3.4.20040808-r1, 2.4.27 i686) ================================================================= System uname: 2.4.27 i686 AMD Athlon(tm) processor Gentoo Base System version 1.4.16 distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.59-r5 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.14.90.0.8-r1 Headers: sys-kernel/linux-headers-2.4.21-r1 Libtools: sys-devel/libtool-1.5.2-r5 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-mcpu=i686 -O3 -pipe -Wall" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/X11/app-defaults /etc/X11/rstart /etc/X11/serverconfig /etc/X11/starthere /etc/X11/xdm /etc/bash_completion /etc/gconf /etc/init.d /etc/pango /etc/sound/events /etc/ssmtp /etc/terminfo /usr/X11R6/lib/X11/xkb /etc/env.d" CXXFLAGS="-mcpu=i686 -O3 -pipe -Wall -Wno-deprecated" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache cvs distcc distlocks sandbox" GENTOO_MIRRORS="http://gentoo.mirrored.ca/" MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/home/msterret/gentoo-x86" PORTDIR_OVERLAY="/home/msterret/src/portage-overlay" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dnow X apm arts avi berkdb bitmap-fonts cdr crypt cscope cups dvd encode esd foomaticdb gdbm gif gimpprint gnome gpm gtk gtk2 guile java jpeg libg++ libwww mad mikmod mmx mozilla moznocompose moznoirc moznomail mpeg nas ncurses noreiserfs oggvorbis opengl oss pam pcre pdflib perl png ppds python quicktime readline sdl spell sse ssl tcpd tiff truetype userlocales x86 xml2 xmms xv zlib"
Personally I would rather see shopt -s extglob stay on. It makes some expressions easier to write in bash. This error could be avoided by specifying "function", for example: function g++() { echo foo; }
Added "shopt -u extglob" to ebuild.sh for the time being. I'll let others more knowledgable on the bash side add any others.
Real question here is... why is portage's bash invocation loading bash_completion? That's no good. bash_completion should be loaded from /etc/bash/bashrc, probably using something similar to /etc/profile.d
Fixed on or before 2.0.51.22-r1
Looking through the batch of bugs, I'm not sure that some of these are actually fixed in stable. Others, the requirements have possibly changed after the initial fix was committed. If you think this bug has been closed incorrectly, please reopen or ask that it be reopened.