From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6D2D9138ADA for ; Thu, 26 Feb 2015 20:12:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 07464E08B2; Thu, 26 Feb 2015 20:12:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 93D37E08B2 for ; Thu, 26 Feb 2015 20:12:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 290BA340C32 for ; Thu, 26 Feb 2015 20:12:55 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 89BA2129E0 for ; Thu, 26 Feb 2015 20:12:43 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1424939577.d4408f858c4c3eb71ef0efdef5f23ebf6526dd87.dolsen@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/targets/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/stagebase.py catalyst/targets/livecd_stage2.py X-VCS-Directories: catalyst/targets/ catalyst/base/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: d4408f858c4c3eb71ef0efdef5f23ebf6526dd87 X-VCS-Branch: master Date: Thu, 26 Feb 2015 20:12:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8f61b4d1-18b6-4c21-9a4a-9595de971c71 X-Archives-Hash: a44fcbde41e43de4f68313cd7ee921e5 Message-ID: <20150226201243.RuZcCbV-dBDbbpHr2kZ-MF4TbpE3eUbbgZlD6NvPBms@z> commit: d4408f858c4c3eb71ef0efdef5f23ebf6526dd87 Author: Brian Dolbec gentoo org> AuthorDate: Sat Jun 1 06:28:19 2013 +0000 Commit: Brian Dolbec gentoo 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.",