public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/
Date: Sat, 14 Jun 2014 05:58:10 +0000 (UTC)	[thread overview]
Message-ID: <1402720464.a7d29e75be4c4f742ec6287f6ac71b940b78e67a.dol-sen@gentoo> (raw)

commit:     a7d29e75be4c4f742ec6287f6ac71b940b78e67a
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 20 01:28:51 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Jun 14 04:34:24 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=a7d29e75

Some options cleanup, unifying their use, reducing redundancy.

Conflicts:
	catalyst/defaults.py
	catalyst/main.py
	catalyst/targets/generic_stage_target.py

---
 catalyst/defaults.py                     |  22 ++++-
 catalyst/main.py                         |  89 +++++----------------
 catalyst/targets/generic_stage_target.py | 133 +++++++++++++++++--------------
 catalyst/targets/grp_target.py           |   2 +-
 catalyst/targets/livecd_stage1_target.py |   2 +-
 catalyst/targets/livecd_stage2_target.py |   8 +-
 catalyst/targets/netboot2_target.py      |  10 +--
 catalyst/targets/snapshot_target.py      |   4 +-
 catalyst/targets/stage2_target.py        |   2 +-
 catalyst/targets/stage4_target.py        |   4 +-
 10 files changed, 129 insertions(+), 147 deletions(-)

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index b83e4f5..b36eff7 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -13,10 +13,9 @@ valid_build_targets = ["stage1_target", "stage2_target", "stage3_target",
 required_config_file_values = ["storedir", "sharedir", "distdir", "portdir"]
 
 valid_config_file_values = required_config_file_values[:]
-valid_config_file_values.extend(["PKGCACHE", "KERNCACHE", "CCACHE", "DISTCC",
-	"ICECREAM", "ENVSCRIPT", "AUTORESUME", "FETCH", "CLEAR_AUTORESUME",
-	"options", "DEBUG", "VERBOSE", "PURGE", "PURGEONLY", "SNAPCACHE",
-	"snapshot_cache", "hash_function", "digests", "contents", "SEEDCACHE"
+valid_config_file_values.extend([ "distcc", "envscript",
+	"options", "DEBUG", "VERBOSE",
+	"snapshot_cache", "hash_function", "digests", "contents"
 	])
 
 verbosity = 1
@@ -65,3 +64,18 @@ SOURCE_MOUNT_DEFAULTS = {
 	"shm": "shmfs",
 	}
 
+# legend:  key: message
+option_messages = {
+	"autoresume": "Autoresuming support enabled.",
+	"ccache": "Compiler cache support enabled.",
+	"clear-autoresume": "Cleaning autoresume flags support enabled.",
+	#"compress": "Compression enabled.",
+	"distcc": "Distcc support enabled.",
+	"icecream": "Icecream compiler cluster support enabled.",
+	"kerncache": "Kernel cache support enabled.",
+	"pkgcache": "Package cache support enabled.",
+	"purge": "Purge support enabled.",
+	"seedcache": "Seed cache support enabled.",
+	"snapcache": "Snapshot cache support enabled.",
+	#"tarball": "Tarball creation enabled.",
+	}

diff --git a/catalyst/main.py b/catalyst/main.py
index 5748d31..1ead9e8 100644
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -28,7 +28,6 @@ from hash_utils import HashMap, HASH_DEFINITIONS
 from contents import ContentsMap, CONTENTS_DEFINITIONS
 
 
-
 conf_values={}
 
 def usage():
@@ -106,7 +105,10 @@ def parse_config(myconfig):
 	for x in list(confdefaults):
 		if x in myconf:
 			print "Setting",x,"to config file value \""+myconf[x]+"\""
-			conf_values[x]=myconf[x]
+			if x == 'options':
+				conf_values[x] = set(myconf[x].split())
+			else:
+				conf_values[x]=myconf[x]
 		else:
 			print "Setting",x,"to default value \""+confdefaults[x]+"\""
 			conf_values[x]=confdefaults[x]
@@ -114,74 +116,23 @@ def parse_config(myconfig):
 	# add our python base directory to use for loading target arch's
 	conf_values["PythonDir"] = __selfpath__
 
-	# parse out the rest of the options from the config file
-	if "autoresume" in string.split(conf_values["options"]):
-		print "Autoresuming support enabled."
-		conf_values["AUTORESUME"]="1"
-
-	if "bindist" in string.split(conf_values["options"]):
-		print "Binary redistribution enabled"
-		conf_values["BINDIST"]="1"
-	else:
-		print "Bindist is not enabled in catalyst.conf"
-		print "Binary redistribution of generated stages/isos may be prohibited by law."
-		print "Please see the use description for bindist on any package you are including."
-
-	if "ccache" in string.split(conf_values["options"]):
-		print "Compiler cache support enabled."
-		conf_values["CCACHE"]="1"
-
-	if "clear-autoresume" in string.split(conf_values["options"]):
-		print "Cleaning autoresume flags support enabled."
-		conf_values["CLEAR_AUTORESUME"]="1"
-
-	if "distcc" in string.split(conf_values["options"]):
-		print "Distcc support enabled."
-		conf_values["DISTCC"]="1"
-
-	if "icecream" in string.split(conf_values["options"]):
-		print "Icecream compiler cluster support enabled."
-		conf_values["ICECREAM"]="1"
 
-	if "kerncache" in string.split(conf_values["options"]):
-		print "Kernel cache support enabled."
-		conf_values["KERNCACHE"]="1"
+	# print out any options messages
+	for opt in conf_values['options']:
+		if opt in option_messages:
+			print option_messages[opt]
 
-	if "pkgcache" in string.split(conf_values["options"]):
-		print "Package cache support enabled."
-		conf_values["PKGCACHE"]="1"
+	for key in ["digests", "envscript", "var_tmpfs_portage", "port_logdir"]:
+		if key in myconf:
+			conf_values[key] = myconf[key]
 
-	if "preserve_libs" in string.split(conf_values["options"]):
-		print "Preserving libs during unmerge."
-		conf_values["PRESERVE_LIBS"]="1"
-
-	if "purge" in string.split(conf_values["options"]):
-		print "Purge support enabled."
-		conf_values["PURGE"]="1"
-
-	if "seedcache" in string.split(conf_values["options"]):
-		print "Seed cache support enabled."
-		conf_values["SEEDCACHE"]="1"
-
-	if "snapcache" in string.split(conf_values["options"]):
-		print "Snapshot cache support enabled."
-		conf_values["SNAPCACHE"]="1"
-
-	if "digests" in myconf:
-		conf_values["digests"]=myconf["digests"]
 	if "contents" in myconf:
 		# replace '-' with '_' (for compatibility with existing configs)
 		conf_values["contents"] = myconf["contents"].replace("-", '_')
 
 	if "envscript" in myconf:
 		print "Envscript support enabled."
-		conf_values["ENVSCRIPT"]=myconf["envscript"]
 
-	if "var_tmpfs_portage" in myconf:
-		conf_values["var_tmpfs_portage"]=myconf["var_tmpfs_portage"];
-
-	if "port_logdir" in myconf:
-		conf_values["port_logdir"]=myconf["port_logdir"];
 
 def import_modules():
 	# import catalyst's own modules
@@ -272,6 +223,10 @@ def main():
 		usage()
 		sys.exit(2)
 
+	# initialize it if it's not already
+	if 'options' not in conf_values:
+		conf_values['options'] = set()
+
 	run = False
 	for o, a in opts:
 		if o in ("-h", "--help"):
@@ -283,8 +238,8 @@ def main():
 			sys.exit(1)
 
 		if o in ("-d", "--debug"):
-			conf_values["DEBUG"]="1"
-			conf_values["VERBOSE"]="1"
+			conf_values["DEBUG"] = True
+			conf_values["VERBOSE"] = True
 
 		if o in ("-c", "--config"):
 			myconfig=a
@@ -301,7 +256,7 @@ def main():
 			myspecfile=a
 
 		if o in ("-F", "--fetchonly"):
-			conf_values["FETCH"]="1"
+			conf_values['options'].add("fetch")
 
 		if o in ("-v", "--verbose"):
 			conf_values["VERBOSE"]="1"
@@ -317,16 +272,16 @@ def main():
 				mycmdline.append("version_stamp="+a)
 
 		if o in ("-p", "--purge"):
-			conf_values["PURGE"] = "1"
+			conf_values['options'].add("purge")
 
 		if o in ("-P", "--purgeonly"):
-			conf_values["PURGEONLY"] = "1"
+			conf_values['options'].add("purgeonly")
 
 		if o in ("-T", "--purgetmponly"):
-			conf_values["PURGETMPONLY"] = "1"
+			conf_values['options'].add("purgetmponly")
 
 		if o in ("-a", "--clear-autoresume"):
-			conf_values["CLEAR_AUTORESUME"] = "1"
+			conf_values['options'].add("clear-autoresume")
 
 	if not run:
 		print "!!! catalyst: please specify one of either -f or -C\n"

diff --git a/catalyst/targets/generic_stage_target.py b/catalyst/targets/generic_stage_target.py
index 1f26e65..516454b 100644
--- a/catalyst/targets/generic_stage_target.py
+++ b/catalyst/targets/generic_stage_target.py
@@ -207,21 +207,21 @@ class generic_stage_target(generic_target):
 		Configure any user specified options (either in catalyst.conf or on
 		the command line).
 		"""
-		if "PKGCACHE" in self.settings:
+		if "pkgcache" in self.settings["options"]:
 			self.set_pkgcache_path()
 			print "Location of the package cache is "+\
 				self.settings["pkgcache_path"]
 			self.mounts.append("packagedir")
 			self.mountmap["packagedir"] = self.settings["pkgcache_path"]
 
-		if "KERNCACHE" in self.settings:
+		if "kerncache" in self.settings["options"]:
 			self.set_kerncache_path()
 			print "Location of the kerncache is "+\
 				self.settings["kerncache_path"]
 			self.mounts.append("kerncache")
 			self.mountmap["kerncache"] = self.settings["kerncache_path"]
 
-		if "CCACHE" in self.settings:
+		if "ccache" in self.settings["options"]:
 			if "CCACHE_DIR" in os.environ:
 				ccdir=os.environ["CCACHE_DIR"]
 				del os.environ["CCACHE_DIR"]
@@ -236,7 +236,7 @@ class generic_stage_target(generic_target):
 			""" for the chroot: """
 			self.env["CCACHE_DIR"] = self.target_mounts["ccache"]
 
-		if "ICECREAM" in self.settings:
+		if "icecream" in self.settings["options"]:
 			self.mounts.append("icecream")
 			self.mountmap["icecream"] = self.settings["icecream"]
 			self.env["PATH"] = self.target_mounts["icecream"] + ":" + \
@@ -314,7 +314,7 @@ class generic_stage_target(generic_target):
 			"/builds/"+self.settings["target_subpath"]+".tar.bz2")
 		setup_target_path_resume = pjoin(self.settings["autoresume_path"],
 			"setup_target_path")
-		if "AUTORESUME" in self.settings and \
+		if "autoresume" in self.settings["options"]\
 				os.path.exists(setup_target_path_resume):
 			print \
 				"Resume point detected, skipping target path setup operation..."
@@ -391,7 +391,7 @@ class generic_stage_target(generic_target):
 				del self.settings[self.settings["spec_prefix"]+"/fsops"]
 
 	def set_source_path(self):
-		if "SEEDCACHE" in self.settings\
+		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"]+\
@@ -450,10 +450,10 @@ class generic_stage_target(generic_target):
 						verbose = False)
 
 	def set_snapcache_path(self):
-		if "SNAPCACHE" in self.settings:
+		if "snapcache" in self.settings["options"]:
 			self.settings["snapshot_cache_path"] = \
 				normpath(self.settings["snapshot_cache"] + "/" +
-					self.settings["snapshot"])
+					self.settings["snapshot"] + "/")
 			self.snapcache_lock=\
 				LockDir(self.settings["snapshot_cache_path"])
 			print "Caching snapshot to "+self.settings["snapshot_cache_path"]
@@ -474,7 +474,7 @@ class generic_stage_target(generic_target):
 			%(self.settings["target"], self.settings["subarch"],
 				self.settings["version_stamp"])
 			))
-		if "AUTORESUME" in self.settings:
+		if "autoresume" in self.settings["options"]:
 			print "The autoresume path is " + self.settings["autoresume_path"]
 		if not os.path.exists(self.settings["autoresume_path"]):
 			os.makedirs(self.settings["autoresume_path"],0755)
@@ -501,8 +501,8 @@ class generic_stage_target(generic_target):
 				"base_dirs","bind","chroot_setup","setup_environment",\
 				"run_local","preclean","unbind","clean"]
 #		if "TARBALL" in self.settings or \
-#			"FETCH" not in self.settings:
-		if "FETCH" not in self.settings:
+#			"fetch" not in self.settings["options"]:
+		if "fetch" not in self.settings["options"]:
 			self.settings["action_sequence"].append("capture")
 		self.settings["action_sequence"].append("clear_autoresume")
 
@@ -662,7 +662,7 @@ class generic_stage_target(generic_target):
 		unpack_resume = pjoin(self.settings["autoresume_path"], "unpack")
 		clst_unpack_hash=read_from_clst(unpack_resume)
 
-		if "SEEDCACHE" in self.settings:
+		if "seedcache" in self.settings["options"]:
 			if os.path.isdir(self.settings["source_path"]):
 				""" SEEDCACHE Is a directory, use rsync """
 				unpack_cmd="rsync -a --delete "+self.settings["source_path"]+\
@@ -704,7 +704,7 @@ class generic_stage_target(generic_target):
 			error_msg="Tarball extraction of "+self.settings["source_path"]+\
 				" to "+self.settings["chroot_path"]+" failed."
 
-		if "AUTORESUME" in self.settings:
+		if "autoresume" in self.settings["options"]:
 			if os.path.isdir(self.settings["source_path"]) \
 				and os.path.exists(unpack_resume):
 				""" Autoresume is valid, SEEDCACHE is valid """
@@ -730,7 +730,7 @@ class generic_stage_target(generic_target):
 				invalid_snapshot=True
 		else:
 			""" No autoresume, SEEDCACHE """
-			if "SEEDCACHE" in self.settings:
+			if "seedcache" in self.settings["options"]:
 				""" SEEDCACHE so let's run rsync and let it clean up """
 				if os.path.isdir(self.settings["source_path"]):
 					unpack=True
@@ -754,7 +754,7 @@ class generic_stage_target(generic_target):
 			self.mount_safety_check()
 
 			if invalid_snapshot:
-				if "AUTORESUME" in self.settings:
+				if "autoresume" in self.settings["options"]:
 					print "No Valid Resume point detected, cleaning up..."
 
 				self.clear_autoresume()
@@ -766,11 +766,11 @@ class generic_stage_target(generic_target):
 			if not os.path.exists(self.settings["chroot_path"]+"/tmp"):
 				os.makedirs(self.settings["chroot_path"]+"/tmp",1777)
 
-			if "PKGCACHE" in self.settings:
+			if "pkgcache" in self.settings["options"]:
 				if not os.path.exists(self.settings["pkgcache_path"]):
 					os.makedirs(self.settings["pkgcache_path"],0755)
 
-			if "KERNCACHE" in self.settings:
+			if "kerncache" in self.settings["options"]:
 				if not os.path.exists(self.settings["kerncache_path"]):
 					os.makedirs(self.settings["kerncache_path"],0755)
 
@@ -792,7 +792,7 @@ class generic_stage_target(generic_target):
 			"unpack_portage")
 		snapshot_hash=read_from_clst(unpack_portage_resume)
 
-		if "SNAPCACHE" in self.settings:
+		if "snapcache" in self.settings["options"]:
 			snapshot_cache_hash=\
 				read_from_clst(self.settings["snapshot_cache_path"] + "/" +
 					"catalyst-hash")
@@ -824,7 +824,7 @@ class generic_stage_target(generic_target):
 					self.settings["chroot_path"]+"/usr"
 			unpack_errmsg="Error unpacking snapshot"
 
-			if "AUTORESUME" in self.settings \
+			if "autoresume" in self.settings["options"] \
 				and os.path.exists(self.settings["chroot_path"]+\
 					self.settings["portdir"]) \
 				and os.path.exists(unpack_portage_resume) \
@@ -834,7 +834,7 @@ class generic_stage_target(generic_target):
 					unpack=False
 
 		if unpack:
-			if "SNAPCACHE" in self.settings:
+			if "snapcache" in self.settings["options"]:
 				self.snapshot_lock_object.write_lock()
 			if os.path.exists(destdir):
 				print cleanup_msg
@@ -846,7 +846,7 @@ class generic_stage_target(generic_target):
 			print "Unpacking portage tree (This can take a long time) ..."
 			cmd(unpack_cmd,unpack_errmsg,env=self.env)
 
-			if "SNAPCACHE" in self.settings:
+			if "snapcache" in self.settings["options"]:
 				myf=open(self.settings["snapshot_cache_path"] +
 					"/" + "catalyst-hash","w")
 				myf.write(self.settings["snapshot_path_hash"])
@@ -857,13 +857,13 @@ class generic_stage_target(generic_target):
 				myf.write(self.settings["snapshot_path_hash"])
 				myf.close()
 
-			if "SNAPCACHE" in self.settings:
+			if "snapcache" in self.settings["options"]:
 				self.snapshot_lock_object.unlock()
 
 	def config_profile_link(self):
 		config_protect_link_resume = pjoin(self.settings["autoresume_path"],
 			"config_profile_link")
-		if "AUTORESUME" in self.settings \
+		if "autoresume" in self.settings["options"] \
 			and os.path.exists(config_protect_link_resume):
 			print \
 				"Resume point detected, skipping config_profile_link operation..."
@@ -883,7 +883,7 @@ class generic_stage_target(generic_target):
 	def setup_confdir(self):
 		setup_confdir_resume = pjoin(self.settings["autoresume_path"],
 			"setup_confdir")
-		if "AUTORESUME" in self.settings \
+		if "autoresume" in self.settings["options"] \
 			and os.path.exists(setup_confdir_resume):
 			print "Resume point detected, skipping setup_confdir operation..."
 		else:
@@ -935,7 +935,7 @@ class generic_stage_target(generic_target):
 
 			src=self.mountmap[x]
 			#print "bind(); src =", src
-			if "SNAPCACHE" in self.settings and x == "portdir":
+			if "snapcache" in self.settings["options"] and x == "portdir":
 				self.snapshot_lock_object.read_lock()
 			if os.uname()[0] == "FreeBSD":
 				if src == "/dev":
@@ -989,7 +989,7 @@ class generic_stage_target(generic_target):
 					ouch=1
 					warn("Couldn't umount bind mount: " + target)
 
-			if "SNAPCACHE" in self.settings and x == "/usr/portage":
+			if "snapcache" in self.settings["options"] and x == "portdir":
 				try:
 					"""
 					It's possible the snapshot lock object isn't created yet.
@@ -1018,7 +1018,8 @@ class generic_stage_target(generic_target):
 		self.override_ldflags()
 		chroot_setup_resume = pjoin(self.settings["autoresume_path"],
 			"chroot_setup")
-		if "AUTORESUME" in self.settings and os.path.exists(chroot_setup_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(chroot_setup_resume):
 			print "Resume point detected, skipping chroot_setup operation..."
 		else:
 			print "Setting up chroot..."
@@ -1029,10 +1030,10 @@ class generic_stage_target(generic_target):
 				"Could not copy resolv.conf into place.",env=self.env)
 
 			""" Copy over the envscript, if applicable """
-			if "ENVSCRIPT" in self.settings:
-				if not os.path.exists(self.settings["ENVSCRIPT"]):
+			if "envscript" in self.settings:
+				if not os.path.exists(self.settings["envscript"]):
 					raise CatalystError,\
-						"Can't find envscript "+self.settings["ENVSCRIPT"]
+						"Can't find envscript "+self.settings["envscript"]
 
 				print "\nWarning!!!!"
 				print "\tOverriding certain env variables may cause catastrophic failure."
@@ -1042,7 +1043,7 @@ class generic_stage_target(generic_target):
 				print "\tCatalyst Maintainers use VERY minimal envscripts if used at all"
 				print "\tYou have been warned\n"
 
-				cmd("cp "+self.settings["ENVSCRIPT"]+" "+\
+				cmd("cp "+self.settings["envscript"]+" "+\
 					self.settings["chroot_path"]+"/tmp/envscript",\
 					"Could not copy envscript into place.",env=self.env)
 
@@ -1118,7 +1119,8 @@ class generic_stage_target(generic_target):
 
 	def fsscript(self):
 		fsscript_resume = pjoin(self.settings["autoresume_path"], "fsscript")
-		if "AUTORESUME" in self.settings and os.path.exists(fsscript_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(fsscript_resume):
 			print "Resume point detected, skipping fsscript operation..."
 		else:
 			if "fsscript" in self.settings:
@@ -1129,7 +1131,7 @@ class generic_stage_target(generic_target):
 
 	def rcupdate(self):
 		rcupdate_resume = pjoin(self.settings["autoresume_path"], "rcupdate")
-		if "AUTORESUME" in self.settings \
+		if "autoresume" in self.settings["options"] \
 			and os.path.exists(rcupdate_resume):
 			print "Resume point detected, skipping rcupdate operation..."
 		else:
@@ -1140,7 +1142,7 @@ class generic_stage_target(generic_target):
 
 	def clean(self):
 		clean_resume = pjoin(self.settings["autoresume_path"], "clean")
-		if "AUTORESUME" in self.settings \
+		if "autoresume" in self.settings["options"] \
 			and os.path.exists(clean_resume):
 			print "Resume point detected, skipping clean operation..."
 		else:
@@ -1176,7 +1178,8 @@ class generic_stage_target(generic_target):
 
 	def empty(self):
 		empty_resume = pjoin(self.settings["autoresume_path"], "empty")
-		if "AUTORESUME" in self.settings and os.path.exists(empty_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(empty_resume):
 			print "Resume point detected, skipping empty operation..."
 		else:
 			if self.settings["spec_prefix"]+"/empty" in self.settings:
@@ -1204,7 +1207,8 @@ class generic_stage_target(generic_target):
 
 	def remove(self):
 		remove_resume = pjoin(self.settings["autoresume_path"], "remove")
-		if "AUTORESUME" in self.settings and os.path.exists(remove_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(remove_resume):
 			print "Resume point detected, skipping remove operation..."
 		else:
 			if self.settings["spec_prefix"]+"/rm" in self.settings:
@@ -1226,7 +1230,8 @@ class generic_stage_target(generic_target):
 
 	def preclean(self):
 		preclean_resume = pjoin(self.settings["autoresume_path"], "preclean")
-		if "AUTORESUME" in self.settings and os.path.exists(preclean_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(preclean_resume):
 			print "Resume point detected, skipping preclean operation..."
 		else:
 			try:
@@ -1241,7 +1246,8 @@ class generic_stage_target(generic_target):
 
 	def capture(self):
 		capture_resume = pjoin(self.settings["autoresume_path"], "capture")
-		if "AUTORESUME" in self.settings and os.path.exists(capture_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(capture_resume):
 			print "Resume point detected, skipping capture operation..."
 		else:
 			""" Capture target in a tarball """
@@ -1266,7 +1272,8 @@ class generic_stage_target(generic_target):
 
 	def run_local(self):
 		run_local_resume = pjoin(self.settings["autoresume_path"], "run_local")
-		if "AUTORESUME" in self.settings and os.path.exists(run_local_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(run_local_resume):
 			print "Resume point detected, skipping run_local operation..."
 		else:
 			try:
@@ -1314,10 +1321,10 @@ class generic_stage_target(generic_target):
 		""" Check for mounts right away and abort if we cannot unmount them """
 		self.mount_safety_check()
 
-		if "CLEAR_AUTORESUME" in self.settings:
+		if "clear-autoresume" in self.settings["options"]:
 			self.clear_autoresume()
 
-		if "PURGETMPONLY" in self.settings:
+		if "purgetmponly" in self.settings["options"]:
 			self.purge()
 			return
 
@@ -1325,7 +1332,7 @@ class generic_stage_target(generic_target):
 			self.purge()
 			return
 
-		if "PURGE" in self.settings:
+		if "purge" in self.settings["options"]:
 			self.purge()
 
 		for x in self.settings["action_sequence"]:
@@ -1341,7 +1348,8 @@ class generic_stage_target(generic_target):
 
 	def unmerge(self):
 		unmerge_resume = pjoin(self.settings["autoresume_path"], "unmerge")
-		if "AUTORESUME" in self.settings and os.path.exists(unmerge_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(unmerge_resume):
 			print "Resume point detected, skipping unmerge operation..."
 		else:
 			if self.settings["spec_prefix"]+"/unmerge" in self.settings:
@@ -1374,7 +1382,8 @@ class generic_stage_target(generic_target):
 	def target_setup(self):
 		target_setup_resume = pjoin(self.settings["autoresume_path"],
 			"target_setup")
-		if "AUTORESUME" in self.settings and os.path.exists(target_setup_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(target_setup_resume):
 			print "Resume point detected, skipping target_setup operation..."
 		else:
 			print "Setting up filesystems per filesystem type"
@@ -1386,8 +1395,8 @@ class generic_stage_target(generic_target):
 	def setup_overlay(self):
 		setup_overlay_resume = pjoin(self.settings["autoresume_path"],
 			"setup_overlay")
-		if "AUTORESUME" in self.settings and \
-				os.path.exists(setup_overlay_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(setup_overlay_resume):
 			print "Resume point detected, skipping setup_overlay operation..."
 		else:
 			if self.settings["spec_prefix"]+"/overlay" in self.settings:
@@ -1401,7 +1410,8 @@ class generic_stage_target(generic_target):
 
 	def create_iso(self):
 		create_iso_resume = pjoin(self.settings["autoresume_path"], "create_iso")
-		if "AUTORESUME" in self.settings and os.path.exists(create_iso_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(create_iso_resume):
 			print "Resume point detected, skipping create_iso operation..."
 		else:
 			""" Create the ISO """
@@ -1419,12 +1429,12 @@ class generic_stage_target(generic_target):
 	def build_packages(self):
 		build_packages_resume = pjoin(self.settings["autoresume_path"],
 			"build_packages")
-		if "AUTORESUME" in self.settings and \
-				os.path.exists(build_packages_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(build_packages_resume):
 			print "Resume point detected, skipping build_packages operation..."
 		else:
 			if self.settings["spec_prefix"]+"/packages" in self.settings:
-				if "AUTORESUME" in self.settings \
+				if "autoresume" in self.settings["options"] \
 					and os.path.exists(self.settings["autoresume_path"]+\
 						"build_packages"):
 					print "Resume point detected, skipping build_packages operation..."
@@ -1443,10 +1453,11 @@ class generic_stage_target(generic_target):
 							"build aborting due to error."
 
 	def build_kernel(self):
-		"Build all configured kernels"
+		'''Build all configured kernels'''
 		build_kernel_resume = pjoin(self.settings["autoresume_path"],
 			"build_kernel")
-		if "AUTORESUME" in self.settings and os.path.exists(build_kernel_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(build_kernel_resume):
 			print "Resume point detected, skipping build_kernel operation..."
 		else:
 			if "boot/kernel" in self.settings:
@@ -1472,7 +1483,8 @@ class generic_stage_target(generic_target):
 		"Build a single configured kernel by name"
 		kname_resume = pjoin(self.settings["autoresume_path"],
 			"build_kernel_" + kname)
-		if "AUTORESUME" in self.settings and os.path.exists(kname_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(kname_resume):
 			print "Resume point detected, skipping build_kernel for "+kname+" operation..."
 			return
 		self._copy_kernel_config(kname=kname)
@@ -1568,7 +1580,8 @@ class generic_stage_target(generic_target):
 
 	def bootloader(self):
 		bootloader_resume = pjoin(self.settings["autoresume_path"], "bootloader")
-		if "AUTORESUME" in self.settings and os.path.exists(bootloader_resume):
+		if "autoresume" in self.settings["options"] \
+			and os.path.exists(bootloader_resume):
 			print "Resume point detected, skipping bootloader operation..."
 		else:
 			try:
@@ -1583,7 +1596,7 @@ class generic_stage_target(generic_target):
 	def livecd_update(self):
 		livecd_update_resume = pjoin(self.settings["autoresume_path"],
 			"livecd_update")
-		if "AUTORESUME" in self.settings \
+		if "autoresume" in self.settings["options"] \
 			and os.path.exists(livecd_update_resume):
 			print "Resume point detected, skipping build_packages operation..."
 		else:
@@ -1615,7 +1628,7 @@ class generic_stage_target(generic_target):
 			os.chmod(myemp,mystat[ST_MODE])
 
 	def clear_packages(self):
-		if "PKGCACHE" in self.settings:
+		if "pkgcache" in self.settings["options"]:
 			print "purging the pkgcache ..."
 
 			myemp=self.settings["pkgcache_path"]
@@ -1633,7 +1646,7 @@ class generic_stage_target(generic_target):
 				os.chmod(myemp,mystat[ST_MODE])
 
 	def clear_kerncache(self):
-		if "KERNCACHE" in self.settings:
+		if "kerncache" in self.settings["options"]:
 			print "purging the kerncache ..."
 
 			myemp=self.settings["kerncache_path"]
@@ -1652,11 +1665,11 @@ class generic_stage_target(generic_target):
 
 	def clear_autoresume(self):
 		""" Clean resume points since they are no longer needed """
-		if "AUTORESUME" in self.settings:
+		if "autoresume" in self.settings["options"]:
 			print "Removing AutoResume Points: ..."
 		myemp=self.settings["autoresume_path"]
 		if os.path.isdir(myemp):
-				if "AUTORESUME" in self.settings:
+				if "autoresume" in self.settings["options"]:
 					print "Emptying directory",myemp
 				"""
 				stat the dir, delete the dir, recreate the dir and set
@@ -1720,7 +1733,7 @@ class generic_stage_target(generic_target):
 
 	def purge(self):
 		countdown(10,"Purging Caches ...")
-		if any(k in self.settings for k in ("PURGE","PURGEONLY","PURGETMPONLY")):
+		if any(k in self.settings["options"] for k in ("purge","purgeonly","purgetmponly")):
 			print "clearing autoresume ..."
 			self.clear_autoresume()
 

diff --git a/catalyst/targets/grp_target.py b/catalyst/targets/grp_target.py
index 8e70042..a8309a8 100644
--- a/catalyst/targets/grp_target.py
+++ b/catalyst/targets/grp_target.py
@@ -36,7 +36,7 @@ class grp_target(generic_stage_target):
 
 	def set_target_path(self):
 		self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+"/")
-		if "AUTORESUME" in self.settings \
+		if "autoresume" in self.settings["options"] \
 			and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
 			print "Resume point detected, skipping target path setup operation..."
 		else:

diff --git a/catalyst/targets/livecd_stage1_target.py b/catalyst/targets/livecd_stage1_target.py
index ac846ec..6273c9e 100644
--- a/catalyst/targets/livecd_stage1_target.py
+++ b/catalyst/targets/livecd_stage1_target.py
@@ -25,7 +25,7 @@ class livecd_stage1_target(generic_stage_target):
 
 	def set_target_path(self):
 		self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"])
-		if "AUTORESUME" in self.settings \
+		if "autoresume" in self.settings["options"] \
 			and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
 				print "Resume point detected, skipping target path setup operation..."
 		else:

diff --git a/catalyst/targets/livecd_stage2_target.py b/catalyst/targets/livecd_stage2_target.py
index e784844..11b1219 100644
--- a/catalyst/targets/livecd_stage2_target.py
+++ b/catalyst/targets/livecd_stage2_target.py
@@ -48,7 +48,7 @@ class livecd_stage2_target(generic_stage_target):
 
 	def set_target_path(self):
 		self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+"/")
