Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 52208 - emerge-webrsync to support --exclude-from rsync option (and some other fixes)
Summary: emerge-webrsync to support --exclude-from rsync option (and some other fixes)
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All All
: High enhancement
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2004-05-27 12:57 UTC by tklauser
Modified: 2007-12-14 00:34 UTC (History)
0 users

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


Attachments
Patch for emerge-webrsync (emerge-webrsync_tklauser.patch,3.35 KB, patch)
2004-05-27 12:59 UTC, tklauser
Details | Diff
New patch for emerge-wersync (emerge-webrsync_tklauser.patch,3.63 KB, patch)
2004-08-24 03:59 UTC, tklauser
Details | Diff
patch to quote variable contents properly (ewrsync-filter.diff,782 bytes, patch)
2007-12-08 17:10 UTC, Chris Kerr
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tklauser 2004-05-27 12:57:45 UTC
On my server (which of course runs Gentoo) it isn't possible to sync via 'emerge rsync' due to the firewall. So I have to use emerge-webrsync. But this tool didn't use the --exclude-from option of rsync. I use this feature a lot because on a server you don't need the whole x11 stuff etc.

So I added this feature to emerge-webrsync. I also fixed the option handling of the script, added absolute paths everywhere in the script (I think this is better for security, you never know) and added a check if there is already a snapshot present on the system (if you sync more than once a day, which you shouldn't ;)

I hope that this fix will be applied.

This also fixes Bug #44281 (incorrect output of date format)
Comment 1 tklauser 2004-05-27 12:59:05 UTC
Created attachment 32159 [details, diff]
Patch for emerge-webrsync
Comment 2 tklauser 2004-05-27 13:00:03 UTC
Forgot to add my emerge info:

Gentoo Base System version 1.4.10

Portage 2.0.50-r6 (default-x86-2004.0, gcc-3.3.2, glibc-2.3.2-r9, 2.6.5-gentoo-r1)
=================================================================
System uname: 2.6.5-gentoo-r1 i686 Intel(R) Pentium(R) III Mobile CPU      1066MHz
distcc 2.13 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distcc sandbox"
GENTOO_MIRRORS="ftp://mirror.switch.ch/mirror/gentoo/ ftp://ftp.solnet.ch/mirror/Gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acpi alsa apm arts avi berkdb crypt cups dvd encode foomaticdb gdbm gif gpm gtk gtk2 imagemagick imlib ipv6 jabber jpeg kde libg++ libwww linguas_de linguas_en mad mbox mikmod motif mpeg ncurses nls oggvorbis opengl oss pam pcmcia pdflib perl png pnp python qt quicktime readline sdl slang spell ssl svga tcpd truetype unicode x86 xml2 xmms xv xvid zlib"
Comment 3 tklauser 2004-08-24 03:59:12 UTC
Created attachment 38085 [details, diff]
New patch for emerge-wersync

I added a function to delete all snapshots except the fetched one. So you
always have only the most recent snapshot on your system.
Comment 4 Nicholas Jones (RETIRED) gentoo-dev 2004-10-09 21:38:29 UTC
Making your changes against 2.0.51_rc7 or later would be best.
Comment 5 tklauser 2004-11-06 08:26:05 UTC
Is there a way to get the value of RSYNC_EXCLUDEFROM out of /etc/make.conf without sourcing the make.conf file (as I do in the posted patch)? I don0t think thats the proper way, since the whole /etc/make.conf gets evaluated then (possible security risc).
Comment 6 Jason Stubbs (RETIRED) gentoo-dev 2005-07-28 07:25:21 UTC
Putting a hold on feature requests for portage as they are drowning out the 
bugs. Most of these features should be available in the next major version of 
portage. But for the time being, they are just drowning out the major bugs and 
delaying the next version's progress. 
 
Any bugs that contain patches and any bugs for etc-update or dispatch-conf can 
be reopened. Sorry, I'm just not good enough with bugzilla. ;) 
Comment 7 Marius Mauch (RETIRED) gentoo-dev 2007-01-11 13:09:11 UTC
Reopening for consideration.
Comment 8 Marius Mauch (RETIRED) gentoo-dev 2007-02-17 03:54:44 UTC
Added support for PORTAGE_RSYNC_EXTRA_OPTS to emerge-webrsync
Comment 9 Chris Kerr 2007-12-08 17:10:11 UTC
Created attachment 138032 [details, diff]
patch to quote variable contents properly

I wanted to use a full rsync --filter (as opposed to just an --exclude-from file) in PORTAGE_RSYNC_EXTRA_OPTS, but rsync filters contain whitespace (e.g. --filter="hide games-*") this broke emerge-webrsync because it does not handle the quoting properly.
I got this to work by using the eval function rather than calling rsync directly from the script. 
eval "rsync [...] ${PORTAGE_RSYNC_EXTRA_OPTS} . ${PORTDIR}"

If I have understood bash's variable expansion correctly (which is unlikely), the current emerge-webrsync will also break if there is a space in $PORTDIR - this patch will fix this problem too.
Comment 10 Zac Medico gentoo-dev 2007-12-08 19:20:35 UTC
(In reply to comment #9)
> Created an attachment (id=138032) [edit]
> patch to quote variable contents properly

I don't think there's any need to use eval. I will add quoting for PORTDIR, like "${PORTDIR%%/}". For PORTAGE_RSYNC_EXTRA_OPTS, you can quote parts of it yourself as necessary.  Portage uses python's shlex module to split PORTAGE_RSYNC_EXTRA_OPTS using posix compatible shell rules (essentially the same as bash). Either of the following should work for you (among other possibilities):

  PORTAGE_RSYNC_EXTRA_OPTS="--filter=\"hide games-*\""

  PORTAGE_RSYNC_EXTRA_OPTS="--filter='hide games-*'"
Comment 11 Zac Medico gentoo-dev 2007-12-14 00:34:13 UTC
(In reply to comment #8)
> Added support for PORTAGE_RSYNC_EXTRA_OPTS to emerge-webrsync

That was released in portage-2.1.3.