From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/targets/
Date: Thu, 26 Feb 2015 20:12:43 +0000 (UTC) [thread overview]
Message-ID: <1424939577.d4408f858c4c3eb71ef0efdef5f23ebf6526dd87.dolsen@gentoo> (raw)
Message-ID: <20150226201243.RuZcCbV-dBDbbpHr2kZ-MF4TbpE3eUbbgZlD6NvPBms@z> (raw)
commit: d4408f858c4c3eb71ef0efdef5f23ebf6526dd87
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 1 06:28:19 2013 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Feb 26 08:32:57 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=d4408f85
Fix some paths/normpath usage
Use pjoin to join paths.
Use os.path.dirname() instead of splitting and rejoining without the filename.
Don't remove the trailing slash from the seedcache path in set_source_path(),
fix supplied by GMsoft. Rebase it into this original commit that broke it.
---
catalyst/base/stagebase.py | 21 ++++++++++-----------
catalyst/targets/livecd_stage2.py | 2 +-
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index f3cb3e3..edb6032 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -306,7 +306,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
if "pkgcache_path" in self.settings:
if type(self.settings["pkgcache_path"])!=types.StringType:
self.settings["pkgcache_path"]=\
- normpath(string.join(self.settings["pkgcache_path"]))
+ normpath(self.settings["pkgcache_path"])
else:
self.settings["pkgcache_path"]=\
normpath(self.settings["storedir"]+"/packages/"+\
@@ -316,7 +316,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
if "kerncache_path" in self.settings:
if type(self.settings["kerncache_path"])!=types.StringType:
self.settings["kerncache_path"]=\
- normpath(string.join(self.settings["kerncache_path"]))
+ normpath(self.settings["kerncache_path"])
else:
self.settings["kerncache_path"]=normpath(self.settings["storedir"]+\
"/kerncache/"+self.settings["target_subpath"]+"/")
@@ -339,7 +339,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
# +self.settings["target_path"],env=self.env)
self.resume.enable("setup_target_path")
- ensure_dirs(self.settings["storedir"] + "/builds/")
+ ensure_dirs(self.settings["storedir"] + "/builds")
def set_fsscript(self):
if self.settings["spec_prefix"]+"/fsscript" in self.settings:
@@ -403,8 +403,8 @@ class StageBase(TargetBase, ClearBase, GenBase):
if "seedcache" in self.settings["options"]\
and os.path.isdir(normpath(self.settings["storedir"]+"/tmp/"+\
self.settings["source_subpath"]+"/")):
- 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"] + "/")
else:
self.settings["source_path"]=normpath(self.settings["storedir"]+\
"/builds/"+self.settings["source_subpath"]+".tar.bz2")
@@ -461,8 +461,8 @@ class StageBase(TargetBase, ClearBase, GenBase):
def set_snapcache_path(self):
if "snapcache" in self.settings["options"]:
self.settings["snapshot_cache_path"] = \
- normpath(self.settings["snapshot_cache"] + "/" +
- self.settings["snapshot"])
+ normpath(pjoin(self.settings["snapshot_cache"],
+ self.settings["snapshot"]))
self.snapcache_lock=\
LockDir(self.settings["snapshot_cache_path"])
print "Caching snapshot to "+self.settings["snapshot_cache_path"]
@@ -824,7 +824,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
unpack_errmsg="Error unpacking snapshot"
if "autoresume" in self.settings["options"] \
- and os.path.exists(self.settings["chroot_path"]+\
+ and os.path.exists(self.settings["chroot_path"] +
self.settings["portdir"]) \
and self.resume.is_enabled("unpack_portage") \
and self.settings["snapshot_path_hash"] == snapshot_hash:
@@ -1235,10 +1235,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
and self.resume.is_enabled("capture"):
print "Resume point detected, skipping capture operation..."
else:
- """ Capture target in a tarball """
- mypath=self.settings["target_path"].split("/")
+ print """ Capture target in a tarball """
""" Remove filename from path """
- mypath=string.join(mypath[:-1],"/")
+ mypath = os.path.dirname(self.settings["target_path"])
""" Now make sure path exists """
ensure_dirs(mypath)
diff --git a/catalyst/targets/livecd_stage2.py b/catalyst/targets/livecd_stage2.py
index 973a734..78bed82 100644
--- a/catalyst/targets/livecd_stage2.py
+++ b/catalyst/targets/livecd_stage2.py
@@ -43,7 +43,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.",
next reply other threads:[~2015-02-26 20:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-26 19:25 Brian Dolbec [this message]
2015-02-26 20:12 ` [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/targets/ Brian Dolbec
-- strict thread matches above, loose matches on Subject: below --
2015-11-20 21:26 Brian Dolbec
2015-11-21 1:33 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-09-06 21:18 Brian Dolbec
2015-09-04 15:20 Brian Dolbec
2015-02-26 20:44 Brian Dolbec
2015-02-26 19:25 Brian Dolbec
2015-02-26 19:25 Brian Dolbec
2014-09-11 3:08 Brian Dolbec
2014-09-02 23:10 Brian Dolbec
2014-09-02 7:12 Brian Dolbec
2014-09-02 5:54 Brian Dolbec
2014-09-02 2:43 Brian Dolbec
2014-06-15 14:56 Brian Dolbec
2014-06-14 5:58 Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1424939577.d4408f858c4c3eb71ef0efdef5f23ebf6526dd87.dolsen@gentoo \
--to=dolsen@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox