Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 492314 - sys-apps/portage-2.2.7: portageq envvar -v command does not properly escape quotes in an environment variable
Summary: sys-apps/portage-2.2.7: portageq envvar -v command does not properly escape q...
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
Keywords: InVCS
Depends on:
Blocks: 484436
  Show dependency tree
Reported: 2013-11-22 16:45 UTC by Thomas Deutschmann
Modified: 2014-01-06 00:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann gentoo-dev Security 2013-11-22 16:45:18 UTC

# emerge --info | grep _DEFAULT
EMERGE_DEFAULT_OPTS=" --quiet-build=y --verbose=n --with-bdeps=y --binpkg-respect-use=y --rebuilt-binaries=y --buildpkg-exclude 'virtual/* net-firewall/xtables-addons' --usepkg=y --jobs --load-average 30"

 # revdep-rebuild -h
/usr/bin/revdep-rebuild: line 1041: net-firewall/xtables-addons --usepkg=y --jobs --load-average 30: No such file or directory
revdep-rebuild: (


  ... --buildpkg-exclude \"virtual/* net-firewall/xtables-addons\" --usepkg=y ...

revdep-rebuild doesn't show the error message.

I am setting the severity to minor because AFAIK revdep-rebuild doesn't use EMERGE_DEFAULT_OPTS and works even with the error message.

Reproducible: Always
Comment 1 Paul Varner (RETIRED) gentoo-dev 2013-11-22 18:38:21 UTC
The bug is actually in the portageq command from portage.  Can you add the following to the bug before I reassign it?

emerge --info
portageq envvar -v EMERGE_DEFAULT_OPTS

For now, the workaround is to escape the quotes, since revdep-rebuild does use EMERGE_DEFAULT_OPTS
Comment 2 Thomas Deutschmann gentoo-dev Security 2013-11-22 19:14:44 UTC
# emerge --info
Portage 2.2.7 (default/linux/amd64/13.0, gcc-4.8.2, glibc-2.17, 3.10.20-gentoo x86_64)
System uname: Linux-3.10.20-gentoo-x86_64-AMD_Opteron-TM-_Processor_6272-with-gentoo-2.2
KiB Mem:    65910360 total,  64549600 free
KiB Swap:   25165820 total,  25165820 free
Timestamp of tree: Fri, 22 Nov 2013 14:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r4, 3.2.5-r3, 3.3.3
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.13.4, 1.14
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.8.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.10 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo foo-overlay
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-O2 -pipe -march=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rtm -mno-hle -mno-rdseed -mno-adx -mno-xsaveopt --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rtm -mno-hle -mno-rdseed -mno-adx -mno-xsaveopt --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic"
EMERGE_DEFAULT_OPTS=" --quiet-build=y --verbose=n --with-bdeps=y --binpkg-respect-use=y --rebuilt-binaries=y --buildpkg-exclude 'virtual/* net-firewall/xtables-addons' --usepkg=y --jobs --load-average 30"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg cgroup compress-index config-protect-if-modified distlocks downgrade-backup ebuild-locks fixlafiles lmirror merge-sync mirror parallel-fetch preserve-libs protect-owned sandbox sfperms split-elog split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="--jobs --load-average 30"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv idn ipv6 mmx modules mudflap multilib ncurses nls nptl openmp pam pcre readline session sse sse2 sse3 ssl tcpd unicode zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog cpu cpufreq disk dns ethstat network nginx ntpd ping uptime rrdcached filecount" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en de" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi gzip limit_conn limit_req map referer rewrite spdy proxy" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="mga" XTABLES_ADDONS="geoip"

(I cleared the GENTOO_MIRRORS value)

# portageq envvar -v EMERGE_DEFAULT_OPTS
EMERGE_DEFAULT_OPTS=' --quiet-build=y --verbose=n --with-bdeps=y --binpkg-respect-use=y --rebuilt-binaries=y --buildpkg-exclude 'virtual/* net-firewall/xtables-addons' --usepkg=y --jobs --load-average 30'
Comment 4 Paul Varner (RETIRED) gentoo-dev 2013-11-27 15:46:19 UTC
I tested the fix with portage-9999 and the fix looks good.
Comment 5 Thomas Deutschmann gentoo-dev Security 2013-11-27 16:07:18 UTC
I also tested portage-9999 and I can confirm that the error is gone. Thanks!
Comment 6 Thomas Deutschmann gentoo-dev Security 2013-11-27 16:20:31 UTC
Wait: revdep-rebuild doesn't show an error but the output is

 * All prepared. Starting rebuild
emerge --complete-graph=y --oneshot --quiet-build=n --verbose --buildpkg-exclude virtual/* net-firewall/xtables-addons --pretend dev-lang/lua:0 net-firewall/conntrack-tools:0 sys-devel/gcc:4.8 sys-devel/libtool:2 sys-libs/db:4.8

These are the packages that would be merged, in order:

I am missing the quotes around the "--buildpkg-exclude" value. Not sure if they are really required... at least I don't get an error message from emerge but I did not test if a binpkg would be build or if buildpkg-exclude is honored.
Comment 7 Paul Varner (RETIRED) gentoo-dev 2013-11-27 17:25:19 UTC
(In reply to Thomas D. from comment #6)

> I am missing the quotes around the "--buildpkg-exclude" value. Not sure if
> they are really required... at least I don't get an error message from
> emerge but I did not test if a binpkg would be build or if buildpkg-exclude
> is honored.

It is cosmetic, the emerge from revdep-rebuild works as intended and honors the buildpkg-exclude option as intended.
Comment 8 Brian Dolbec gentoo-dev 2014-01-06 00:43:08 UTC
Released in sys-apps/portage-2.2.8.