initial commit
[ebuildfind.git] / commands / lib / layman / overlays / darcs.py
blob0d27d5ecad4da9ed0cfa3d2864cfe626aa84ab09
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 #################################################################################
4 # LAYMAN DARCS OVERLAY HANDLER
5 #################################################################################
6 # File: darcs.py
8 # Handles darcs overlays
10 # Copyright:
11 # (c) 2005 - 2008 Gunnar Wrobel, Andres Loeh
12 # Distributed under the terms of the GNU General Public License v2
14 # Author(s):
15 # Gunnar Wrobel <wrobel@gentoo.org>
16 # Andres Loeh <kosmikus@gentoo.org>
18 ''' Darcs overlay support.'''
20 __version__ = "$Id: darcs.py 236 2006-09-05 20:39:37Z wrobel $"
22 #===============================================================================
24 # Dependencies
26 #-------------------------------------------------------------------------------
28 from layman.utils import path
29 from layman.overlays.overlay import Overlay
31 #===============================================================================
33 # Class BzrOverlay
35 #-------------------------------------------------------------------------------
37 class DarcsOverlay(Overlay):
38 ''' Handles darcs overlays.'''
40 type = 'Darcs'
42 binary_command = '/usr/bin/darcs'
44 def add(self, base, quiet = False):
45 '''Add overlay.'''
47 self.supported()
49 return self.cmd(self.binary_command + ' get --partial "' + self.src +
50 '/" "' + path([base, self.name]) + '"')
52 def sync(self, base, quiet = False):
53 '''Sync overlay.'''
55 self.supported()
57 return self.cmd('cd "' + path([base, self.name]) + '" && ' +
58 self.binary_command + ' pull --all "' + self.src + '"')
60 def supported(self):
61 '''Overlay type supported?'''
63 return Overlay.supported(self, [(self.binary_command, 'darcs',
64 'dev-util/darcs'),])