commit: d0fc244d633375faeaf4da81350c9818a1b291f0
Author: Robin H. Johnson gentoo org>
AuthorDate: Wed Dec 6 08:45:30 2017 +
Commit: Robin H. Johnson gentoo org>
CommitDate: Wed Dec 6 18:05:00 2017 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d0fc244d
Allow unversioned cache directories
The generation of cachedirs up to this point includes the version_stamp
from the specfile.
If the version is being automatically incremented (eg daily builds),
then it generates unique cache directories for each build, and doesn't
reuse old cache.
Example versioned cache directories:
/release/buildroot/amd64-dev/packages/default/stage1-amd64-20171203
/release/buildroot/amd64-dev/packages/default/stage1-amd64-20171204
/release/buildroot/amd64-dev/packages/default/stage1-amd64-20171206
This should be using a common cache directory:
/release/buildroot/amd64-dev/packages/default/stage1-amd64
Signed-off-by: Robin H. Johnson gentoo.org>
Signed-off-by: Brian Dolbec gentoo.org>
catalyst/base/stagebase.py | 23 ++-
catalyst/main.py | 8
doc/catalyst-config.5.txt | 9 +
3 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 7a41973c..a6a32f5a 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -318,9 +318,15 @@ class StageBase(TargetBase, ClearBase, GenBase):
self.settings["target_profile"] = self.settings["profile"]
def set_target_subpath(self):
- self.settings["target_subpath"] = self.settings["rel_type"] +
"/" + \
- self.settings["target"] + "-" +
self.settings["subarch"] + "-" + \
- self.settings["version_stamp"] + '/'
+ common = self.settings["rel_type"] + "/" + \
+ self.settings["target"] + "-" +
self.settings["subarch"]
+ self.settings["target_subpath"] = \
+ common + \
+ "-" + self.settings["version_stamp"] + \
+ "/"
+ self.settings["target_subpath_unversioned"] = \
+ common + \
+ "/"
def set_source_subpath(self):
if not isinstance(self.settings['source_subpath'], str):
@@ -333,19 +339,26 @@ class StageBase(TargetBase, ClearBase, GenBase):
if not isinstance(self.settings['pkgcache_path'], str):
self.settings["pkgcache_path"] = \
normpath(self.settings["pkgcache_path"])
- else:
+ elif "versioned_cache" in self.settings["options"]:
self.settings["pkgcache_path"] = \
normpath(self.settings["storedir"] +
"/packages/" + \
self.settings["target_subpath"] + "/")
+ else:
+ self.settings["pkgcache_path"] = \
+ normpath(self.settings["storedir"] +
"/packages/" + \
+ self.settings["target_subpath_unversioned"] +
"/")
def set_kerncache_path(self):
if "kerncache_path" in self.settings:
if not isinstance(self.settings['kerncache_path'], str):
self.settings["kerncache_path"] = \
normpath(self.settings["kerncache_path"])
- else:
+ elif "versioned_cache" in self.settings["options"]:
self.settings["kerncache_path"] =
normpath(self.settings["storedir"] + \
"/kerncache/" + self.settings["target_subpath"])
+ else:
+ self.settings["kerncache_path"] =
normpath(self.settings["storedir"] + \
+ "/kerncache/" +
self.settings["target_subpath_unversioned"])
def set_target_path(self):
self.settings["target_path"] =
normpath(self.settings["storedir"] + \
diff --git a/catalyst/main.py b/catalyst/main.py
index b8ae662d..3a428d3a 100644
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -190,6 +190,14 @@ $ catalyst -f stage1-specfile.spec"""
group.add_argument('-T', '--purgetmponly',
default=False, action='store_true',
help='clear tmp dirs and autoresume flags and exit')
+group.add_argument('--versioned-cachedir',
+dest='versioned_cachedir', action='store_true',
+help='use stage version on cache directory name')
+group.add_argument('--unversioned-cachedir',
+dest='versioned_cachedir', action='store_false',
+help='do not use stage version on cache directory name')
+