public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2014-06-14  5:58 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2014-06-14  5:58 UTC (permalink / raw
  To: gentoo-commits

commit:     4b44a58d52982c92aecd7a223ec3baf27988c4d8
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 12 04:06:01 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Jun 14 05:41:58 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=4b44a58d

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 | 52 ++++++++++++++++++++++++++--------------------
 catalyst/defaults.py       |  1 +
 2 files changed, 31 insertions(+), 22 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 173cc68..5cc6244 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)
@@ -1303,7 +1303,14 @@ class StageBase(TargetBase, ClearBase, GenBase):
 		fixed. We need this to use the os.system() call since we can't
 		specify our own environ
 		"""
-		for x in self.settings.keys():
+		#print "setup_environment(); settings =", list(self.settings)
+		for x in list(self.settings):
+			#print "setup_environment(); processing:", x
+			if x == "options":
+				#self.env['clst_' + x] = ' '.join(self.settings[x])
+				for opt in self.settings[x]:
+					self.env['clst_' + opt.upper()] = "true"
+				continue
 			""" Sanitize var names by doing "s|/-.|_|g" """
 			varname="clst_"+string.replace(x,"/","_")
 			varname=string.replace(varname,"-","_")
@@ -1317,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",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2014-06-14  5:58 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2014-06-14  5:58 UTC (permalink / raw
  To: gentoo-commits

commit:     78adef623a95a9adca03be204df15597052264df
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 22 08:39:18 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Jun 14 05:42:03 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=78adef62

rename a make.conf key to make_conf due to bash variable name restrictions

Conflicts:
	catalyst/base/stagebase.py
	catalyst/defaults.py

---
 catalyst/base/stagebase.py | 10 +++++-----
 catalyst/defaults.py       |  5 ++++-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 5cc6244..b67a32a 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1020,7 +1020,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 	def chroot_setup(self):
 		self.makeconf=read_makeconf(normpath(self.settings["chroot_path"]+
-			self.settings["make.conf"]))
+			self.settings["make_conf"]))
 		self.override_cbuild()
 		self.override_chost()
 		self.override_cflags()
@@ -1068,7 +1068,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			""" Modify and write out make.conf (for the chroot) """
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("rm -f " + makepath,\
 				"Could not remove " + makepath, env=self.env)
 			myf=open(makepath, "w")
@@ -1122,9 +1122,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			myf.close()
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("cp " + makepath + " " + makepath + ".catalyst",\
-				"Could not backup " + self.settings["make.conf"],env=self.env)
+				"Could not backup " + self.settings["make_conf"],env=self.env)
 			touch(self.settings["autoresume_path"]+"chroot_setup")
 
 	def fsscript(self):
@@ -1172,7 +1172,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			cmd("rm -rf " + self.settings["chroot_path"] + self.settings["local_overlay"],
 				"Could not remove " + self.settings["local_overlay"], env=self.env)
 			cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\
-				"/etc/portage/make.conf",\
+				self.settings["make_conf"],\
 				"Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
 
 		""" Clean up old and obsoleted files in /etc """

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 2b5eee4..7a9bb23 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -25,7 +25,8 @@ confdefaults={
 	"hash_function": "crc32",
 	"icecream": "/var/cache/icecream",
 	"local_overlay": "/usr/local/portage",
-	"options": "",
+	"make_conf": "/etc/portage/make.conf",
+	"options": set(),
 	"packagedir": "/usr/portage/packages",
 	"portdir": "/usr/portage",
 	"port_tmpdir": "/var/tmp/portage",
@@ -42,6 +43,8 @@ PORT_LOGDIR_CLEAN = \
 
 TARGET_MOUNT_DEFAULTS = {
 	"ccache": "/var/tmp/ccache",
+
+target_mounts = {
 	"dev": "/dev",
 	"devpts": "/dev/pts",
 	"distdir": "/usr/portage/distfiles",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2014-06-15 14:56 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2014-06-15 14:56 UTC (permalink / raw
  To: gentoo-commits

commit:     298fd82042b6e1afad7f39a9ceb0f623c1c37e6b
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 22 08:39:18 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Jun 15 14:05:53 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=298fd820

rename a make.conf key to make_conf due to bash variable name restrictions

Conflicts:
	catalyst/base/stagebase.py
	catalyst/defaults.py

---
 catalyst/base/stagebase.py | 10 +++++-----
 catalyst/defaults.py       |  5 ++++-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 6efa98e..99b667a 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1020,7 +1020,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 	def chroot_setup(self):
 		self.makeconf=read_makeconf(normpath(self.settings["chroot_path"]+
-			self.settings["make.conf"]))
+			self.settings["make_conf"]))
 		self.override_cbuild()
 		self.override_chost()
 		self.override_cflags()
@@ -1068,7 +1068,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			""" Modify and write out make.conf (for the chroot) """
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("rm -f " + makepath,\
 				"Could not remove " + makepath, env=self.env)
 			myf=open(makepath, "w")
@@ -1122,9 +1122,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			myf.close()
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("cp " + makepath + " " + makepath + ".catalyst",\
-				"Could not backup " + self.settings["make.conf"],env=self.env)
+				"Could not backup " + self.settings["make_conf"],env=self.env)
 			touch(self.settings["autoresume_path"]+"chroot_setup")
 
 	def fsscript(self):
@@ -1172,7 +1172,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			cmd("rm -rf " + self.settings["chroot_path"] + self.settings["local_overlay"],
 				"Could not remove " + self.settings["local_overlay"], env=self.env)
 			cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\
-				"/etc/portage/make.conf",\
+				self.settings["make_conf"],\
 				"Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
 
 		""" Clean up old and obsoleted files in /etc """

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 2b5eee4..7a9bb23 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -25,7 +25,8 @@ confdefaults={
 	"hash_function": "crc32",
 	"icecream": "/var/cache/icecream",
 	"local_overlay": "/usr/local/portage",
-	"options": "",
+	"make_conf": "/etc/portage/make.conf",
+	"options": set(),
 	"packagedir": "/usr/portage/packages",
 	"portdir": "/usr/portage",
 	"port_tmpdir": "/var/tmp/portage",
@@ -42,6 +43,8 @@ PORT_LOGDIR_CLEAN = \
 
 TARGET_MOUNT_DEFAULTS = {
 	"ccache": "/var/tmp/ccache",
+
+target_mounts = {
 	"dev": "/dev",
 	"devpts": "/dev/pts",
 	"distdir": "/usr/portage/distfiles",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2014-06-15 14:56 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2014-06-15 14:56 UTC (permalink / raw
  To: gentoo-commits

commit:     cd852d68bd0b17e51fce2b498993b4091adb402b
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 12 04:06:01 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Jun 15 14:05:53 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=cd852d68

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 | 52 ++++++++++++++++++++++++++--------------------
 catalyst/defaults.py       |  1 +
 2 files changed, 31 insertions(+), 22 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 5bedbb8..6efa98e 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)
@@ -1303,7 +1303,14 @@ class StageBase(TargetBase, ClearBase, GenBase):
 		fixed. We need this to use the os.system() call since we can't
 		specify our own environ
 		"""
-		for x in self.settings.keys():
+		#print "setup_environment(); settings =", list(self.settings)
+		for x in list(self.settings):
+			#print "setup_environment(); processing:", x
+			if x == "options":
+				#self.env['clst_' + x] = ' '.join(self.settings[x])
+				for opt in self.settings[x]:
+					self.env['clst_' + opt.upper()] = "true"
+				continue
 			""" Sanitize var names by doing "s|/-.|_|g" """
 			varname="clst_"+string.replace(x,"/","_")
 			varname=string.replace(varname,"-","_")
@@ -1317,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",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2014-09-02  2:43 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2014-09-02  2:43 UTC (permalink / raw
  To: gentoo-commits

commit:     facda74e8fc8c886692fb430f3e839b47503fd78
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 12 04:06:01 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Sep  2 02:13:44 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=facda74e

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 9cceb35..cb1929a 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",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2014-09-02  2:43 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2014-09-02  2:43 UTC (permalink / raw
  To: gentoo-commits

commit:     389c0059ad1d6fdb6e06a4f79d07843bb062aaac
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 22 08:39:18 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Sep  2 02:13:44 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=389c0059

rename a make.conf key to make_conf due to bash variable name restrictions

Conflicts:
	catalyst/base/stagebase.py
	catalyst/defaults.py

