aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--catalyst/base/stagebase.py23
-rw-r--r--catalyst/main.py8
-rw-r--r--doc/catalyst-config.5.txt9
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')
+ group.set_defaults(versioned_cachedir=False)
+
group = parser.add_argument_group('Target/config file management')
group.add_argument('-F', '--fetchonly',
diff --git a/doc/catalyst-config.5.txt b/doc/catalyst-config.5.txt
index 5c5ad293..957ab0e6 100644
--- a/doc/catalyst-config.5.txt
+++ b/doc/catalyst-config.5.txt
@@ -145,6 +145,10 @@ Cache the snapshot so that it can be bind-mounted into the chroot.
WARNING: moving parts of the portage tree from within fsscript *will*
break your cache. The cache is unlinked before any empty or rm
processing.
+
+versioned_cache::
+Name the cache directories (packagecache, kerncache) based on the version of a
+spec file.
--
Repository settings
@@ -240,9 +244,14 @@ sub-slots, you may experience errors like this due to untracked ABI
missmatches in binary packages. Packages generated by catalyst builds
are currently namespaced:
+If versioned_cache is set:
---------------------------------
.../packages/<rel_type>/<target>-<subarch>-<version_stamp>/Packages
---------------------------------
+Otherwise:
+---------------------------------
+.../packages/<rel_type>/<target>-<subarch>/Packages
+---------------------------------
so running into these out-of-date packages is unlikely. You may run
into problems if: