diff options
author | Alexander Sulfrian <asulfrian@zedat.fu-berlin.de> | 2022-01-17 17:36:28 +0100 |
---|---|---|
committer | Alexander Sulfrian <asulfrian@zedat.fu-berlin.de> | 2022-01-23 19:58:36 +0100 |
commit | ba1a18e060a8614b3dcb41b94a7ad37e89f1dfdf (patch) | |
tree | e37d730764210102637c006f2cab4dfed9592b91 /src/lib/Bcfg2/Server/Plugins/Packages/Pac.py | |
parent | 3ea270b7583bb13b1234680c4bde4ae03701a109 (diff) | |
parent | ef568d29698c00bf2c02c99a34b98e6b8ca96653 (diff) | |
download | bcfg2-ba1a18e060a8614b3dcb41b94a7ad37e89f1dfdf.tar.gz bcfg2-ba1a18e060a8614b3dcb41b94a7ad37e89f1dfdf.tar.bz2 bcfg2-ba1a18e060a8614b3dcb41b94a7ad37e89f1dfdf.zip |
Merge branch 'packages'
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Pac.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Packages/Pac.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Pac.py b/src/lib/Bcfg2/Server/Plugins/Packages/Pac.py index 6fc084cc4..e3432c934 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Pac.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Pac.py @@ -87,6 +87,9 @@ class PacSource(Source): #: PacSource sets the ``type`` on Package entries to "pacman" ptype = 'pacman' + #: The database of pacman repositories is compressed with "gzip" + default_compression = 'gzip' + def __init__(self, basepath, xsource): self.pacgroups = {} @@ -113,9 +116,10 @@ class PacSource(Source): if not self.rawurl: rv = [] for part in self.components: + filename = self.build_filename("%s.db.tar" % part) for arch in self.arches: - rv.append("%s%s/os/%s/%s.db.tar.gz" % - (self.url, part, arch, part)) + rv.append("%s%s/os/%s/%s" % + (self.url, part, arch, filename)) return rv else: raise Exception("PacSource : RAWUrl not supported (yet)") @@ -140,7 +144,8 @@ class PacSource(Source): bprov[barch] = {} try: self.debug_log("Packages: try to read %s" % fname) - tar = tarfile.open(fname, "r") + reader = self.open_file(fname) + tar = tarfile.open(fileobj=reader) except (IOError, tarfile.TarError): self.logger.error("Packages: Failed to read file %s" % fname) raise @@ -185,6 +190,7 @@ class PacSource(Source): self.pacgroups[group].append(pkgname) tar.close() + reader.close() self.process_files(bdeps, bprov, brecs) read_files.__doc__ = Source.read_files.__doc__ |