-		if "AUTORESUME" in self.settings \
+		if "autoresume" in self.settings["options"] \
 			and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
 				print "Resume point detected, skipping target path setup operation..."
 		else:
@@ -90,7 +90,7 @@ class livecd_stage2_target(generic_stage_target):
 			error_msg="Rsync of "+self.settings["source_path"]+" to "+self.settings["chroot_path"]+" failed."
 			invalid_snapshot=False
 
-		if "AUTORESUME" in self.settings:
+		if "autoresume" in self.settings["options"]:
 			if os.path.isdir(self.settings["source_path"]) and \
 				os.path.exists(self.settings["autoresume_path"]+"unpack"):
 				print "Resume point detected, skipping unpack operation..."
@@ -114,7 +114,7 @@ class livecd_stage2_target(generic_stage_target):
 			if not os.path.exists(self.settings["chroot_path"]+"/tmp"):
 				os.makedirs(self.settings["chroot_path"]+"/tmp",1777)
 
-			if "PKGCACHE" in self.settings:
+			if "pkgcache" in self.settings["options"]:
 				if not os.path.exists(self.settings["pkgcache_path"]):
 					os.makedirs(self.settings["pkgcache_path"],0755)
 
@@ -136,7 +136,7 @@ class livecd_stage2_target(generic_stage_target):
 				"config_profile_link","setup_confdir","portage_overlay",\
 				"bind","chroot_setup","setup_environment","run_local",\
 				"build_kernel"]
-		if "FETCH" not in self.settings:
+		if "fetch" not in self.settings["options"]:
 			self.settings["action_sequence"] += ["bootloader","preclean",\
 				"livecd_update","root_overlay","fsscript","rcupdate","unmerge",\
 				"unbind","remove","empty","target_setup",\

diff --git a/catalyst/targets/netboot2_target.py b/catalyst/targets/netboot2_target.py
index 2b3cd20..8809dd0 100644
--- a/catalyst/targets/netboot2_target.py
+++ b/catalyst/targets/netboot2_target.py
@@ -45,7 +45,7 @@ class netboot2_target(generic_stage_target):
 	def set_target_path(self):
 		self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+\
 			self.settings["target_subpath"]+"/")
-		if "AUTORESUME" in self.settings \
+		if "autoresume" in self.settings["options"] \
 			and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
 				print "Resume point detected, skipping target path setup operation..."
 		else:
@@ -63,7 +63,7 @@ class netboot2_target(generic_stage_target):
 		myfiles=[]
 
 		# check for autoresume point
-		if "AUTORESUME" in self.settings \
+		if "autoresume" in self.settings["options"] \
 			and os.path.exists(self.settings["autoresume_path"]+"copy_files_to_image"):
 				print "Resume point detected, skipping target path setup operation..."
 		else:
