Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 69690 - portage 2.0.51-r2 QA interceptors fail when combined with bash-completion
Summary: portage 2.0.51-r2 QA interceptors fail when combined with bash-completion
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: High normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2004-10-31 22:25 UTC by Mr. Bones. (RETIRED)
Modified: 2005-07-14 06:58 UTC (History)
1 user (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 Mr. Bones. (RETIRED) gentoo-dev 2004-10-31 22:25:42 UTC
/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"
Comment 1 Aron Griffis (RETIRED) gentoo-dev 2004-11-01 10:51:39 UTC
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; }
Comment 2 Jason Stubbs (RETIRED) gentoo-dev 2004-11-02 06:38:16 UTC
Added "shopt -u extglob" to ebuild.sh for the time being. I'll let others more knowledgable on the bash side add any others.
Comment 3 Aron Griffis (RETIRED) gentoo-dev 2005-01-12 09:07:08 UTC
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
Comment 4 Jason Stubbs (RETIRED) gentoo-dev 2005-07-14 05:48:09 UTC
Fixed on or before 2.0.51.22-r1 
Comment 5 Jason Stubbs (RETIRED) gentoo-dev 2005-07-14 06:58:47 UTC
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.