2 # -*- coding: utf-8 -*-
3 #################################################################################
4 # LAYMAN RSYNC OVERLAY HANDLER
5 #################################################################################
8 # Handles rsync overlays
11 # (c) 2005 - 2008 Gunnar Wrobel
12 # Distributed under the terms of the GNU General Public License v2
15 # Gunnar Wrobel <wrobel@gentoo.org>
17 ''' Rsync overlay support.'''
19 __version__
= "$Id: rsync.py 236 2006-09-05 20:39:37Z wrobel $"
21 #===============================================================================
25 #-------------------------------------------------------------------------------
27 from layman
.utils
import path
28 from layman
.overlays
.overlay
import Overlay
30 #===============================================================================
34 #-------------------------------------------------------------------------------
36 class RsyncOverlay(Overlay
):
37 ''' Handles rsync overlays.'''
41 binary
= '/usr/bin/rsync'
43 base
= binary
+ ' -rlptDvz --progress --delete --delete-after ' + \
44 '--timeout=180 --exclude="distfiles/*" --exclude="local/*" ' + \
45 '--exclude="packages/*" '
47 def add(self
, base
, quiet
= False):
52 Overlay
.add(self
, base
)
54 return self
.sync(base
)
56 def sync(self
, base
, quiet
= False):
66 return self
.cmd(self
.base
+ quiet_option
+ '"' + self
.src
+ '/" "' +
67 path([base
, self
.name
]) + '"')
70 '''Overlay type supported?'''
72 return Overlay
.supported(self
, [(self
.binary
, 'rsync',