diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2010-01-13 02:38:44 +0100 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2010-01-13 02:47:29 +0100 |
commit | 2a14ba6689f6104601533d0677fb9211a35c96e0 (patch) | |
tree | c51921ddd2e0885a3d599de6665d48a2fa849ae7 /layman/overlays/cvs.py | |
parent | 82643d91c7814033626885285ee51ac06e66cbe9 (diff) | |
download | layman-2a14ba6689f6104601533d0677fb9211a35c96e0.tar.gz layman-2a14ba6689f6104601533d0677fb9211a35c96e0.tar.bz2 layman-2a14ba6689f6104601533d0677fb9211a35c96e0.zip |
Add support for multiple sources per overlay
Diffstat (limited to 'layman/overlays/cvs.py')
-rw-r--r-- | layman/overlays/cvs.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/layman/overlays/cvs.py b/layman/overlays/cvs.py index 7e26461..c949f0e 100644 --- a/layman/overlays/cvs.py +++ b/layman/overlays/cvs.py @@ -27,7 +27,6 @@ __version__ = "$Id$" import xml.etree.ElementTree as ET # Python 2.5 from layman.utils import path, ensure_unicode -from layman.overlays.overlay import Overlay from layman.overlays.source import OverlaySource #=============================================================================== @@ -42,9 +41,9 @@ class CvsOverlay(OverlaySource): type = 'cvs' type_key = 'cvs' - def __init__(self, xml, config, ignore = 0, quiet = False): + def __init__(self, parent, xml, config, _location, ignore = 0, quiet = False): - super(CvsOverlay, self).__init__(xml, config, ignore, quiet) + super(CvsOverlay, self).__init__(xml, parent, config, _location, ignore, quiet) _subpath = xml.find('subpath') if _subpath != None: @@ -63,13 +62,12 @@ class CvsOverlay(OverlaySource): return not self.__eq__(other) # overrider - def to_xml(self): - repo = super(CvsOverlay, self).to_xml() + def to_xml_hook(self, repo_elem): if self.subpath: _subpath = ET.Element('subpath') _subpath.text = self.subpath - repo.append(_subpath) - return repo + repo_elem.append(_subpath) + del _subpath def add(self, base, quiet = False): '''Add overlay.''' @@ -82,7 +80,7 @@ class CvsOverlay(OverlaySource): quiet_option = '' return self.cmd('cd "' + base + '" && CVSROOT="' + self.src + '" ' + - self.command() + quiet_option + ' co -d "' + self.name + self.command() + quiet_option + ' co -d "' + self.parent.name + '" "' + self.subpath + '"' ) def sync(self, base, quiet = False): @@ -95,7 +93,7 @@ class CvsOverlay(OverlaySource): else: quiet_option = '' - return self.cmd('cd "' + path([base, self.name]) + '" && ' + + return self.cmd('cd "' + path([base, self.parent.name]) + '" && ' + self.command() + quiet_option + ' update -d') def supported(self): |