@@ -96,7 +96,7 @@ class netboot2_target(generic_stage_target):
 			touch(self.settings["autoresume_path"]+"copy_files_to_image")
 
 	def setup_overlay(self):
-		if "AUTORESUME" in self.settings \
+		if "autoresume" in self.settings["options"] \
 		and os.path.exists(self.settings["autoresume_path"]+"setup_overlay"):
 			print "Resume point detected, skipping setup_overlay operation..."
 		else:
@@ -120,7 +120,7 @@ class netboot2_target(generic_stage_target):
 			raise CatalystError,"Failed to move kernel images!"
 
 	def remove(self):
-		if "AUTORESUME" in self.settings \
+		if "autoresume" in self.settings["options"] \
 			and os.path.exists(self.settings["autoresume_path"]+"remove"):
 			print "Resume point detected, skipping remove operation..."
 		else:
@@ -132,7 +132,7 @@ class netboot2_target(generic_stage_target):
 					os.system("rm -rf " + self.settings["chroot_path"] + self.settings["merge_path"] + x)
 
 	def empty(self):
-		if "AUTORESUME" in self.settings \
+		if "autoresume" in self.settings["options"] \
 			and os.path.exists(self.settings["autoresume_path"]+"empty"):
 			print "Resume point detected, skipping empty operation..."
 		else:

