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/tar.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/tar.py')
-rw-r--r-- | layman/overlays/tar.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/layman/overlays/tar.py b/layman/overlays/tar.py index 7853cb3..103c927 100644 --- a/layman/overlays/tar.py +++ b/layman/overlays/tar.py @@ -28,7 +28,6 @@ import os, os.path, sys, urllib2, shutil 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 #=============================================================================== @@ -66,9 +65,9 @@ class TarOverlay(OverlaySource): type = 'Tar' type_key = 'tar' - def __init__(self, xml, config, ignore = 0, quiet = False): + def __init__(self, parent, xml, config, _location, ignore = 0, quiet = False): - super(TarOverlay, self).__init__(xml, config, ignore) + super(TarOverlay, self).__init__(parent, xml, config, _location, ignore, quiet) _subpath = xml.find('subpath') if _subpath != None: @@ -87,20 +86,19 @@ class TarOverlay(OverlaySource): return not self.__eq__(other) # overrider - def to_xml(self): - repo = super(TarOverlay, 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.''' self.supported() - mdir = path([base, self.name]) + mdir = path([base, self.parent.name]) if os.path.exists(mdir): raise Exception('Directory ' + mdir + ' already exists. Will not ov' @@ -122,7 +120,7 @@ class TarOverlay(OverlaySource): raise Exception('Failed to fetch the tar package from: ' + self.src + '\nError was:' + str(error)) - pkg = path([base, self.name + ext]) + pkg = path([base, self.parent.name + ext]) try: |