Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 22520 - Portage rm /bin/* when emerge sync with a trailing space in the SYNC var
Summary: Portage rm /bin/* when emerge sync with a trailing space in the SYNC var
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High critical
Assignee: Nicholas Jones (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-09 17:15 UTC by Guy Martin (RETIRED)
Modified: 2011-10-30 22:19 UTC (History)
0 users

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 Guy Martin (RETIRED) gentoo-dev 2003-06-09 17:15:20 UTC
I have  a local rsync and I've set SYNC="rsync://gmsoft/gentoo-portage/ " 
The trailing space cause emerge sync to use /bin as PORTDIR instead of the right location. 
Btw emerge info still display the correct information. 
 
rsync is invocked with the --delete arg which destroy every files in the destdir which are not in 
the portage tree. 

Reproducible: Always
Steps to Reproduce:
1. set SYNC="rsync://some.rsync.srv/gentoo-portage/with/a/trailing/space/ " 
2. emerge sync 
3. ls /bin 
Actual Results:  
rm /bin/* 

Expected Results:  
A nice clean emerge sync as usual :) 

gmsoft root # emerge info 
Portage 2.0.48-r1 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r4) 
================================================================= 
System uname: 2.4.20 i686 AMD Athlon(tm) processor 
GENTOO_MIRRORS=" ftp://ftp.easynet.nl/mirror/gentoo/" 
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config 
/var/bind /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" 
PORTDIR="/usr/portage" 
DISTDIR="/usr/portage/distfiles" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/mnt/storage/public" 
PORTDIR_OVERLAY="/usr/local/portage/overlay-cross" 
USE="x86 oss 3dnow apm avi crypt cups encode gif jpeg libg++ mikmod mmx mpeg ncurses 
nls pdflib png quicktime spell truetype xml2 xmms xv zlib gdbm berkdb slang readline arts svga 
java guile X sdl gpm tcpd pam libwww ssl perl python esd imlib oggvorbis gtk qt kde motif 
opengl cdr aalib acpi directfb dvd ethereal fbcon gd -gnome gtk2 ipv6 mozilla samba tcltk tetex 
tiff usb xinerama" 
COMPILER="gcc3" 
CHOST="i686-pc-linux-gnu" 
CFLAGS="-march=athlon -O3 -pipe -fomit-frame-pointer -ffast-math -funroll-loops -fforce-addr 
-falign-functions=4" 
CXXFLAGS="-march=athlon -O3 -pipe -fomit-frame-pointer -ffast-math -funroll-loops 
-fforce-addr -falign-functions=4" 
ACCEPT_KEYWORDS="x86" 
MAKEOPTS="-j4" 
AUTOCLEAN="yes" 
SYNC="rsync://gmsoft/gentoo-portage/ " 
FEATURES="sandbox ccache distcc prelink"
Comment 1 Joel Miles 2003-06-09 19:19:14 UTC
Quick fix:
Line 1574 of /usr/bin/emerge needs to be changed from:

syncuri=portage.settings["SYNC"]

to:

syncuri=string.rstrip(portage.settings["SYNC"])
Comment 2 Nicholas Jones (RETIRED) gentoo-dev 2003-06-10 11:43:55 UTC
Ouch... That's a rough thing to notice the hard way...
Almost as bad as running the old helper scripts as root, outside of portage.
Comment 3 Nicholas Jones (RETIRED) gentoo-dev 2003-06-29 19:18:38 UTC
Fixed in cvs