Gentoo Archives: gentoo-commits

From: Brian Dolbec <dolsen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/targets/, catalyst/base/
Date: Thu, 26 Feb 2015 22:18:48
Message-Id: 1424980856.7c94f3f7e2dce6860e847c841cdcfc6f3d41f3db.dolsen@gentoo
1 commit: 7c94f3f7e2dce6860e847c841cdcfc6f3d41f3db
2 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 27 23:41:39 2013 +0000
4 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 26 20:00:56 2015 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=7c94f3f7
7
8 Strip trailing slash from subpath's if they exist when creating filenames.
9
10 This bug was introduced in commit 52c9d37ff5de18981d6ecbe5bdde524b2bf4ebda when a trailing slash was added to target_subpath.
11
12 ---
13 catalyst/base/stagebase.py | 10 +++++-----
14 catalyst/targets/livecd_stage2.py | 2 +-
15 catalyst/targets/stage2.py | 4 ++--
16 3 files changed, 8 insertions(+), 8 deletions(-)
17
18 diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
19 index eec74df..7395351 100644
20 --- a/catalyst/base/stagebase.py
21 +++ b/catalyst/base/stagebase.py
22 @@ -323,7 +323,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
23
24 def set_target_path(self):
25 self.settings["target_path"]=normpath(self.settings["storedir"]+\
26 - "/builds/"+self.settings["target_subpath"]+".tar.bz2")
27 + "/builds/"+self.settings["target_subpath"].rstrip('/')+".tar.bz2")
28 if "autoresume" in self.settings["options"]\
29 and self.resume.is_enabled("setup_target_path"):
30 print \
31 @@ -407,7 +407,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
32 "/tmp/" + self.settings["source_subpath"] + "/")
33 else:
34 self.settings["source_path"]=normpath(self.settings["storedir"]+\
35 - "/builds/"+self.settings["source_subpath"]+".tar.bz2")
36 + "/builds/"+self.settings["source_subpath"].rstrip('/')+".tar.bz2")
37 if os.path.isfile(self.settings["source_path"]):
38 # XXX: Is this even necessary if the previous check passes?
39 if os.path.exists(self.settings["source_path"]):
40 @@ -422,7 +422,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
41 print "\tseedcache in the options of catalyst.conf the source path"
42 print "\twill then be "+\
43 normpath(self.settings["storedir"]+"/builds/"+\
44 - self.settings["source_subpath"]+".tar.bz2\n")
45 + self.settings["source_subpath"].rstrip('/')+".tar.bz2\n")
46
47 def set_dest_path(self):
48 if "root_path" in self.settings:
49 @@ -438,7 +438,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
50 def set_snapshot_path(self):
51 self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
52 "/snapshots/" + self.settings["snapshot_name"] +
53 - self.settings["snapshot"] + ".tar.xz")
54 + self.settings["snapshot"].rstrip('/')+".tar.xz")
55
56 if os.path.exists(self.settings["snapshot_path"]):
57 self.settings["snapshot_path_hash"] = \
58 @@ -449,7 +449,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
59 else:
60 self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
61 "/snapshots/" + self.settings["snapshot_name"] +
62 - self.settings["snapshot"] + ".tar.bz2")
63 + self.settings["snapshot"].rstrip('/')+".tar.bz2")
64
65 if os.path.exists(self.settings["snapshot_path"]):
66 self.settings["snapshot_path_hash"] = \
67
68 diff --git a/catalyst/targets/livecd_stage2.py b/catalyst/targets/livecd_stage2.py
69 index 55e6897..9f0733e 100644
70 --- a/catalyst/targets/livecd_stage2.py
71 +++ b/catalyst/targets/livecd_stage2.py
72 @@ -37,7 +37,7 @@ class livecd_stage2(StageBase):
73 file_locate(self.settings, ["cdtar","controller_file"])
74
75 def set_source_path(self):
76 - self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2")
77 + self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"].rstrip('/')+".tar.bz2")
78 if os.path.isfile(self.settings["source_path"]):
79 self.settings["source_path_hash"] = \
80 self.settings["hash_map"].generate_hash(
81
82 diff --git a/catalyst/targets/stage2.py b/catalyst/targets/stage2.py
83 index 884b20d..e54b5c9 100644
84 --- a/catalyst/targets/stage2.py
85 +++ b/catalyst/targets/stage2.py
86 @@ -22,7 +22,7 @@ class stage2(StageBase):
87 if "seedcache" in self.settings["options"] and os.path.isdir(normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")):
88 self.settings["source_path"]=normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")
89 else:
90 - self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2")
91 + self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"].rstrip('/')+".tar.bz2")
92 if os.path.isfile(self.settings["source_path"]):
93 if os.path.exists(self.settings["source_path"]):
94 # XXX: Is this even necessary if the previous check passes?
95 @@ -34,7 +34,7 @@ class stage2(StageBase):
96 print "Source path set to "+self.settings["source_path"]
97 if os.path.isdir(self.settings["source_path"]):
98 print "\tIf this is not desired, remove this directory or turn of seedcache in the options of catalyst.conf"
99 - print "\tthe source path will then be "+normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2\n")
100 + print "\tthe source path will then be "+normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"].rstrip('/')+".tar.bz2\n")
101
102 # XXX: How do these override_foo() functions differ from the ones in
103 # StageBase and why aren't they in stage3_target?