Createrepo in rawhide now has parallel drpm creation, this patch should hopefully
enable it in mash (with 8 workers).
Note that it's missing a createrepo version check right now since there's not yet
been a released createrepo with the support.
kevin
---
configs/rawhide.mash | 1 +
mash/__init__.py | 6 +++++-
mash/config.py | 2 ++
mash/metadata.py | 5 +++--
4 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/configs/rawhide.mash b/configs/rawhide.mash
index 1deba24..69992c9 100644
--- a/configs/rawhide.mash
+++ b/configs/rawhide.mash
@@ -17,6 +17,7 @@ arches = i386 x86_64 armhfp
delta = True
max_delta_rpm_size = 800000000
max_delta_rpm_age = 604800
+delta_workers = 8
# Change distro_tags as fedora-release version gets bumped
distro_tags = cpe:/o:fedoraproject:fedora:21 rawhide
hash_packages = True
diff --git a/mash/__init__.py b/mash/__init__.py
index 8ced405..566b8c1 100644
--- a/mash/__init__.py
+++ b/mash/__init__.py
@@ -121,7 +121,11 @@ class Mash:
max_delta_rpm_age = self.config.max_delta_rpm_age
else:
max_delta_rpm_age = None # No age specified. Copy all.
- md.set_delta(paths, max_delta_rpm_size, max_delta_rpm_age)
+ if self.config.delta_workers:
+ delta_workers = self.config.delta_workers
+ else:
+ delta_workers = 1 # default to 1 worker
+ md.set_delta(paths, max_delta_rpm_size, max_delta_rpm_age,
delta_workers)
if previous:
md.set_previous(previous)
# Setup the distro tags
diff --git a/mash/config.py b/mash/config.py
index 1e9f140..e4e9b95 100644
--- a/mash/config.py
+++ b/mash/config.py
@@ -47,6 +47,7 @@ class MashConfig(config.BaseConfig):
repoviewtitle = config.Option('"Mash - %(arch)s"')
delta = config.BoolOption(False)
delta_dirs = config.ListOption()
+ delta_workers = config.Option(1)
max_delta_rpm_size = config.Option(300000000)
max_delta_rpm_age = config.Option()
make_ancient = config.BoolOption(False)
@@ -90,6 +91,7 @@ class MashDistroConfig(config.BaseConfig):
delta_dirs = config.Inherit(MashConfig.delta_dirs)
max_delta_rpm_size = config.Inherit(MashConfig.delta_dirs)
max_delta_rpm_age = config.Inherit(MashConfig.max_delta_rpm_age)
+ delta_workers = config.Inherit(MashConfig.delta_workers)
make_ancient = config.Inherit(MashConfig.make_ancient)
latest = config.Inherit(MashConfig.latest)
distro_tags = config.Inherit(MashConfig.distro_tags)
diff --git a/mash/metadata.py b/mash/metadata.py
index e20b1d6..50a67da 100644
--- a/mash/metadata.py
+++ b/mash/metadata.py
@@ -71,7 +71,7 @@ class MetadataOld:
if skip:
self.args.append('--skip-stat')
- def set_delta(self, deltapaths, max_delta_rpm_size, max_delta_rpm_age):
+ def set_delta(self, deltapaths, max_delta_rpm_size, max_delta_rpm_age,
delta_workers):
# Sorry, can't do that here.
pass
@@ -136,12 +136,13 @@ class MetadataNew:
def set_skipstat(self, skip):
self.conf.skip_stat = skip
- def set_delta(self, deltapaths, max_delta_rpm_size, max_delta_rpm_age):
+ def set_delta(self, deltapaths, max_delta_rpm_size, max_delta_rpm_age,
delta_workers):
if rpm.labelCompare([createrepo.__version__,'0','0'],
['0.9.7', '0', '0']) >= 0:
self.conf.deltas = True
self.conf.oldpackage_paths = deltapaths
self.conf.max_delta_rpm_size = max_delta_rpm_size
self.conf.max_delta_rpm_age = max_delta_rpm_age
+ self.conf.delta_workers = delta_workers
def set_previous(self, previous):
if rpm.labelCompare([createrepo.__version__,'0','0'],
['0.9.7', '0', '0']) >= 0:
--
2.0.0