This is for
https://fedorahosted.org/rel-eng/ticket/5362#comment:17
---
mash/__init__.py | 1 +
mash/config.py | 2 ++
mash/metadata.py | 7 +++++++
3 files changed, 10 insertions(+)
diff --git a/mash/__init__.py b/mash/__init__.py
index 997c0ce..61e2001 100644
--- a/mash/__init__.py
+++ b/mash/__init__.py
@@ -102,6 +102,7 @@ class Mash:
md.set_cachedir(repocache)
md.set_skipstat(gofast)
md.set_database(self.config.use_sqlite)
+ md.set_compress_type(self.config.compress_type)
md.set_hash(self.config.hash)
if comps and self.config.compsfile:
md.set_comps(self.config.compsfile)
diff --git a/mash/config.py b/mash/config.py
index 2b12034..3292359 100644
--- a/mash/config.py
+++ b/mash/config.py
@@ -40,6 +40,7 @@ class MashConfig(config.BaseConfig):
repodir = config.Option('/mnt/koji')
compsfile = config.Option()
use_sqlite = config.BoolOption(True)
+ compress_type = config.Option('xz')
use_repoview = config.BoolOption(False)
hash = config.Option('sha256')
repoviewurl = config.Option('http://localhost/%(arch)s')
@@ -79,6 +80,7 @@ class MashDistroConfig(config.BaseConfig):
cachedir = config.Inherit(MashConfig.cachedir)
compsfile = config.Inherit(MashConfig.compsfile)
use_sqlite = config.Inherit(MashConfig.use_sqlite)
+ compress_type = config.Inherit(MashConfig.compress_type)
hash = config.Inherit(MashConfig.hash)
use_repoview = config.Inherit(MashConfig.use_repoview)
repoviewurl = config.Inherit(MashConfig.repoviewurl)
diff --git a/mash/metadata.py b/mash/metadata.py
index 3158086..b3e33ed 100644
--- a/mash/metadata.py
+++ b/mash/metadata.py
@@ -59,6 +59,10 @@ class MetadataOld:
def set_database(self, db):
self.args.append('-d')
+ def set_compress_type(self, compress_type):
+ self.args.append('--compress-type')
+ self.args.append(compress_type
+
def set_hash(self, hashtype):
# Sorry, can't do that here.
pass
@@ -123,6 +127,9 @@ class MetadataNew:
def set_database(self, db):
self.conf.database = db
+ def set_compress_type(self, compress_type):
+ self.conf.compress_type = compress_type
+
def set_hash(self, hashtype):
self.conf.sumtype = hashtype
--
1.9.0