1 |
commit: 3460699c2306be5ecc3e40e73d3b4d5a1827cda8 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 27 23:41:39 2013 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Thu Nov 21 09:00:12 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=3460699c |
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 0105723..b0144f6 100644 |
20 |
--- a/catalyst/base/stagebase.py |
21 |
+++ b/catalyst/base/stagebase.py |
22 |
@@ -314,7 +314,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 |
@@ -398,7 +398,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 |
@@ -413,7 +413,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 |
@@ -429,7 +429,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 |
@@ -440,7 +440,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 8fc406b..4016f57 100644 |
70 |
--- a/catalyst/targets/livecd_stage2.py |
71 |
+++ b/catalyst/targets/livecd_stage2.py |
72 |
@@ -38,7 +38,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 c447fac..116871c 100644 |
84 |
--- a/catalyst/targets/stage2.py |
85 |
+++ b/catalyst/targets/stage2.py |
86 |
@@ -23,7 +23,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 |
@@ -35,7 +35,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? |