diff options
author | Gunnar Wrobel <p@rdus.de> | 2007-09-11 05:53:25 +0000 |
---|---|---|
committer | Gunnar Wrobel <p@rdus.de> | 2007-09-11 05:53:25 +0000 |
commit | e4293652d5b2a80725e6f83843f91364e19ba199 (patch) | |
tree | 0c9aee330c4be51e249f1aa646a2603cd21635b5 /overlays/bzr.py | |
download | layman-e4293652d5b2a80725e6f83843f91364e19ba199.tar.gz layman-e4293652d5b2a80725e6f83843f91364e19ba199.tar.bz2 layman-e4293652d5b2a80725e6f83843f91364e19ba199.zip |
Import layman.
Diffstat (limited to 'overlays/bzr.py')
-rw-r--r-- | overlays/bzr.py | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/overlays/bzr.py b/overlays/bzr.py new file mode 100644 index 0000000..8e8bb47 --- /dev/null +++ b/overlays/bzr.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +################################################################################# +# LAYMAN BZR OVERLAY HANDLER +################################################################################# +# File: bzr.py +# +# Handles bzr overlays +# +# Copyright: +# (c) 2005 - 2006 Adrian Perez, Gunnar Wrobel +# Distributed under the terms of the GNU General Public License v2 +# +# Author(s): +# Adrian Perez <moebius@connectical.net> +# Gunnar Wrobel <wrobel@gentoo.org> +# +'''Should work with any version of Bzr equal to or better than 0.7 -- + caution: tested only with 0.8 and 0.8.2...''' + +__version__ = "$Id: bzr.py 236 2006-09-05 20:39:37Z wrobel $" + +#=============================================================================== +# +# Dependencies +# +#------------------------------------------------------------------------------- + +from layman.utils import path +from layman.overlays.overlay import Overlay + +#=============================================================================== +# +# Class BzrOverlay +# +#------------------------------------------------------------------------------- + +class BzrOverlay(Overlay): + ''' Handles bzr overlays.''' + + type = 'Bzr' + + binary_command = '/usr/bin/bzr' + + def add(self, base): + '''Add overlay.''' + + self.supported() + + return self.cmd(self.binary_command + ' get "' + self.src + '/" "' +\ + path([base, self.name]) + '"') + + def sync(self, base): + '''Sync overlay.''' + + self.supported() + + return self.cmd('cd "' + path([base, self.name]) + '" && ' + \ + self.binary_command + ' pull --overwrite "' + self.src \ + + '"') + + def supported(self): + '''Overlay type supported?''' + + return Overlay.supported(self, [(self.binary_command, 'bzr', + 'dev-util/bzr'),]) |