2 # -*- coding: utf-8 -*-
3 #################################################################################
4 # LAYMAN CVS OVERLAY HANDLER
5 #################################################################################
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 ''' Cvs overlay support.'''
21 #===============================================================================
25 #-------------------------------------------------------------------------------
27 from layman
.utils
import path
28 from layman
.overlays
.overlay
import Overlay
30 #===============================================================================
34 #-------------------------------------------------------------------------------
36 class CvsOverlay(Overlay
):
37 ''' Handles cvs overlays.'''
41 binary
= '/usr/bin/cvs'
43 def __init__(self
, xml
, ignore
= 0, quiet
= False):
45 Overlay
.__init
__(self
, xml
, ignore
, quiet
)
47 if '&subpath' in self
.data
.keys():
48 self
.subpath
= self
.data
['&subpath']
52 def add(self
, base
, quiet
= False):
62 return self
.cmd('cd "' + base
+ '" && CVSROOT="' + self
.src
+ '" ' +
63 self
.binary
+ quiet_option
+ ' co -d "' + self
.name
64 + '" "' + self
.subpath
+ '"' )
66 def sync(self
, base
, quiet
= False):
76 return self
.cmd('cd "' + path([base
, self
.name
]) + '" && ' +
77 self
.binary
+ quiet_option
+ ' update')
80 '''Overlay type supported?'''
82 return Overlay
.supported(self
, [(self
.binary
, 'cvs',