Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 212169 - sudo/su emerge produces superfluous newlines w/ xterm/rxvt
Summary: sudo/su emerge produces superfluous newlines w/ xterm/rxvt
Status: RESOLVED CANTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: x86 Linux
: High trivial (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-03 10:33 UTC by Ted Tanberry
Modified: 2008-03-23 16:29 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 Ted Tanberry 2008-03-03 10:33:42 UTC
This seems to be a rather strange problem for which I haven't found any similar sort of symptoms. In X when opening an xterm and then running either 'sudo emerge something' or 'su -c emerge something' it always pastes multiple lines in the beginning and end. It ONLY happens in an xterm (rxvt though produces exactly the same results) and ONLY with emerge.

Reproducible: Always

Steps to Reproduce:
1. open an xterm or rxvt terminal
2. enter either "sudo emerge something" or "su -c emerge something"

Actual Results:  
soap@soaplaptop ~ $ sudo emerge example



Calculating dependencies \
emerge: there are no ebuilds to satisfy "example".

soap@soaplaptop ~ $ 
soap@soaplaptop ~ $ 
soap@soaplaptop ~ $ 
soap@soaplaptop ~ $ emerge example
emerge: superuser access is required.

soap@soaplaptop ~ $ su -c "emerge example"
Password: 



Calculating dependencies |
emerge: there are no ebuilds to satisfy "example".

soap@soaplaptop ~ $ 
soap@soaplaptop ~ $ 
soap@soaplaptop ~ $ 
soap@soaplaptop ~ $ 

{Please note, I have not pressed the return key multiple times, it inserts those extra lines by itself}

Expected Results:  
soap@soaplaptop ~ $ sudo emerge example
Calculating dependencies /
emerge: there are no ebuilds to satisfy "example".

soap@soaplaptop ~ $ emerge example
emerge: superuser access is required.

soap@soaplaptop ~ $ su -c "emerge example"
Password:
Calculating dependencies \
emerge: there are no ebuilds to satisfy "example".

soap@soaplaptop ~ $

Portage 2.1.4.4 (default-linux/x86/2007.0, gcc-4.2.3, glibc-2.7-r1, 2.6.24-gentoo-r3-Soap i686)
=================================================================
System uname: 2.6.24-gentoo-r3-Soap i686 Intel(R) Pentium(R) M processor 1.70GHz
Timestamp of tree: Fri, 29 Feb 2008 20:16:01 +0000
app-shells/bash:     3.2_p17-r1
dev-lang/python:     2.4.3-r4, 2.5.1-r5
dev-python/pycrypto: 2.0.1-r5
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.24
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium-m -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=pentium-m -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://gentoo.mirror.ac.za/"
LINGUAS="en_ZA en_GB de"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://gentoo.mirror.ac.za/gentoo-portage/"
USE="X a52 aac acpi alsa ao bash-completion bcmath bitmap-fonts boundschecking bzip2 cairo cardbus cddb cdparanoia cdr cli cracklib crypt css cups curl dbus dga dri dts dvd dvdr dvdread encode enscript exif expat ffmpeg fftw flac foomaticdb ftp gdbm gif gnutls gpm gsl gtk gtkhtml hal iconv ieee1394 imagemagick imap imlib jabber javascript jpeg jpeg2k lame latex lcms libwww lua lzo mad matroska midi mikmod mime mmap mmx mmxext modplug mp3 mpeg mplayer msn mudflap multiuser ncurses nls nntp nocd nptl nptlonly nsplugin offensive ogg openal opengl pam pcmcia pcre pdf perl png posix postgres ppds pppd python qt3 qt3support qt4 quicktime rdesktop readline reflection rss samba sdl snmp sockets speex spell sse sse2 ssl subversion svg symlink taglib tcpd tetex threads tiff timidity truetype truetype-fonts type1-fonts unicode usb vcd vorbis wifi win32codecs wmf x264 x86 xattr xcb xcomposite xml xmlrpc xorg xpm xrandr xscreensaver xsl xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_ZA en_GB de" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Andrew Gaffney (RETIRED) gentoo-dev 2008-03-03 12:16:16 UTC
I use 'sudo emerge' in rxvt-unicode all the time, and I've never seen this. Also, I'm not sure how this *could* be portage's fault. The newlines are on the shell prompt, which is before portage is invoked or after it's done running.
Comment 2 Ted Tanberry 2008-03-03 13:00:23 UTC
(In reply to comment #1)
> I use 'sudo emerge' in rxvt-unicode all the time, and I've never seen this.
> Also, I'm not sure how this *could* be portage's fault. The newlines are on the
> shell prompt, which is before portage is invoked or after it's done running.
> 

I filed it as an emerge bug mainly because it only seems to happen with emerge. Also interesting to note that it will not produce these superfluous lines in console, only in a X terminal emulator.
Comment 3 Marius Mauch (RETIRED) gentoo-dev 2008-03-03 14:37:54 UTC
What about running emerge without su/sudo (as normal user or in a root shell)? What about `su -l -c`?
Comment 4 Ted Tanberry 2008-03-03 16:12:11 UTC
(In reply to comment #3)
> What about running emerge without su/sudo (as normal user or in a root shell)?
> What about `su -l -c`?
> 

Same thing:
soap@soaplaptop ~ $ su -l -c "emerge example"
Password: 



Calculating dependencies \
emerge: there are no ebuilds to satisfy "example".

soap@soaplaptop ~ $ 
soap@soaplaptop ~ $ 
soap@soaplaptop ~ $ 
soap@soaplaptop ~ $ 


Yet, using emerge in a root shell (after having su'ed into it) or as normal user works fine, JUST when using su or sudo do I get these lines.
Comment 5 Zac Medico gentoo-dev 2008-03-03 17:17:47 UTC
What output do you get for these commands?

echo $TERM ; echo $PROMPT_COMMAND
su -c 'echo $TERM ; echo $PROMPT_COMMAND'
Comment 6 Ted Tanberry 2008-03-03 17:27:29 UTC
oap@soaplaptop ~ $ echo $TERM ; echo $PROMPT_COMMAND
xterm
echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"
soap@soaplaptop ~ $ su -c 'echo $TERM ; echo $PROMPT_COMMAND'
Password: 
xterm

soap@soaplaptop ~ $ sudo sh -c 'echo $TERM ; echo $PROMPT_COMMAND'
xterm


That's it.
Comment 7 Zac Medico gentoo-dev 2008-03-19 10:50:29 UTC
(In reply to comment #6)
> soap@soaplaptop ~ $ sudo sh -c 'echo $TERM ; echo $PROMPT_COMMAND'
> xterm
> 
> 
> That's it.
> 

Did you find out where the annoying PROMPT_COMMAND value was coming from?
Comment 8 Kenyon Ralph 2008-03-23 16:29:09 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > soap@soaplaptop ~ $ sudo sh -c 'echo $TERM ; echo $PROMPT_COMMAND'
> > xterm
> > 
> > 
> > That's it.
> 
> Did you find out where the annoying PROMPT_COMMAND value was coming from?

I'm also getting these extra newlines (seemingly) randomly and only when doing sudo emerge or su -c emerge. I don't think it's related to PROMPT_COMMAND because it still happens when PROMPT_COMMAND is unset. The newlines happen in xterm and konsole.

This only started happening fairly recently, like within the last couple weeks.