commit: 7c94f3f7e2dce6860e847c841cdcfc6f3d41f3db
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 27 23:41:39 2013 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Feb 26 20:00:56 2015 +0000
URL:
http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=7c94f3f7
Strip trailing slash from subpath's if they exist when creating filenames.
This bug was introduced in commit 52c9d37ff5de18981d6ecbe5bdde524b2bf4ebda when
a trailing slash was added to target_subpath.
---
catalyst/base/stagebase.py | 10 +++++-----
catalyst/targets/livecd_stage2.py | 2 +-
catalyst/targets/stage2.py | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index eec74df..7395351 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -323,7 +323,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
def set_target_path(self):
self.settings["target_path"]=normpath(self.settings["storedir"]+\
- "/builds/"+self.settings["target_subpath"]+".tar.bz2")
+
"/builds/"+self.settings["target_subpath"].rstrip('/')+".tar.bz2")
if "autoresume" in self.settings["options"]\
and self.resume.is_enabled("setup_target_path"):
print \
@@ -407,7 +407,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
"/tmp/" + self.settings["source_subpath"] + "/")
else:
self.settings["source_path"]=normpath(self.settings["storedir"]+\
-
"/builds/"+self.settings["source_subpath"]+".tar.bz2")
+
"/builds/"+self.settings["source_subpath"].rstrip('/')+".tar.bz2")
if os.path.isfile(self.settings["source_path"]):
# XXX: Is this even necessary if the previous
check passes?
if os.path.exists(self.settings["source_path"]):
@@ -422,7 +422,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
print "\tseedcache in the options of catalyst.conf the
source path"
print "\twill then be "+\
normpath(self.settings["storedir"]+"/builds/"+\
- self.settings["source_subpath"]+".tar.bz2\n")
+
self.settings["source_subpath"].rstrip('/')+".tar.bz2\n")
def set_dest_path(self):
if "root_path" in self.settings:
@@ -438,7 +438,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
def set_snapshot_path(self):
self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
"/snapshots/" + self.settings["snapshot_name"] +
- self.settings["snapshot"] + ".tar.xz")
+ self.settings["snapshot"].rstrip('/')+".tar.xz")
if os.path.exists(self.settings["snapshot_path"]):
self.settings["snapshot_path_hash"] = \
@@ -449,7 +449,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
else:
self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
"/snapshots/" + self.settings["snapshot_name"] +
- self.settings["snapshot"] + ".tar.bz2")
+
self.settings["snapshot"].rstrip('/')+".tar.bz2")
if os.path.exists(self.settings["snapshot_path"]):
self.settings["snapshot_path_hash"] = \
diff --git a/catalyst/targets/livecd_stage2.py
b/catalyst/targets/livecd_stage2.py
index 55e6897..9f0733e 100644
--- a/catalyst/targets/livecd_stage2.py
+++ b/catalyst/targets/livecd_stage2.py
@@ -37,7 +37,7 @@ class livecd_stage2(StageBase):
file_locate(self.settings, ["cdtar","controller_file"])
def set_source_path(self):
-
self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2")
+
self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"].rstrip('/')+".tar.bz2")
if os.path.isfile(self.settings["source_path"]):
self.settings["source_path_hash"] = \
self.settings["hash_map"].generate_hash(
diff --git a/catalyst/targets/stage2.py b/catalyst/targets/stage2.py
index 884b20d..e54b5c9 100644
--- a/catalyst/targets/stage2.py
+++ b/catalyst/targets/stage2.py
@@ -22,7 +22,7 @@ class stage2(StageBase):
if "seedcache" in self.settings["options"] and
os.path.isdir(normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")):
self.settings["source_path"]=normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")
else:
-
self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2")
+
self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"].rstrip('/')+".tar.bz2")
if os.path.isfile(self.settings["source_path"]):
if os.path.exists(self.settings["source_path"]):
# XXX: Is this even necessary if the previous
check passes?
@@ -34,7 +34,7 @@ class stage2(StageBase):
print "Source path set to "+self.settings["source_path"]
if os.path.isdir(self.settings["source_path"]):
print "\tIf this is not desired, remove this directory
or turn of seedcache in the options of catalyst.conf"
- print "\tthe source path will then be
"+normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2\n")
+ print "\tthe source path will then be
"+normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"].rstrip('/')+".tar.bz2\n")
# XXX: How do these override_foo() functions differ from the ones in
# StageBase and why aren't they in stage3_target?