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 8673D13877A for ; Tue, 2 Sep 2014 05:55:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ACCBCE0CCD; Tue, 2 Sep 2014 05:54:56 +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 733E6E0CC4 for ; Tue, 2 Sep 2014 05:54:55 +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 D923733FE1D for ; Tue, 2 Sep 2014 05:54:52 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F2CD247ED for ; Tue, 2 Sep 2014 05:54:49 +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: <1409637114.413ab07fe72fa17eeed24de3e94ac29430319eca.dol-sen@gentoo> Subject: [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/stagebase.py catalyst/defaults.py X-VCS-Directories: catalyst/ catalyst/base/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 413ab07fe72fa17eeed24de3e94ac29430319eca X-VCS-Branch: pending Date: Tue, 2 Sep 2014 05:54:49 +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: c71a4853-15e8-465b-8dc7-9465c04fda8f X-Archives-Hash: d1f3dda2391d52a669dec613ba4f0e92 commit: 413ab07fe72fa17eeed24de3e94ac29430319eca Author: Brian Dolbec gentoo org> AuthorDate: Tue Feb 12 04:06:01 2013 +0000 Commit: Brian Dolbec gmail com> CommitDate: Tue Sep 2 05:51:54 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=413ab07f Break out more repeated (path1 + path2)'s... Just do it once and use the temp variable. Comment out some debug print's. Fix options conversion for export to bash. Conflicts: catalyst/base/stagebase.py --- catalyst/base/stagebase.py | 43 ++++++++++++++++++++++--------------------- catalyst/defaults.py | 1 + 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index bebb5dc..b44a957 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -631,11 +631,10 @@ class StageBase(TargetBase, ClearBase, GenBase): """ self.setup_environment() - if os.path.exists(self.settings["sharedir"]+\ - "/targets/support/kill-chroot-pids.sh"): - cmd("/bin/bash "+self.settings["sharedir"]+\ - "/targets/support/kill-chroot-pids.sh",\ - "kill-chroot-pids script failed.",env=self.env) + killcmd = normpath(self.settings["sharedir"] + + self.settings["shdir"] + "/support/kill-chroot-pids.sh") + if os.path.exists(killcmd): + cmd(killcmd, "kill-chroot-pids script failed.",env=self.env) def mount_safety_check(self): """ @@ -647,10 +646,10 @@ class StageBase(TargetBase, ClearBase, GenBase): if not os.path.exists(self.settings["chroot_path"]): return - print "self.mounts =", self.mounts + #print "self.mounts =", self.mounts for x in self.mounts: target = normpath(self.settings["chroot_path"] + self.target_mounts[x]) - print "mount_safety_check() x =", x, target + #print "mount_safety_check() x =", x, target if not os.path.exists(target): continue @@ -1020,8 +1019,8 @@ class StageBase(TargetBase, ClearBase, GenBase): "Couldn't umount one or more bind-mounts; aborting for safety." def chroot_setup(self): - self.makeconf=read_makeconf(self.settings["chroot_path"]+\ - "/etc/portage/make.conf") + self.makeconf=read_makeconf(normpath(self.settings["chroot_path"]+ + self.settings["make.conf"])) self.override_cbuild() self.override_chost() self.override_cflags() @@ -1035,8 +1034,6 @@ class StageBase(TargetBase, ClearBase, GenBase): else: print "Setting up chroot..." - #self.makeconf=read_makeconf(self.settings["chroot_path"]+"/etc/portage/make.conf") - cmd("cp /etc/resolv.conf " + self.settings["chroot_path"] + "/etc/", "Could not copy resolv.conf into place.",env=self.env) @@ -1070,10 +1067,11 @@ class StageBase(TargetBase, ClearBase, GenBase): "Could not copy /etc/hosts",env=self.env) """ Modify and write out make.conf (for the chroot) """ - cmd("rm -f "+self.settings["chroot_path"]+"/etc/portage/make.conf",\ - "Could not remove "+self.settings["chroot_path"]+\ - "/etc/portage/make.conf",env=self.env) - myf=open(self.settings["chroot_path"]+"/etc/portage/make.conf","w") + makepath = normpath(self.settings["chroot_path"] + + self.settings["make.conf"]) + cmd("rm -f " + makepath,\ + "Could not remove " + makepath, env=self.env) + myf=open(makepath, "w") myf.write("# These settings were set by the catalyst build script that automatically\n# built this stage.\n") myf.write("# Please consult /usr/share/portage/config/make.conf.example for a more\n# detailed example.\n") if "CFLAGS" in self.settings: @@ -1123,10 +1121,11 @@ class StageBase(TargetBase, ClearBase, GenBase): myf.write('PORTDIR_OVERLAY="/usr/local/portage"\n') myf.close() - cmd("cp "+self.settings["chroot_path"]+"/etc/portage/make.conf "+\ - self.settings["chroot_path"]+"/etc/portage/make.conf.catalyst",\ - "Could not backup /etc/portage/make.conf",env=self.env) - touch(chroot_setup_resume) + makepath = normpath(self.settings["chroot_path"] + + self.settings["make.conf"]) + cmd("cp " + makepath + " " + makepath + ".catalyst",\ + "Could not backup " + self.settings["make.conf"],env=self.env) + touch(self.settings["autoresume_path"]+"chroot_setup") def fsscript(self): fsscript_resume = pjoin(self.settings["autoresume_path"], "fsscript") @@ -1289,6 +1288,7 @@ class StageBase(TargetBase, ClearBase, GenBase): else: try: if os.path.exists(self.settings["controller_file"]): + print "run_local() starting controller script..." cmd(self.settings["controller_file"]+" run",\ "run script failed.",env=self.env) touch(run_local_resume) @@ -1324,11 +1324,12 @@ class StageBase(TargetBase, ClearBase, GenBase): self.env[varname]=string.join(self.settings[x]) elif type(self.settings[x])==types.BooleanType: if self.settings[x]: - self.env[varname]="true" + self.env[varname] = "true" else: - self.env[varname]="false" + self.env[varname] = "false" if "makeopts" in self.settings: self.env["MAKEOPTS"]=self.settings["makeopts"] + #print "setup_environment(); env =", self.env def run(self): self.chroot_lock.write_lock() diff --git a/catalyst/defaults.py b/catalyst/defaults.py index b36eff7..2b5eee4 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -31,6 +31,7 @@ confdefaults={ "port_tmpdir": "/var/tmp/portage", "repo_name": "portage", "sharedir": "/usr/lib/catalyst", + "shdir": "/usr/lib/catalyst/targets/", "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", "snapshot_name": "portage-", "storedir": "/var/tmp/catalyst",