diff --git a/catalyst/targets/snapshot_target.py b/catalyst/targets/snapshot_target.py
index d1b9e40..50133ec 100644
--- a/catalyst/targets/snapshot_target.py
+++ b/catalyst/targets/snapshot_target.py
@@ -32,11 +32,11 @@ class snapshot_target(generic_stage_target):
 		pass
 
 	def run(self):
-		if "PURGEONLY" in self.settings:
+		if "purgeonly" in self.settings["options"]:
 			self.purge()
 			return
 
-		if "PURGE" in self.settings:
+		if "purge" in self.settings["options"]:
 			self.purge()
 
 		self.setup()

diff --git a/catalyst/targets/stage2_target.py b/catalyst/targets/stage2_target.py
index 6377f5d..94d4a1e 100644
--- a/catalyst/targets/stage2_target.py
+++ b/catalyst/targets/stage2_target.py
@@ -16,7 +16,7 @@ class stage2_target(generic_stage_target):
 		generic_stage_target.__init__(self,spec,addlargs)
 
 	def set_source_path(self):
-		if "SEEDCACHE" in self.settings and os.path.isdir(normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")):
+		if "seedcache" in self.settings["options"] and os.path.isdir(normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")):
 			self.settings["source_path"]=normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")
 		else:
 			self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2")

diff --git a/catalyst/targets/stage4_target.py b/catalyst/targets/stage4_target.py
index 9168f2e..e2b8a79 100644
--- a/catalyst/targets/stage4_target.py
+++ b/catalyst/targets/stage4_target.py
@@ -32,8 +32,8 @@ class stage4_target(generic_stage_target):
 					"clean"]
 
 #		if "TARBALL" in self.settings or \
-#			"FETCH" not in self.settings:
-		if "FETCH" not in self.settings:
+#			"fetch" not in self.settings['options']:
+		if "fetch" not in self.settings['options']:
 			self.settings["action_sequence"].append("capture")
 		self.settings["action_sequence"].append("clear_autoresume")
 


             reply	other threads:[~2014-06-14  5:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-14  5:58 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-11-29 17:20 [gentoo-commits] proj/catalyst:master commit in: catalyst/targets/, catalyst/ Brian Dolbec
2017-11-22 15:52 ` [gentoo-commits] proj/catalyst:pending commit in: catalyst/, catalyst/targets/ Brian Dolbec
2015-01-01  5:59 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-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 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  7:12 Brian Dolbec
2014-09-02  5:54 Brian Dolbec
2014-09-02  5:54 Brian Dolbec
2014-09-02  5:54 Brian Dolbec
2014-09-02  2:43 Brian Dolbec
2014-09-02  2:43 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-15 14:56 Brian Dolbec
2014-06-14  5:58 Brian Dolbec
2014-06-14  5:58 Brian Dolbec
2014-05-05 19:17 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2014-04-02 20:09 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2014-05-05 19:17 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2014-04-02 20:09 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2014-04-02 20:09 Brian Dolbec
2014-03-22 22:25 Brian Dolbec
2014-03-22 22:25 Brian Dolbec
2014-03-22 22:25 Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402720464.a7d29e75be4c4f742ec6287f6ac71b940b78e67a.dol-sen@gentoo \
    --to=brian.dolbec@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox