2 # -*- coding: utf-8 -*-
3 #################################################################################
4 # LAYMAN BZR OVERLAY HANDLER
5 #################################################################################
11 # (c) 2005 - 2008 Adrian Perez, Gunnar Wrobel
12 # Distributed under the terms of the GNU General Public License v2
15 # Adrian Perez <moebius@connectical.net>
16 # Gunnar Wrobel <wrobel@gentoo.org>
18 '''Should work with any version of Bzr equal to or better than 0.7 --
19 caution: tested only with 0.8 and 0.8.2...'''
21 __version__
= "$Id: bzr.py 236 2006-09-05 20:39:37Z wrobel $"
23 #===============================================================================
27 #-------------------------------------------------------------------------------
29 from layman
.utils
import path
30 from layman
.overlays
.overlay
import Overlay
32 #===============================================================================
36 #-------------------------------------------------------------------------------
38 class BzrOverlay(Overlay
):
39 ''' Handles bzr overlays.'''
43 binary_command
= '/usr/bin/bzr'
45 def add(self
, base
, quiet
= False):
50 return self
.cmd(self
.binary_command
+ ' get "' + self
.src
+ '/" "' +\
51 path([base
, self
.name
]) + '"')
53 def sync(self
, base
, quiet
= False):
58 return self
.cmd('cd "' + path([base
, self
.name
]) + '" && ' + \
59 self
.binary_command
+ ' pull --overwrite "' + self
.src \
63 '''Overlay type supported?'''
65 return Overlay
.supported(self
, [(self
.binary_command
, 'bzr',