From 2.0.53: betelgeuse@aria ~ $ portageq envvar Traceback (most recent call last): File "/usr/bin/portageq", line 253, in ? main() File "/usr/bin/portageq", line 248, in main function(sys.argv[2:]) File "/usr/bin/portageq", line 197, in envvar print portage.settings[argv[0]] IndexError: list index out of range From 2.1_pre3-r1: betelgeuse@pena ~/bin $ portageq envvar Traceback (most recent call last): File "/usr/bin/portageq", line 282, in ? main() File "/usr/bin/portageq", line 277, in main function(sys.argv[2:]) File "/usr/bin/portageq", line 206, in envvar if (argv[0] == "-v"): IndexError: list index out of range Instead of failing portageq should give the user help instructions on how to use the program. Portage 2.1_pre3-r1 (default-linux/x86/2005.1, gcc-3.4.5, glibc-2.3.5-r3, 2.6.15-gentoo i686) ================================================================= System uname: 2.6.15-gentoo i686 Intel(R) Pentium(R) 4 CPU 2.40GHz Gentoo Base System version 1.12.0_pre13 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.4 [enabled] dev-lang/python: 2.4.2 sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1-r1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r3 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=pentium4 -pipe -mfpmath=sse -ffast-math -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=pentium4 -pipe -mfpmath=sse -ffast-math -fomit-frame-pointer" DISTDIR="/usr/src/distfiles" FEATURES="autoaddcvs autoconfig ccache collision-protect cvs distlocks fixpackages sandbox sfperms sign strict stricter verify-rdepend" GENTOO_MIRRORS=" http://trumpetti.atm.tut.fi/gentoo http://lame.lut.fi/linux/gentoo " LANG="en_US.utf8" LC_ALL="en_US.utf8" LINGUAS="fi" MAKEOPTS="-j2 " PKGDIR="/home/pkg/" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/mnt/checkouts/overlays/betelgeuse" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 aac acl acpi alsa apm arts audiofile avi bash-completion berkdb bitmap-fonts bluetooth bzip2 bzlib cdb cddb cdparanoia cdr crypt cups curl dbus divx4linux dts dvd dvdr dvdread emboss esd exif expat fam ffmpeg firefox foomaticdb freetype gif glut gmp gstreamer gtk2 hal idn imagemagick java jpeg kde kdeenablefinal lcms libg++ libwww logitech-mouse mad makecheck mikmod mjpeg mmx mmx2 mng mp3 mpeg ncurses network nptl nptlonly nsplugin nvidia offensive ogg oggvorbis opengl pam pcre pdflib png qt quicktime readline real rtc ruby samba spell sqlite sse sse2 ssl subversion svg symlink tcpd theora tiff truetype truetype-fonts type1-fonts udev unicode usb userlocales vorbis win32codecs xine xml xml2 xv xvid zlib elibc_glibc kernel_linux linguas_fi userland_GNU video_cards_nvidia" Unset: ASFLAGS, CTARGET, LDFLAGS
Not sure that it should print anything if no argv How about --- /usr/bin/portageq.orig 2006-01-07 17:01:40.000000000 +0000 +++ /usr/bin/portageq 2006-01-07 17:01:50.000000000 +0000 @@ -194,7 +194,8 @@ Returns a specific environment variable as exists prior to ebuild.sh. Similar to: emerge --verbose --info | egrep '^<variable>=' """ - print portage.settings[argv[0]] + if len(argv): + print portage.settings[argv[0]] #-----------------------------------------------------------------------------
or + if len(argv): + print portage.settings[argv[0]] + else: + print envvar.__doc__
insvn. pukes if no arg is supplied
Released in 2.1_pre4.