---
 catalyst/base/stagebase.py | 10 +++++-----
 catalyst/defaults.py       |  3 ++-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index cb1929a..5f85a73 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1020,7 +1020,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 	def chroot_setup(self):
 		self.makeconf=read_makeconf(normpath(self.settings["chroot_path"]+
-			self.settings["make.conf"]))
+			self.settings["make_conf"]))
 		self.override_cbuild()
 		self.override_chost()
 		self.override_cflags()
@@ -1068,7 +1068,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			""" Modify and write out make.conf (for the chroot) """
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("rm -f " + makepath,\
 				"Could not remove " + makepath, env=self.env)
 			myf=open(makepath, "w")
@@ -1122,9 +1122,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			myf.close()
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("cp " + makepath + " " + makepath + ".catalyst",\
-				"Could not backup " + self.settings["make.conf"],env=self.env)
+				"Could not backup " + self.settings["make_conf"],env=self.env)
 			touch(self.settings["autoresume_path"]+"chroot_setup")
 
 	def fsscript(self):
@@ -1172,7 +1172,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			cmd("rm -rf " + self.settings["chroot_path"] + self.settings["local_overlay"],
 				"Could not remove " + self.settings["local_overlay"], env=self.env)
 			cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\
-				"/etc/portage/make.conf",\
+				self.settings["make_conf"],\
 				"Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
 
 		""" Clean up old and obsoleted files in /etc """

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 2b5eee4..4d405ba 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -25,7 +25,8 @@ confdefaults={
 	"hash_function": "crc32",
 	"icecream": "/var/cache/icecream",
 	"local_overlay": "/usr/local/portage",
-	"options": "",
+	"make_conf": "/etc/portage/make.conf",
+	"options": set(),
 	"packagedir": "/usr/portage/packages",
 	"portdir": "/usr/portage",
 	"port_tmpdir": "/var/tmp/portage",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2014-09-02  5:54 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2014-09-02  5:54 UTC (permalink / raw
  To: gentoo-commits

commit:     413ab07fe72fa17eeed24de3e94ac29430319eca
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 12 04:06:01 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> 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",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2014-09-02  5:54 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2014-09-02  5:54 UTC (permalink / raw
  To: gentoo-commits

commit:     a48f92b37dbf43364b1dca7b6bf610cda2f3ba2b
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 22 08:39:18 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Sep  2 05:51:54 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=a48f92b3

rename a make.conf key to make_conf due to bash variable name restrictions

Conflicts:
	catalyst/base/stagebase.py
	catalyst/defaults.py

---
 catalyst/base/stagebase.py | 10 +++++-----
 catalyst/defaults.py       |  3 ++-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index b44a957..96b1c19 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1020,7 +1020,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 	def chroot_setup(self):
 		self.makeconf=read_makeconf(normpath(self.settings["chroot_path"]+
-			self.settings["make.conf"]))
+			self.settings["make_conf"]))
 		self.override_cbuild()
 		self.override_chost()
 		self.override_cflags()
@@ -1068,7 +1068,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			""" Modify and write out make.conf (for the chroot) """
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("rm -f " + makepath,\
 				"Could not remove " + makepath, env=self.env)
 			myf=open(makepath, "w")
@@ -1122,9 +1122,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			myf.close()
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("cp " + makepath + " " + makepath + ".catalyst",\
-				"Could not backup " + self.settings["make.conf"],env=self.env)
+				"Could not backup " + self.settings["make_conf"],env=self.env)
 			touch(self.settings["autoresume_path"]+"chroot_setup")
 
 	def fsscript(self):
@@ -1172,7 +1172,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			cmd("rm -rf " + self.settings["chroot_path"] + self.settings["local_overlay"],
 				"Could not remove " + self.settings["local_overlay"], env=self.env)
 			cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\
-				"/etc/portage/make.conf",\
+				self.settings["make_conf"],\
 				"Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
 
 		""" Clean up old and obsoleted files in /etc """

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 2b5eee4..4d405ba 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -25,7 +25,8 @@ confdefaults={
 	"hash_function": "crc32",
 	"icecream": "/var/cache/icecream",
 	"local_overlay": "/usr/local/portage",
-	"options": "",
+	"make_conf": "/etc/portage/make.conf",
+	"options": set(),
 	"packagedir": "/usr/portage/packages",
 	"portdir": "/usr/portage",
 	"port_tmpdir": "/var/tmp/portage",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2014-09-02  7:12 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2014-09-02  7:12 UTC (permalink / raw
  To: gentoo-commits

commit:     393261789b88cacc621487864f78d4ffbc30188e
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 12 04:06:01 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Sep  2 06:31:58 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=39326178

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 f6b2163..f59e688 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",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2014-09-02  7:12 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2014-09-02  7:12 UTC (permalink / raw
  To: gentoo-commits

commit:     ac036646c086b2ff616bc6ceac7cc0820ca255aa
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 22 08:39:18 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Sep  2 06:31:59 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=ac036646

rename a make.conf key to make_conf due to bash variable name restrictions

Conflicts:
	catalyst/base/stagebase.py
	catalyst/defaults.py

---
 catalyst/base/stagebase.py | 10 +++++-----
 catalyst/defaults.py       |  3 ++-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index b44a957..96b1c19 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1020,7 +1020,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 	def chroot_setup(self):
 		self.makeconf=read_makeconf(normpath(self.settings["chroot_path"]+
-			self.settings["make.conf"]))
+			self.settings["make_conf"]))
 		self.override_cbuild()
 		self.override_chost()
 		self.override_cflags()
@@ -1068,7 +1068,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			""" Modify and write out make.conf (for the chroot) """
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("rm -f " + makepath,\
 				"Could not remove " + makepath, env=self.env)
 			myf=open(makepath, "w")
@@ -1122,9 +1122,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			myf.close()
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("cp " + makepath + " " + makepath + ".catalyst",\
-				"Could not backup " + self.settings["make.conf"],env=self.env)
+				"Could not backup " + self.settings["make_conf"],env=self.env)
 			touch(self.settings["autoresume_path"]+"chroot_setup")
 
 	def fsscript(self):
@@ -1172,7 +1172,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			cmd("rm -rf " + self.settings["chroot_path"] + self.settings["local_overlay"],
 				"Could not remove " + self.settings["local_overlay"], env=self.env)
 			cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\
-				"/etc/portage/make.conf",\
+				self.settings["make_conf"],\
 				"Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
 
 		""" Clean up old and obsoleted files in /etc """

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index f59e688..2839a3d 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -25,7 +25,8 @@ confdefaults={
 	"hash_function": "crc32",
 	"icecream": "/var/cache/icecream",
 	"local_overlay": "/usr/local/portage",
-	"options": "",
+	"make_conf": "/etc/portage/make.conf",
+	"options": set(),
 	"packagedir": "/usr/portage/packages",
 	"portdir": "/usr/portage",
 	"port_tmpdir": "/var/tmp/portage",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2014-09-02 23:10 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2014-09-02 23:10 UTC (permalink / raw
  To: gentoo-commits

commit:     10a35d764c9957f89934dd377b5ac77eebd6b695
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 12 04:06:01 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Sep  2 23:08:02 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=10a35d76

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.

---
 catalyst/base/stagebase.py | 43 ++++++++++++++++++++++---------------------
 catalyst/defaults.py       |  2 ++
 2 files changed, 24 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 f6b2163..ce7e919 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -25,12 +25,14 @@ confdefaults={
 	"hash_function": "crc32",
 	"icecream": "/var/cache/icecream",
 	"local_overlay": "/usr/local/portage",
+	"make.conf": "/etc/portage/make.conf",
 	"options": "",
 	"packagedir": "/usr/portage/packages",
 	"portdir": "/usr/portage",
 	"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",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2014-09-02 23:10 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2014-09-02 23:10 UTC (permalink / raw
  To: gentoo-commits

commit:     9a7df9a18e2ea63c1b9d276b2b08c8d4742d3ba6
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 22 08:39:18 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Sep  2 23:08:02 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=9a7df9a1

Rename a make.conf key to make_conf due to bash variable name restrictions

---
 catalyst/base/stagebase.py | 10 +++++-----
 catalyst/defaults.py       |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index b44a957..96b1c19 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1020,7 +1020,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 	def chroot_setup(self):
 		self.makeconf=read_makeconf(normpath(self.settings["chroot_path"]+
-			self.settings["make.conf"]))
+			self.settings["make_conf"]))
 		self.override_cbuild()
 		self.override_chost()
 		self.override_cflags()
@@ -1068,7 +1068,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			""" Modify and write out make.conf (for the chroot) """
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("rm -f " + makepath,\
 				"Could not remove " + makepath, env=self.env)
 			myf=open(makepath, "w")
@@ -1122,9 +1122,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			myf.close()
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("cp " + makepath + " " + makepath + ".catalyst",\
-				"Could not backup " + self.settings["make.conf"],env=self.env)
+				"Could not backup " + self.settings["make_conf"],env=self.env)
 			touch(self.settings["autoresume_path"]+"chroot_setup")
 
 	def fsscript(self):
@@ -1172,7 +1172,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			cmd("rm -rf " + self.settings["chroot_path"] + self.settings["local_overlay"],
 				"Could not remove " + self.settings["local_overlay"], env=self.env)
 			cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\
-				"/etc/portage/make.conf",\
+				self.settings["make_conf"],\
 				"Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
 
 		""" Clean up old and obsoleted files in /etc """

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index ce7e919..2839a3d 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -25,8 +25,8 @@ confdefaults={
 	"hash_function": "crc32",
 	"icecream": "/var/cache/icecream",
 	"local_overlay": "/usr/local/portage",
-	"make.conf": "/etc/portage/make.conf",
-	"options": "",
+	"make_conf": "/etc/portage/make.conf",
+	"options": set(),
 	"packagedir": "/usr/portage/packages",
 	"portdir": "/usr/portage",
 	"port_tmpdir": "/var/tmp/portage",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2014-09-11  3:08 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2014-09-11  3:08 UTC (permalink / raw
  To: gentoo-commits

commit:     05f617069ce72ac6e7c48403b3b5f3728c1371fd
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 12 04:06:01 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Sep 11 03:05:38 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=05f61706

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.

---
 catalyst/base/stagebase.py | 43 ++++++++++++++++++++++---------------------
 catalyst/defaults.py       |  2 ++
 2 files changed, 24 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 f6b2163..ce7e919 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -25,12 +25,14 @@ confdefaults={
 	"hash_function": "crc32",
 	"icecream": "/var/cache/icecream",
 	"local_overlay": "/usr/local/portage",
+	"make.conf": "/etc/portage/make.conf",
 	"options": "",
 	"packagedir": "/usr/portage/packages",
 	"portdir": "/usr/portage",
 	"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",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2014-09-11  3:08 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2014-09-11  3:08 UTC (permalink / raw
  To: gentoo-commits

commit:     e3fdbaba8bde14978bcca2f5da3820378a67a772
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 22 08:39:18 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Sep 11 03:05:38 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=e3fdbaba

Rename a make.conf key to make_conf due to bash variable name restrictions

---
 catalyst/base/stagebase.py | 10 +++++-----
 catalyst/defaults.py       |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index b44a957..96b1c19 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1020,7 +1020,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 	def chroot_setup(self):
 		self.makeconf=read_makeconf(normpath(self.settings["chroot_path"]+
-			self.settings["make.conf"]))
+			self.settings["make_conf"]))
 		self.override_cbuild()
 		self.override_chost()
 		self.override_cflags()
@@ -1068,7 +1068,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			""" Modify and write out make.conf (for the chroot) """
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("rm -f " + makepath,\
 				"Could not remove " + makepath, env=self.env)
 			myf=open(makepath, "w")
@@ -1122,9 +1122,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			myf.close()
 			makepath = normpath(self.settings["chroot_path"] +
-				self.settings["make.conf"])
+				self.settings["make_conf"])
 			cmd("cp " + makepath + " " + makepath + ".catalyst",\
-				"Could not backup " + self.settings["make.conf"],env=self.env)
+				"Could not backup " + self.settings["make_conf"],env=self.env)
 			touch(self.settings["autoresume_path"]+"chroot_setup")
 
 	def fsscript(self):
@@ -1172,7 +1172,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			cmd("rm -rf " + self.settings["chroot_path"] + self.settings["local_overlay"],
 				"Could not remove " + self.settings["local_overlay"], env=self.env)
 			cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\
-				"/etc/portage/make.conf",\
+				self.settings["make_conf"],\
 				"Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
 
 		""" Clean up old and obsoleted files in /etc """

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index ce7e919..2839a3d 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -25,8 +25,8 @@ confdefaults={
 	"hash_function": "crc32",
 	"icecream": "/var/cache/icecream",
 	"local_overlay": "/usr/local/portage",
-	"make.conf": "/etc/portage/make.conf",
-	"options": "",
+	"make_conf": "/etc/portage/make.conf",
+	"options": set(),
 	"packagedir": "/usr/portage/packages",
 	"portdir": "/usr/portage",
 	"port_tmpdir": "/var/tmp/portage",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2015-01-01  5:59 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2015-01-01  5:59 UTC (permalink / raw
  To: gentoo-commits

commit:     e78b8bef22297f61a237aa4a7bfc4562b76064a7
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 12 04:06:01 2013 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Jan  1 05:58:06 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=e78b8bef

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.

---
 catalyst/base/stagebase.py | 43 ++++++++++++++++++++++---------------------
 catalyst/defaults.py       |  2 ++
 2 files changed, 24 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 f6b2163..ce7e919 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -25,12 +25,14 @@ confdefaults={
 	"hash_function": "crc32",
 	"icecream": "/var/cache/icecream",
 	"local_overlay": "/usr/local/portage",
+	"make.conf": "/etc/portage/make.conf",
 	"options": "",
 	"packagedir": "/usr/portage/packages",
 	"portdir": "/usr/portage",
 	"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",


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/
@ 2015-05-21 23:53 Brian Dolbec
  0 siblings, 0 replies; 16+ messages in thread
From: Brian Dolbec @ 2015-05-21 23:53 UTC (permalink / raw
  To: gentoo-commits

commit:     64cae407aa8e334a2b925fd5aab1f6a4d164a47a
Author:     Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  6 16:48:27 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Mar 28 02:28:16 2015 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=64cae407

Add --xattrs and --acls to the tar calls so we don't lose file properties while building the stages - should fix bug 531788.

Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo.org>

 catalyst/base/stagebase.py | 18 +++++++++---------
 catalyst/contents.py       |  6 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index c94f6b6..a33cae4 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -696,10 +696,10 @@ class StageBase(TargetBase, ClearBase, GenBase):
 					self.settings["chroot_path"]+\
 						" (This may take some time) ...\n"
 				if "bz2" == self.settings["chroot_path"][-3:]:
-					unpack_cmd="tar -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\
+					unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\
 						self.settings["chroot_path"]
 				else:
-					unpack_cmd="tar -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\
+					unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\
 						self.settings["chroot_path"]
 				error_msg="Tarball extraction of "+\
 					self.settings["source_path"]+" to "+\
@@ -711,10 +711,10 @@ class StageBase(TargetBase, ClearBase, GenBase):
 				self.settings["chroot_path"]+\
 				" (This may take some time) ...\n"
 			if "bz2" == self.settings["chroot_path"][-3:]:
-				unpack_cmd="tar -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\
+				unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\
 					self.settings["chroot_path"]
 			else:
-				unpack_cmd="tar -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\
+				unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\
 					self.settings["chroot_path"]
 			error_msg="Tarball extraction of "+self.settings["source_path"]+\
 				" to "+self.settings["chroot_path"]+" failed."
@@ -806,9 +806,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
 					"catalyst-hash")
 			destdir=self.settings["snapshot_cache_path"]
 			if "bz2" == self.settings["chroot_path"][-3:]:
-				unpack_cmd="tar -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+destdir
+				unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+destdir
 			else:
-				unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+destdir
+				unpack_cmd="tar --xattrs --acls xpf "+self.settings["snapshot_path"]+" -C "+destdir
 			unpack_errmsg="Error unpacking snapshot"
 			cleanup_msg="Cleaning up invalid snapshot cache at \n\t"+\
 				self.settings["snapshot_cache_path"]+\
@@ -825,10 +825,10 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			cleanup_msg=\
 				"Cleaning up existing portage tree (This can take a long time)..."
 			if "bz2" == self.settings["chroot_path"][-3:]:
-				unpack_cmd="tar -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+\
+				unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+\
 					self.settings["chroot_path"]+"/usr"
 			else:
-				unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+\
+				unpack_cmd="tar --xattrs --acls xpf "+self.settings["snapshot_path"]+" -C "+\
 					self.settings["chroot_path"]+"/usr"
 			unpack_errmsg="Error unpacking snapshot"
 
@@ -1248,7 +1248,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			print "Creating stage tarball..."
 
-			cmd("tar -I lbzip2 -cpf "+self.settings["target_path"]+" -C "+\
+			cmd("tar --xattrs --acls -I lbzip2 -cpf "+self.settings["target_path"]+" -C "+\
 				self.settings["stage_path"]+" .",\
 				"Couldn't create stage tarball",env=self.env)
 

diff --git a/catalyst/contents.py b/catalyst/contents.py
index 9611890..a06b2db 100644
--- a/catalyst/contents.py
+++ b/catalyst/contents.py
@@ -11,9 +11,9 @@ CONTENTS_DEFINITIONS = {
 	# 'find' is disabled because it requires the source path, which is not
 	# always available
 	#"find"		:["calc_contents","find %(path)s"],
-	"tar_tv":["calc_contents","tar tvf %(file)s"],
-	"tar_tvz":["calc_contents","tar tvzf %(file)s"],
-	"tar_tvj":["calc_contents","tar -I lbzip2 -tvf %(file)s"],
+	"tar_tv":["calc_contents","tar --xattrs tvf %(file)s"],
+	"tar_tvz":["calc_contents","tar --xattrs tvzf %(file)s"],
+	"tar_tvj":["calc_contents","tar --xattrs -I lbzip2 -tvf %(file)s"],
 	"isoinfo_l":["calc_contents","isoinfo -l -i %(file)s"],
 	# isoinfo_f should be a last resort only
 	"isoinfo_f":["calc_contents","isoinfo -f -i %(file)s"],


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-05-21 23:54 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-02  2:43 [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/base/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2015-05-21 23:53 Brian Dolbec
2015-01-01  5:59 Brian Dolbec
2014-09-11  3:08 Brian Dolbec
2014-09-11  3:08 Brian Dolbec
2014-09-02 23:10 Brian Dolbec
2014-09-02 23:10 Brian Dolbec
2014-09-02  7:12 Brian Dolbec
2014-09-02  7:12 Brian Dolbec
2014-09-02  5:54 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-15 14:56 Brian Dolbec
2014-06-14  5:58 Brian Dolbec
2014-06-14  5:58 Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox