* [gentoo-commits] proj/catalyst:rewrite-on-master commit in: catalyst/base/, catalyst/targets/
@ 2013-11-22 7:13 Brian Dolbec
0 siblings, 0 replies; 3+ messages in thread
From: Brian Dolbec @ 2013-11-22 7:13 UTC (permalink / raw
To: gentoo-commits
commit: 1cba3b8ec73d458e53a65f0be7275f7585dc2186
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 1 07:31:59 2013 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Nov 22 06:01:49 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=1cba3b8e
Rename local unpack var to _unpack
The method name was unpack, so rename the local var to _unpack to help avoid confusion.
---
catalyst/base/stagebase.py | 18 +++++++++---------
catalyst/targets/livecd_stage2.py | 6 +++---
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 759afee..e2a98cf 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -657,7 +657,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
target, print_traceback=True)
def unpack(self):
- unpack=True
+ _unpack=True
clst_unpack_hash = self.resume.get("unpack")
@@ -707,49 +707,49 @@ class StageBase(TargetBase, ClearBase, GenBase):
if os.path.isdir(self.settings["source_path"]) \
and self.resume.is_enabled("unpack"):
""" Autoresume is valid, SEEDCACHE is valid """
- unpack=False
+ _unpack=False
invalid_snapshot=False
elif os.path.isfile(self.settings["source_path"]) \
and self.settings["source_path_hash"]==clst_unpack_hash:
""" Autoresume is valid, tarball is valid """
- unpack=False
+ _unpack=False
invalid_snapshot=True
elif os.path.isdir(self.settings["source_path"]) \
and self.resume.is_disabled("unpack"):
""" Autoresume is invalid, SEEDCACHE """
- unpack=True
+ _unpack=True
invalid_snapshot=False
elif os.path.isfile(self.settings["source_path"]) \
and self.settings["source_path_hash"]!=clst_unpack_hash:
""" Autoresume is invalid, tarball """
- unpack=True
+ _unpack=True
invalid_snapshot=True
else:
""" No autoresume, SEEDCACHE """
if "seedcache" in self.settings["options"]:
""" SEEDCACHE so let's run rsync and let it clean up """
if os.path.isdir(self.settings["source_path"]):
- unpack=True
+ _unpack=True
invalid_snapshot=False
elif os.path.isfile(self.settings["source_path"]):
""" Tarball so unpack and remove anything already there """
- unpack=True
+ _unpack=True
invalid_snapshot=True
""" No autoresume, no SEEDCACHE """
else:
""" Tarball so unpack and remove anything already there """
if os.path.isfile(self.settings["source_path"]):
- unpack=True
+ _unpack=True
invalid_snapshot=True
elif os.path.isdir(self.settings["source_path"]):
""" We should never reach this, so something is very wrong """
raise CatalystError(
"source path is a dir but seedcache is not enabled")
- if unpack:
+ if _unpack:
self.mount_safety_check()
if invalid_snapshot:
diff --git a/catalyst/targets/livecd_stage2.py b/catalyst/targets/livecd_stage2.py
index 7e24bca..82c69b0 100644
--- a/catalyst/targets/livecd_stage2.py
+++ b/catalyst/targets/livecd_stage2.py
@@ -87,7 +87,7 @@ class livecd_stage2(StageBase):
myf.close()
def unpack(self):
- unpack=True
+ _unpack=True
display_msg=None
clst_unpack_hash = self.resume.get("unpack")
@@ -103,12 +103,12 @@ class livecd_stage2(StageBase):
if os.path.isdir(self.settings["source_path"]) and \
self.resume.is_enabled("unpack"):
print "Resume point detected, skipping unpack operation..."
- unpack=False
+ _unpack=False
elif "source_path_hash" in self.settings:
if self.settings["source_path_hash"] != clst_unpack_hash:
invalid_snapshot=True
- if unpack:
+ if _unpack:
self.mount_safety_check()
if invalid_snapshot:
print "No Valid Resume point detected, cleaning up ..."
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/catalyst:rewrite-on-master commit in: catalyst/base/, catalyst/targets/
@ 2013-11-22 7:13 Brian Dolbec
0 siblings, 0 replies; 3+ messages in thread
From: Brian Dolbec @ 2013-11-22 7:13 UTC (permalink / raw
To: gentoo-commits
commit: 5b1c39c7943be54449785cfa24fc176f15af30fd
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 12 14:40:12 2013 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Nov 22 06:02:36 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=5b1c39c7
Fix livecd source and target paths not ending with a slash
---
catalyst/base/stagebase.py | 2 +-
catalyst/targets/livecd_stage1.py | 3 +--
catalyst/targets/livecd_stage2.py | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index e2a98cf..ba8cab6 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -285,7 +285,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
def set_target_subpath(self):
self.settings["target_subpath"]=self.settings["rel_type"]+"/"+\
self.settings["target"]+"-"+self.settings["subarch"]+"-"+\
- self.settings["version_stamp"]
+ self.settings["version_stamp"] +'/'
def set_source_subpath(self):
if type(self.settings["source_subpath"])!=types.StringType:
diff --git a/catalyst/targets/livecd_stage1.py b/catalyst/targets/livecd_stage1.py
index 55859bc..8402e7a 100644
--- a/catalyst/targets/livecd_stage1.py
+++ b/catalyst/targets/livecd_stage1.py
@@ -33,7 +33,7 @@ class livecd_stage1(StageBase):
"unbind", "clean","clear_autoresume"]
def set_target_path(self):
- self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"])
+ self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+'/')
if "autoresume" in self.settings["options"] \
and self.resume.is_enabled("setup_target_path"):
print "Resume point detected, skipping target path setup operation..."
@@ -43,7 +43,6 @@ class livecd_stage1(StageBase):
cmd("rm -rf "+self.settings["target_path"],\
"Could not remove existing directory: "+self.settings["target_path"],env=self.env)
self.resume.enable("setup_target_path")
-
ensure_dirs(self.settings["target_path"])
def set_spec_prefix(self):
diff --git a/catalyst/targets/livecd_stage2.py b/catalyst/targets/livecd_stage2.py
index 82c69b0..e8bee7d 100644
--- a/catalyst/targets/livecd_stage2.py
+++ b/catalyst/targets/livecd_stage2.py
@@ -44,7 +44,7 @@ class livecd_stage2(StageBase):
self.settings["hash_map"].generate_hash(
self.settings["source_path"])
else:
- self.settings["source_path"]=normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"])
+ self.settings["source_path"]=normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+'/')
if not os.path.exists(self.settings["source_path"]):
raise CatalystError("Source Path: " +
self.settings["source_path"] + " does not exist.",
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/catalyst:rewrite-on-master commit in: catalyst/base/, catalyst/targets/
@ 2013-11-22 7:13 Brian Dolbec
0 siblings, 0 replies; 3+ messages in thread
From: Brian Dolbec @ 2013-11-22 7:13 UTC (permalink / raw
To: gentoo-commits
commit: 135ca3a1453e038840c7af49b2e6085e24ff69fd
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 27 23:41:39 2013 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Nov 22 06:02:36 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=135ca3a1
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 ba8cab6..99f4015 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -314,7 +314,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 \
@@ -398,7 +398,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"]):
@@ -413,7 +413,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:
@@ -429,7 +429,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"]=\
@@ -440,7 +440,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 e8bee7d..5f6e86c 100644
--- a/catalyst/targets/livecd_stage2.py
+++ b/catalyst/targets/livecd_stage2.py
@@ -38,7 +38,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 c447fac..116871c 100644
--- a/catalyst/targets/stage2.py
+++ b/catalyst/targets/stage2.py
@@ -23,7 +23,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?
@@ -35,7 +35,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?
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-22 7:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-22 7:13 [gentoo-commits] proj/catalyst:rewrite-on-master commit in: catalyst/base/, catalyst/targets/ Brian Dolbec
-- strict thread matches above, loose matches on Subject: below --
2013-11-22 7:13 Brian Dolbec
2013-11-22 7:13 Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox