public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-catalyst] rewrite-on-master patches
@ 2013-12-14  3:07 Brian Dolbec
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 1/4] Add more configured defaults Brian Dolbec
                   ` (3 more replies)
  0 siblings, 4 replies; 79+ messages in thread
From: Brian Dolbec @ 2013-12-14  3:07 UTC (permalink / raw
  To: gentoo-catalyst


These are the first 4 of the entire rewrite-on-master branch.
Patch number 3 is to adapt Dylans changes to my newly rebased patch set.
These are applied before the initial restructuring.


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

* [gentoo-catalyst] [PATCH 1/4] Add more configured defaults
  2013-12-14  3:07 [gentoo-catalyst] rewrite-on-master patches Brian Dolbec
@ 2013-12-14  3:07 ` Brian Dolbec
  2013-12-14  4:12   ` Rick "Zero_Chaos" Farina
                     ` (2 more replies)
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths Brian Dolbec
                   ` (2 subsequent siblings)
  3 siblings, 3 replies; 79+ messages in thread
From: Brian Dolbec @ 2013-12-14  3:07 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

Use the new configured snapshot_name and portdir settings
Use the portdir setting rather than hard-coded path
---
 catalyst                        | 14 +++++++++-----
 modules/generic_stage_target.py |  6 ++++--
 modules/snapshot_target.py      | 14 +++++++++-----
 modules/tinderbox_target.py     |  4 ++--
 4 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/catalyst b/catalyst
index ba26f3c..19ec77e 100755
--- a/catalyst
+++ b/catalyst
@@ -61,11 +61,15 @@ def parse_config(myconfig):
 	myconf={}
 	config_file=""
 
-	confdefaults={ "storedir":"/var/tmp/catalyst",\
-		"sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles",\
-		"portdir":"/usr/portage","options":"",\
-		"snapshot_cache":"/var/tmp/catalyst/snapshot_cache",\
-		"hash_function":"crc32"}
+	confdefaults={
+		"hash_function": "crc32",
+		"portdir": "/usr/portage",
+		"repo_name": "portage",
+		"sharedir": "/usr/lib/catalyst",
+		"snapshot_name": "portage-",
+		"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
+		"storedir": "/var/tmp/catalyst",
+		}
 
 	# first, try the one passed (presumably from the cmdline)
 	if myconfig:
diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 848aca2..c2888b6 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -410,7 +410,8 @@ class generic_stage_target(generic_target):
 
 	def set_snapshot_path(self):
 		self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
-			"/snapshots/portage-"+self.settings["snapshot"]+".tar.xz")
+			"/snapshots/" + self.settings["snapshot_name"] +
+			self.settings["snapshot"]+".tar.xz")
 
 		if os.path.exists(self.settings["snapshot_path"]):
 			self.settings["snapshot_path_hash"]=\
@@ -418,7 +419,8 @@ class generic_stage_target(generic_target):
 				hash_function=self.settings["hash_function"],verbose=False)
 		else:
 			self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
-				"/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2")
+				"/snapshots/" + self.settings["snapshot_name"] +
+				self.settings["snapshot"]+".tar.bz2")
 
 			if os.path.exists(self.settings["snapshot_path"]):
 				self.settings["snapshot_path_hash"]=\
diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py
index e93a86a..29d6e87 100644
--- a/modules/snapshot_target.py
+++ b/modules/snapshot_target.py
@@ -18,8 +18,9 @@ class snapshot_target(generic_stage_target):
 		self.settings=myspec
 		self.settings["target_subpath"]="portage"
 		st=self.settings["storedir"]
-		self.settings["snapshot_path"]=normpath(st+"/snapshots/portage-"+self.settings["version_stamp"]\
-			+".tar.bz2")
+		self.settings["snapshot_path"]=normpath(st + "/snapshots/"
+			+ self.settings["snapshot_name"]
+			+ self.settings["version_stamp"] + ".tar.bz2")
 		self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpath"])
 
 	def setup(self):
@@ -46,11 +47,14 @@ class snapshot_target(generic_stage_target):
 		if not os.path.exists(mytmp):
 			os.makedirs(mytmp)
 
-		cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ --exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* "+\
-			self.settings["portdir"]+"/ "+mytmp+"/portage/","Snapshot failure",env=self.env)
+		cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ " +
+			"--exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* " +
+			self.settings["portdir"] + "/ " + mytmp + "/%s/" % self.settings["repo_name"],
+			"Snapshot failure",env=self.env)
 
 		print "Compressing Portage snapshot tarball..."
-		cmd("tar -I lbzip2 -cf "+self.settings["snapshot_path"]+" -C "+mytmp+" portage",\
+		cmd("tar -I lbzip2 -cf " + self.settings["snapshot_path"] + " -C " +
+			mytmp + " %s" % self.settings["repo_name"],
 			"Snapshot creation failure",env=self.env)
 
 		self.gen_contents_file(self.settings["snapshot_path"])
diff --git a/modules/tinderbox_target.py b/modules/tinderbox_target.py
index 46fe082..d6d3ea3 100644
--- a/modules/tinderbox_target.py
+++ b/modules/tinderbox_target.py
@@ -29,8 +29,8 @@ class tinderbox_target(generic_stage_target):
 			raise CatalystError,"Tinderbox aborting due to error."
 
 	def set_cleanables(self):
-	    self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",\
-					"/usr/portage"]
+	    self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",
+					self.settings['portdir']]
 
 	def set_action_sequence(self):
 		#Default action sequence for run method
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths.
  2013-12-14  3:07 [gentoo-catalyst] rewrite-on-master patches Brian Dolbec
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 1/4] Add more configured defaults Brian Dolbec
@ 2013-12-14  3:07 ` Brian Dolbec
  2013-12-14  4:26   ` Rick "Zero_Chaos" Farina
                     ` (2 more replies)
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 3/4] Adapt commit c52962b6bd2 to use the new configured settings values Brian Dolbec
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 4/4] cleanup long lines, improve usage() output formatting slightly Brian Dolbec
  3 siblings, 3 replies; 79+ messages in thread
From: Brian Dolbec @ 2013-12-14  3:07 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

Migrate more hardcoded paths to use settings variables instead.
---
 catalyst                        |  3 ++
 modules/generic_stage_target.py | 80 ++++++++++++++++++++---------------------
 2 files changed, 43 insertions(+), 40 deletions(-)

diff --git a/catalyst b/catalyst
index 19ec77e..60cea3e 100755
--- a/catalyst
+++ b/catalyst
@@ -62,8 +62,11 @@ def parse_config(myconfig):
 	config_file=""
 
 	confdefaults={
+		"distdir": "/usr/portage/distfiles",
 		"hash_function": "crc32",
+		"packagedir": "/usr/portage/packages",
 		"portdir": "/usr/portage",
+		"port_tmpdir": "/var/tmp/portage",
 		"repo_name": "portage",
 		"sharedir": "/usr/lib/catalyst",
 		"snapshot_name": "portage-",
diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index c2888b6..342c65b 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -179,11 +179,11 @@ class generic_stage_target(generic_target):
 				"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		else:
-			self.mounts=["/proc","/dev","/usr/portage/distfiles","/var/tmp/portage"]
-			self.mountmap={"/proc":"/proc","/dev":"/dev","/dev/pts":"/dev/pts",\
-				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
+			self.mounts=["proc","dev", "distdir", "port_tmpdir"]
+			self.mountmap={"proc":"/proc", "dev":"/dev", "pts":"/dev/pts",
+				"distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}
 		if os.uname()[0] == "Linux":
-			self.mounts.append("/dev/pts")
+			self.mounts.append("pts")
 
 		self.set_mounts()
 
@@ -195,16 +195,15 @@ class generic_stage_target(generic_target):
 			self.set_pkgcache_path()
 			print "Location of the package cache is "+\
 				self.settings["pkgcache_path"]
-			self.mounts.append("/usr/portage/packages")
-			self.mountmap["/usr/portage/packages"]=\
-				self.settings["pkgcache_path"]
+			self.mounts.append("packagedir")
+			self.mountmap["packagedir"] = self.settings["pkgcache_path"]
 
 		if "KERNCACHE" in self.settings:
 			self.set_kerncache_path()
 			print "Location of the kerncache is "+\
 				self.settings["kerncache_path"]
-			self.mounts.append("/tmp/kerncache")
-			self.mountmap["/tmp/kerncache"]=self.settings["kerncache_path"]
+			self.mounts.append("kerncache")
+			self.mountmap["kerncache"]=self.settings["kerncache_path"]
 
 		if "CCACHE" in self.settings:
 			if "CCACHE_DIR" in os.environ:
@@ -216,8 +215,8 @@ class generic_stage_target(generic_target):
 				raise CatalystError,\
 					"Compiler cache support can't be enabled (can't find "+\
 					ccdir+")"
-			self.mounts.append("/var/tmp/ccache")
-			self.mountmap["/var/tmp/ccache"]=ccdir
+			self.mounts.append("ccache")
+			self.mountmap["ccache"]=ccdir
 			""" for the chroot: """
 			self.env["CCACHE_DIR"]="/var/tmp/ccache"
 
@@ -406,7 +405,7 @@ class generic_stage_target(generic_target):
 
 	def set_cleanables(self):
 		self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/tmp/*",\
-			"/root/*","/usr/portage"]
+			"/root/*", self.settings["portdir"]]
 
 	def set_snapshot_path(self):
 		self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
@@ -615,21 +614,21 @@ class generic_stage_target(generic_target):
 			return
 
 		for x in self.mounts:
-			if not os.path.exists(mypath+x):
+			if not os.path.exists(mypath + self.mountmap[x]):
 				continue
 
-			if ismount(mypath+x):
+			if ismount(mypath +self.mountmap[x]):
 				""" Something is still mounted "" """
 				try:
-					print x+" is still mounted; performing auto-bind-umount...",
+					print self.mountmap[x] + " is still mounted; performing auto-bind-umount...",
 					""" Try to umount stuff ourselves """
 					self.unbind()
-					if ismount(mypath+x):
-						raise CatalystError, "Auto-unbind failed for "+x
+					if ismount(mypath + self.mountmap[x]):
+						raise CatalystError, "Auto-unbind failed for " + self.mountmap[x]
 					else:
 						print "Auto-unbind successful..."
 				except CatalystError:
-					raise CatalystError, "Unable to auto-unbind "+x
+					raise CatalystError, "Unable to auto-unbind " + self.mountmap[x]
 
 	def unpack(self):
 		unpack=True
@@ -787,7 +786,7 @@ class generic_stage_target(generic_target):
 				print "Valid snapshot cache, skipping unpack of portage tree..."
 				unpack=False
 		else:
-			destdir=normpath(self.settings["chroot_path"]+"/usr/portage")
+			destdir=normpath(self.settings["chroot_path"] + self.settings["portdir"])
 			cleanup_errmsg="Error removing existing snapshot directory."
 			cleanup_msg=\
 				"Cleaning up existing portage tree (This can take a long time)..."
@@ -801,7 +800,7 @@ class generic_stage_target(generic_target):
 
 			if "AUTORESUME" in self.settings \
 				and os.path.exists(self.settings["chroot_path"]+\
-					"/usr/portage/") \
+					self.settings["portdir"]) \
 				and os.path.exists(self.settings["autoresume_path"]\
 					+"unpack_portage") \
 				and self.settings["snapshot_path_hash"] == snapshot_hash:
@@ -848,7 +847,7 @@ class generic_stage_target(generic_target):
 			cmd("rm -f "+self.settings["chroot_path"]+"/etc/portage/make.profile",\
 					"Error zapping profile link",env=self.env)
 			cmd("mkdir -p "+self.settings["chroot_path"]+"/etc/portage/")
-			cmd("ln -sf ../../usr/portage/profiles/"+\
+			cmd("ln -sf ../.." + self.settings["portdir"] + "/profiles/"+\
 				self.settings["target_profile"]+" "+\
 				self.settings["chroot_path"]+"/etc/portage/make.profile",\
 				"Error creating profile link",env=self.env)
@@ -874,10 +873,10 @@ class generic_stage_target(generic_target):
 				if os.path.exists(x):
 					print "Copying overlay dir " +x
 					cmd("mkdir -p "+self.settings["chroot_path"]+\
-						"/usr/local/portage",\
+						self.settings["local_overlay"],\
 						"Could not make portage_overlay dir",env=self.env)
 					cmd("cp -R "+x+"/* "+self.settings["chroot_path"]+\
-						"/usr/local/portage",\
+						self.settings["local_overlay"],\
 						"Could not copy portage_overlay",env=self.env)
 
 	def root_overlay(self):
@@ -897,7 +896,7 @@ class generic_stage_target(generic_target):
 
 	def bind(self):
 		for x in self.mounts:
-			if not os.path.exists(self.settings["chroot_path"]+x):
+			if not os.path.exists(self.settings["chroot_path"] + self.mountmap[x]):
 				os.makedirs(self.settings["chroot_path"]+x,0755)
 
 			if not os.path.exists(self.mountmap[x]):
@@ -909,11 +908,11 @@ class generic_stage_target(generic_target):
 				self.snapshot_lock_object.read_lock()
 			if os.uname()[0] == "FreeBSD":
 				if src == "/dev":
-					retval=os.system("mount -t devfs none "+\
-						self.settings["chroot_path"]+x)
+					retval=os.system("mount -t devfs none " +
+						self.settings["chroot_path"] + src)
 				else:
-					retval=os.system("mount_nullfs "+src+" "+\
-						self.settings["chroot_path"]+x)
+					retval=os.system("mount_nullfs " + src + " " +
+						self.settings["chroot_path"] + src)
 			else:
 				if src == "tmpfs":
 					if "var_tmpfs_portage" in self.settings:
@@ -921,11 +920,11 @@ class generic_stage_target(generic_target):
 							self.settings["var_tmpfs_portage"]+"G "+src+" "+\
 							self.settings["chroot_path"]+x)
 				else:
-					retval=os.system("mount --bind "+src+" "+\
-						self.settings["chroot_path"]+x)
+					retval=os.system("mount --bind " + src + " " +
+						self.settings["chroot_path"] + src)
 			if retval!=0:
 				self.unbind()
-				raise CatalystError,"Couldn't bind mount "+src
+				raise CatalystError,"Couldn't bind mount " + src
 
 	def unbind(self):
 		ouch=0
@@ -934,25 +933,26 @@ class generic_stage_target(generic_target):
 		myrevmounts.reverse()
 		""" Unmount in reverse order for nested bind-mounts """
 		for x in myrevmounts:
-			if not os.path.exists(mypath+x):
+			if not os.path.exists(mypath + self.mountmap[x]):
 				continue
 
-			if not ismount(mypath+x):
+			if not ismount(mypath + self.mountmap[x]):
 				continue
 
 			retval=os.system("umount "+\
-				os.path.join(mypath,x.lstrip(os.path.sep)))
+				os.path.join(mypath, self.mountmap[x].lstrip(os.path.sep)))
 
 			if retval!=0:
-				warn("First attempt to unmount: "+mypath+x+" failed.")
+				warn("First attempt to unmount: " + mypath +
+					self.mountmap[x] +" failed.")
 				warn("Killing any pids still running in the chroot")
 
 				self.kill_chroot_pids()
 
-				retval2=os.system("umount "+mypath+x)
+				retval2=os.system("umount " + mypath + self.mountmap[x])
 				if retval2!=0:
 					ouch=1
-					warn("Couldn't umount bind mount: "+mypath+x)
+					warn("Couldn't umount bind mount: " + mypath + self.mountmap[x])
 
 			if "SNAPCACHE" in self.settings and x == "/usr/portage":
 				try:
@@ -1118,9 +1118,9 @@ class generic_stage_target(generic_target):
 				"Could not replace /etc/hosts",env=self.env)
 
 		""" Remove our overlay """
-		if os.path.exists(self.settings["chroot_path"]+"/usr/local/portage"):
-			cmd("rm -rf "+self.settings["chroot_path"]+"/usr/local/portage",\
-				"Could not remove /usr/local/portage",env=self.env)
+		if os.path.exists(self.settings["chroot_path"] + self.settings["local_overlay"]):
+			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",\
 				"Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH 3/4] Adapt commit c52962b6bd2 to use the new configured settings values.
  2013-12-14  3:07 [gentoo-catalyst] rewrite-on-master patches Brian Dolbec
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 1/4] Add more configured defaults Brian Dolbec
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths Brian Dolbec
@ 2013-12-14  3:07 ` Brian Dolbec
  2013-12-14  4:59   ` Dustin C. Hatch
  2013-12-14 14:54   ` Dylan Baker
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 4/4] cleanup long lines, improve usage() output formatting slightly Brian Dolbec
  3 siblings, 2 replies; 79+ messages in thread
From: Brian Dolbec @ 2013-12-14  3:07 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

---
 modules/generic_stage_target.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 342c65b..1fbc733 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -1066,9 +1066,9 @@ class generic_stage_target(generic_target):
 						"/use will cause portage to ignore"
 					print "\tpackage.use in the profile and portage_confdir. You've been warned!"
 
-			myf.write('PORTDIR="/usr/portage"\n')
-			myf.write('DISTDIR="${PORTDIR}/distfiles"\n')
-			myf.write('PKGDIR="${PORTDIR}/packages"\n')
+			myf.write('PORTDIR="%s"\n' % self.settings['portdir'])
+			myf.write('DISTDIR="%s"\n' % self.settings['distdir'])
+			myf.write('PKGDIR="%s"\n' % self.settings['packagedir'])
 
 			""" Setup the portage overlay """
 			if "portage_overlay" in self.settings:
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH 4/4] cleanup long lines, improve usage() output formatting slightly
  2013-12-14  3:07 [gentoo-catalyst] rewrite-on-master patches Brian Dolbec
                   ` (2 preceding siblings ...)
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 3/4] Adapt commit c52962b6bd2 to use the new configured settings values Brian Dolbec
@ 2013-12-14  3:07 ` Brian Dolbec
  2013-12-14  5:14   ` Matt Turner
  3 siblings, 1 reply; 79+ messages in thread
From: Brian Dolbec @ 2013-12-14  3:07 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

---
 catalyst | 83 +++++++++++++++++++++++++++++++++++++---------------------------
 1 file changed, 48 insertions(+), 35 deletions(-)

diff --git a/catalyst b/catalyst
index 60cea3e..a68a2ba 100755
--- a/catalyst
+++ b/catalyst
@@ -24,31 +24,33 @@ __version__="2.0.15"
 conf_values={}
 
 def usage():
-	print "Usage catalyst [options] [-C variable=value...] [ -s identifier]"
-	print " -a --clear-autoresume	clear autoresume flags"
-	print " -c --config     use specified configuration file"
-	print " -C --cli        catalyst commandline (MUST BE LAST OPTION)"
-	print " -d --debug      enable debugging"
-	print " -f --file       read specfile"
-	print " -F --fetchonly  fetch files only"
-	print " -h --help       print this help message"
-	print " -p --purge      clear tmp dirs,package cache and autoresume flags"
-	print " -P --purgeonly  clear tmp dirs,package cache and autoresume flags and exit"
-	print " -T --purgetmponly  clear tmp dirs and autoresume flags and exit"
-	print " -s --snapshot   generate a release snapshot"
-	print " -V --version    display version information"
-	print " -v --verbose    verbose output"
-	print
-	print "Usage examples:"
-	print
-	print "Using the commandline option (-C, --cli) to build a Portage snapshot:"
-	print "catalyst -C target=snapshot version_stamp=my_date"
-	print
-	print "Using the snapshot option (-s, --snapshot) to build a release snapshot:"
-	print "catalyst -s 20071121"
-	print
-	print "Using the specfile option (-f, --file) to build a stage target:"
-	print "catalyst -f stage1-specfile.spec"
+	print """Usage catalyst [options] [-C variable=value...] [ -s identifier]
+ -a --clear-autoresume  clear autoresume flags
+ -c --config            use specified configuration file
+ -C --cli               catalyst commandline (MUST BE LAST OPTION)
+ -d --debug             enable debugging
+ -f --file              read specfile
+ -F --fetchonly         fetch files only
+ -h --help              print this help message
+ -p --purge             clear tmp dirs,package cache, autoresume flags
+ -P --purgeonly         clear tmp dirs,package cache, autoresume flags and exit
+ -T --purgetmponly      clear tmp dirs and autoresume flags and exit
+ -s --snapshot          generate a release snapshot
+ -V --version           display version information
+ -v --verbose           verbose output
+
+Usage examples:
+
+Using the commandline option (-C, --cli) to build a Portage snapshot:
+catalyst -C target=snapshot version_stamp=my_date
+
+Using the snapshot option (-s, --snapshot) to build a release snapshot:
+catalyst -s 20071121"
+
+Using the specfile option (-f, --file) to build a stage target:
+catalyst -f stage1-specfile.spec
+"""
+
 
 def version():
 	print "Catalyst, version "+__version__
@@ -77,7 +79,8 @@ def parse_config(myconfig):
 	# first, try the one passed (presumably from the cmdline)
 	if myconfig:
 		if os.path.exists(myconfig):
-			print "Using command line specified Catalyst configuration file, "+myconfig
+			print "Using command line specified Catalyst configuration file, "+\
+				myconfig
 			config_file=myconfig
 
 		else:
@@ -87,7 +90,8 @@ def parse_config(myconfig):
 
 	# next, try the default location
 	elif os.path.exists("/etc/catalyst/catalyst.conf"):
-		print "Using default Catalyst configuration file, /etc/catalyst/catalyst.conf"
+		print "Using default Catalyst configuration file," + \
+			" /etc/catalyst/catalyst.conf"
 		config_file="/etc/catalyst/catalyst.conf"
 
 	# can't find a config file (we are screwed), so bail out
@@ -183,14 +187,16 @@ def parse_config(myconfig):
 		conf_values["port_logdir"]=myconf["port_logdir"];
 
 def import_modules():
-	# import catalyst's own modules (i.e. catalyst_support and the arch modules)
+	# import catalyst's own modules
+	# (i.e. catalyst_support and the arch modules)
 	targetmap={}
 
 	try:
 		for x in required_build_targets:
 			try:
 				fh=open(conf_values["sharedir"]+"/modules/"+x+".py")
-				module=imp.load_module(x,fh,"modules/"+x+".py",(".py","r",imp.PY_SOURCE))
+				module=imp.load_module(x,fh,"modules/"+x+".py",
+					(".py","r",imp.PY_SOURCE))
 				fh.close()
 
 			except IOError:
@@ -200,7 +206,8 @@ def import_modules():
 		for x in valid_build_targets:
 			try:
 				fh=open(conf_values["sharedir"]+"/modules/"+x+".py")
-				module=imp.load_module(x,fh,"modules/"+x+".py",(".py","r",imp.PY_SOURCE))
+				module=imp.load_module(x,fh,"modules/"+x+".py",
+					(".py","r",imp.PY_SOURCE))
 				module.register(targetmap)
 				fh.close()
 
@@ -218,15 +225,17 @@ def import_modules():
 def build_target(addlargs, targetmap):
 	try:
 		if addlargs["target"] not in targetmap:
-			raise CatalystError,"Target \""+addlargs["target"]+"\" not available."
+			raise CatalystError, \
+				"Target \"%s\" not available." % addlargs["target"]
 
 		mytarget=targetmap[addlargs["target"]](conf_values, addlargs)
 
 		mytarget.run()
 
 	except:
-		modules.catalyst.util.print_traceback()
-		print "!!! catalyst: Error encountered during run of target " + addlargs["target"]
+		catalyst.util.print_traceback()
+		print "!!! catalyst: Error encountered during run of target " + \
+			addlargs["target"]
 		sys.exit(1)
 
 if __name__ == "__main__":
@@ -245,8 +254,12 @@ if __name__ == "__main__":
 
 	# parse out the command line arguments
 	try:
-		opts,args = getopt.getopt(sys.argv[1:], "apPThvdc:C:f:FVs:", ["purge", "purgeonly", "purgetmponly", "help", "version", "debug",\
-			"clear-autoresume", "config=", "cli=", "file=", "fetch", "verbose","snapshot="])
+		opts,args = getopt.getopt(sys.argv[1:], "apPThvdc:C:f:FVs:",
+			["purge", "purgeonly", "purgetmponly", "help", "version", "debug",
+			"clear-autoresume", "config=", "cli=", "file=", "fetch",
+			"verbose","snapshot="
+			]
+		)
 
 	except getopt.GetoptError:
 		usage()
-- 
1.8.3.2



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

* Re: [gentoo-catalyst] [PATCH 1/4] Add more configured defaults
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 1/4] Add more configured defaults Brian Dolbec
@ 2013-12-14  4:12   ` Rick "Zero_Chaos" Farina
  2013-12-14  4:51   ` Matt Turner
  2013-12-14 14:33   ` Dylan Baker
  2 siblings, 0 replies; 79+ messages in thread
From: Rick "Zero_Chaos" Farina @ 2013-12-14  4:12 UTC (permalink / raw
  To: gentoo-catalyst

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/13/2013 10:07 PM, Brian Dolbec wrote:
> Use the new configured snapshot_name and portdir settings
> Use the portdir setting rather than hard-coded path
> ---
>  catalyst                        | 14 +++++++++-----
>  modules/generic_stage_target.py |  6 ++++--
>  modules/snapshot_target.py      | 14 +++++++++-----
>  modules/tinderbox_target.py     |  4 ++--
>  4 files changed, 24 insertions(+), 14 deletions(-)
> 
> diff --git a/catalyst b/catalyst
> index ba26f3c..19ec77e 100755
> --- a/catalyst
> +++ b/catalyst
> @@ -61,11 +61,15 @@ def parse_config(myconfig):
>  	myconf={}
>  	config_file=""
>  
> -	confdefaults={ "storedir":"/var/tmp/catalyst",\
> -		"sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles",\
> -		"portdir":"/usr/portage","options":"",\
> -		"snapshot_cache":"/var/tmp/catalyst/snapshot_cache",\
> -		"hash_function":"crc32"}
> +	confdefaults={
> +		"hash_function": "crc32",
> +		"portdir": "/usr/portage",
> +		"repo_name": "portage",
> +		"sharedir": "/usr/lib/catalyst",
> +		"snapshot_name": "portage-",
> +		"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
> +		"storedir": "/var/tmp/catalyst",
> +		}
>  
>  	# first, try the one passed (presumably from the cmdline)
>  	if myconfig:
> diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
> index 848aca2..c2888b6 100644
> --- a/modules/generic_stage_target.py
> +++ b/modules/generic_stage_target.py
> @@ -410,7 +410,8 @@ class generic_stage_target(generic_target):
>  
>  	def set_snapshot_path(self):
>  		self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
> -			"/snapshots/portage-"+self.settings["snapshot"]+".tar.xz")
> +			"/snapshots/" + self.settings["snapshot_name"] +
Do we really need a "snapshot_name" variable to store "portage-" for the
part before the date? Are so many people complaining about calling the
portage snapshots "portage-$DATE.tar.xz" ?
> +			self.settings["snapshot"]+".tar.xz")
>  
>  		if os.path.exists(self.settings["snapshot_path"]):
>  			self.settings["snapshot_path_hash"]=\
> @@ -418,7 +419,8 @@ class generic_stage_target(generic_target):
>  				hash_function=self.settings["hash_function"],verbose=False)
>  		else:
>  			self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
> -				"/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2")
> +				"/snapshots/" + self.settings["snapshot_name"] +
same as above
> +				self.settings["snapshot"]+".tar.bz2")
>  
>  			if os.path.exists(self.settings["snapshot_path"]):
>  				self.settings["snapshot_path_hash"]=\
> diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py
> index e93a86a..29d6e87 100644
> --- a/modules/snapshot_target.py
> +++ b/modules/snapshot_target.py
> @@ -18,8 +18,9 @@ class snapshot_target(generic_stage_target):
>  		self.settings=myspec
>  		self.settings["target_subpath"]="portage"
>  		st=self.settings["storedir"]
> -		self.settings["snapshot_path"]=normpath(st+"/snapshots/portage-"+self.settings["version_stamp"]\
> -			+".tar.bz2")
> +		self.settings["snapshot_path"]=normpath(st + "/snapshots/"
> +			+ self.settings["snapshot_name"]
> +			+ self.settings["version_stamp"] + ".tar.bz2")
>  		self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpath"])
>  
>  	def setup(self):
> @@ -46,11 +47,14 @@ class snapshot_target(generic_stage_target):
>  		if not os.path.exists(mytmp):
>  			os.makedirs(mytmp)
>  
> -		cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ --exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* "+\
> -			self.settings["portdir"]+"/ "+mytmp+"/portage/","Snapshot failure",env=self.env)
> +		cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ " +
> +			"--exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* " +
> +			self.settings["portdir"] + "/ " + mytmp + "/%s/" % self.settings["repo_name"],
> +			"Snapshot failure",env=self.env)
>  
>  		print "Compressing Portage snapshot tarball..."
> -		cmd("tar -I lbzip2 -cf "+self.settings["snapshot_path"]+" -C "+mytmp+" portage",\
> +		cmd("tar -I lbzip2 -cf " + self.settings["snapshot_path"] + " -C " +
> +			mytmp + " %s" % self.settings["repo_name"],
>  			"Snapshot creation failure",env=self.env)
>  
>  		self.gen_contents_file(self.settings["snapshot_path"])
> diff --git a/modules/tinderbox_target.py b/modules/tinderbox_target.py
> index 46fe082..d6d3ea3 100644
> --- a/modules/tinderbox_target.py
> +++ b/modules/tinderbox_target.py
> @@ -29,8 +29,8 @@ class tinderbox_target(generic_stage_target):
>  			raise CatalystError,"Tinderbox aborting due to error."
>  
>  	def set_cleanables(self):
> -	    self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",\
> -					"/usr/portage"]
> +	    self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",
> +					self.settings['portdir']]
>  
>  	def set_action_sequence(self):
>  		#Default action sequence for run method
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSq9qfAAoJEKXdFCfdEflK8ksP/AxrW/r+czmWFR2Ve2QLWqwT
em+AqJMsmaPFXSCas0aiTwEb5K/Ef63shx02NmvDILU08zKtTeAbbw5aD0hkmFfe
MADN22MCz4ohFkKL3SJUKVFa87EiveCh2s6L1YMR35zb1egVmGUTyyrrwY+MELsq
1/TV5w8388DmLAvG+pBQTZZO5rrueZ/bOTzS9BJT3OcIYPy92mxHBGLWsHKKuTgH
2/k42r6PFe8G99PpnL6B6W9ThZAq1hQZP/Wkx7tCtsLtXZOPcU7IdzpTj1m6095d
RzkmmTuAKDjTWdslMYQzjUGSe3WGQjMkspz+EMaFNk0e71OzYGyW8im1u02jhL9n
zforS/3ztXceLnjsUHd5+Cu+caIJnzLEdOjCbpdq84WvBBGGJ7BkeFMUu0NNQNSG
q24srI0qXXhiNOH32ExJ1rwlP5zy9FFz4B3IydVT+3bf51Nt33zehglmpR+BAEml
FfI+3txIaXhRSI7uRGXG8SLGsRm4062f1eE/lr1cTW63kNoWut5U7VJ0BHW5y33G
pu5IzADjIaWnNOY8+3FldAUrBtXxEi+M5lbVk86xsK5FLS1RFsBLrLgDD3W+6w7A
YyQayTBVXRTGw8VowLzvqvjQzJHufSDwhDeau2UpjNrP3PmcVp+DMWbl7qbr2DS/
TCgv4XUmkgFdmcuHPLgD
=eQmL
-----END PGP SIGNATURE-----


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

* Re: [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths.
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths Brian Dolbec
@ 2013-12-14  4:26   ` Rick "Zero_Chaos" Farina
  2013-12-14  5:08   ` Matt Turner
  2013-12-14 14:51   ` [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths Dylan Baker
  2 siblings, 0 replies; 79+ messages in thread
From: Rick "Zero_Chaos" Farina @ 2013-12-14  4:26 UTC (permalink / raw
  To: gentoo-catalyst

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/13/2013 10:07 PM, Brian Dolbec wrote:
> Migrate more hardcoded paths to use settings variables instead.
> ---
>  catalyst                        |  3 ++
>  modules/generic_stage_target.py | 80 ++++++++++++++++++++---------------------
>  2 files changed, 43 insertions(+), 40 deletions(-)
> 
> diff --git a/catalyst b/catalyst
> index 19ec77e..60cea3e 100755
> --- a/catalyst
> +++ b/catalyst
> @@ -62,8 +62,11 @@ def parse_config(myconfig):
>  	config_file=""
>  
>  	confdefaults={
> +		"distdir": "/usr/portage/distfiles",
>  		"hash_function": "crc32",
> +		"packagedir": "/usr/portage/packages",
>  		"portdir": "/usr/portage",
> +		"port_tmpdir": "/var/tmp/portage",
>  		"repo_name": "portage",
>  		"sharedir": "/usr/lib/catalyst",
>  		"snapshot_name": "portage-",
> diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
> index c2888b6..342c65b 100644
> --- a/modules/generic_stage_target.py
> +++ b/modules/generic_stage_target.py
> @@ -179,11 +179,11 @@ class generic_stage_target(generic_target):
>  				"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
>  				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
>  		else:
> -			self.mounts=["/proc","/dev","/usr/portage/distfiles","/var/tmp/portage"]
> -			self.mountmap={"/proc":"/proc","/dev":"/dev","/dev/pts":"/dev/pts",\
> -				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
> +			self.mounts=["proc","dev", "distdir", "port_tmpdir"]
> +			self.mountmap={"proc":"/proc", "dev":"/dev", "pts":"/dev/pts",
> +				"distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}
>  		if os.uname()[0] == "Linux":
> -			self.mounts.append("/dev/pts")
> +			self.mounts.append("pts")
this should be "devpts" since that's how it is named in mounts anyway.

- -Zero
>  
>  		self.set_mounts()
>  
> @@ -195,16 +195,15 @@ class generic_stage_target(generic_target):
>  			self.set_pkgcache_path()
>  			print "Location of the package cache is "+\
>  				self.settings["pkgcache_path"]
> -			self.mounts.append("/usr/portage/packages")
> -			self.mountmap["/usr/portage/packages"]=\
> -				self.settings["pkgcache_path"]
> +			self.mounts.append("packagedir")
> +			self.mountmap["packagedir"] = self.settings["pkgcache_path"]
>  
>  		if "KERNCACHE" in self.settings:
>  			self.set_kerncache_path()
>  			print "Location of the kerncache is "+\
>  				self.settings["kerncache_path"]
> -			self.mounts.append("/tmp/kerncache")
> -			self.mountmap["/tmp/kerncache"]=self.settings["kerncache_path"]
> +			self.mounts.append("kerncache")
> +			self.mountmap["kerncache"]=self.settings["kerncache_path"]
>  
>  		if "CCACHE" in self.settings:
>  			if "CCACHE_DIR" in os.environ:
> @@ -216,8 +215,8 @@ class generic_stage_target(generic_target):
>  				raise CatalystError,\
>  					"Compiler cache support can't be enabled (can't find "+\
>  					ccdir+")"
> -			self.mounts.append("/var/tmp/ccache")
> -			self.mountmap["/var/tmp/ccache"]=ccdir
> +			self.mounts.append("ccache")
> +			self.mountmap["ccache"]=ccdir
>  			""" for the chroot: """
>  			self.env["CCACHE_DIR"]="/var/tmp/ccache"
>  
> @@ -406,7 +405,7 @@ class generic_stage_target(generic_target):
>  
>  	def set_cleanables(self):
>  		self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/tmp/*",\
> -			"/root/*","/usr/portage"]
> +			"/root/*", self.settings["portdir"]]
>  
>  	def set_snapshot_path(self):
>  		self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
> @@ -615,21 +614,21 @@ class generic_stage_target(generic_target):
>  			return
>  
>  		for x in self.mounts:
> -			if not os.path.exists(mypath+x):
> +			if not os.path.exists(mypath + self.mountmap[x]):
>  				continue
>  
> -			if ismount(mypath+x):
> +			if ismount(mypath +self.mountmap[x]):
>  				""" Something is still mounted "" """
>  				try:
> -					print x+" is still mounted; performing auto-bind-umount...",
> +					print self.mountmap[x] + " is still mounted; performing auto-bind-umount...",
>  					""" Try to umount stuff ourselves """
>  					self.unbind()
> -					if ismount(mypath+x):
> -						raise CatalystError, "Auto-unbind failed for "+x
> +					if ismount(mypath + self.mountmap[x]):
> +						raise CatalystError, "Auto-unbind failed for " + self.mountmap[x]
>  					else:
>  						print "Auto-unbind successful..."
>  				except CatalystError:
> -					raise CatalystError, "Unable to auto-unbind "+x
> +					raise CatalystError, "Unable to auto-unbind " + self.mountmap[x]
>  
>  	def unpack(self):
>  		unpack=True
> @@ -787,7 +786,7 @@ class generic_stage_target(generic_target):
>  				print "Valid snapshot cache, skipping unpack of portage tree..."
>  				unpack=False
>  		else:
> -			destdir=normpath(self.settings["chroot_path"]+"/usr/portage")
> +			destdir=normpath(self.settings["chroot_path"] + self.settings["portdir"])
>  			cleanup_errmsg="Error removing existing snapshot directory."
>  			cleanup_msg=\
>  				"Cleaning up existing portage tree (This can take a long time)..."
> @@ -801,7 +800,7 @@ class generic_stage_target(generic_target):
>  
>  			if "AUTORESUME" in self.settings \
>  				and os.path.exists(self.settings["chroot_path"]+\
> -					"/usr/portage/") \
> +					self.settings["portdir"]) \
>  				and os.path.exists(self.settings["autoresume_path"]\
>  					+"unpack_portage") \
>  				and self.settings["snapshot_path_hash"] == snapshot_hash:
> @@ -848,7 +847,7 @@ class generic_stage_target(generic_target):
>  			cmd("rm -f "+self.settings["chroot_path"]+"/etc/portage/make.profile",\
>  					"Error zapping profile link",env=self.env)
>  			cmd("mkdir -p "+self.settings["chroot_path"]+"/etc/portage/")
> -			cmd("ln -sf ../../usr/portage/profiles/"+\
> +			cmd("ln -sf ../.." + self.settings["portdir"] + "/profiles/"+\
>  				self.settings["target_profile"]+" "+\
>  				self.settings["chroot_path"]+"/etc/portage/make.profile",\
>  				"Error creating profile link",env=self.env)
> @@ -874,10 +873,10 @@ class generic_stage_target(generic_target):
>  				if os.path.exists(x):
>  					print "Copying overlay dir " +x
>  					cmd("mkdir -p "+self.settings["chroot_path"]+\
> -						"/usr/local/portage",\
> +						self.settings["local_overlay"],\
>  						"Could not make portage_overlay dir",env=self.env)
>  					cmd("cp -R "+x+"/* "+self.settings["chroot_path"]+\
> -						"/usr/local/portage",\
> +						self.settings["local_overlay"],\
>  						"Could not copy portage_overlay",env=self.env)
>  
>  	def root_overlay(self):
> @@ -897,7 +896,7 @@ class generic_stage_target(generic_target):
>  
>  	def bind(self):
>  		for x in self.mounts:
> -			if not os.path.exists(self.settings["chroot_path"]+x):
> +			if not os.path.exists(self.settings["chroot_path"] + self.mountmap[x]):
>  				os.makedirs(self.settings["chroot_path"]+x,0755)
>  
>  			if not os.path.exists(self.mountmap[x]):
> @@ -909,11 +908,11 @@ class generic_stage_target(generic_target):
>  				self.snapshot_lock_object.read_lock()
>  			if os.uname()[0] == "FreeBSD":
>  				if src == "/dev":
> -					retval=os.system("mount -t devfs none "+\
> -						self.settings["chroot_path"]+x)
> +					retval=os.system("mount -t devfs none " +
> +						self.settings["chroot_path"] + src)
>  				else:
> -					retval=os.system("mount_nullfs "+src+" "+\
> -						self.settings["chroot_path"]+x)
> +					retval=os.system("mount_nullfs " + src + " " +
> +						self.settings["chroot_path"] + src)
>  			else:
>  				if src == "tmpfs":
>  					if "var_tmpfs_portage" in self.settings:
> @@ -921,11 +920,11 @@ class generic_stage_target(generic_target):
>  							self.settings["var_tmpfs_portage"]+"G "+src+" "+\
>  							self.settings["chroot_path"]+x)
>  				else:
> -					retval=os.system("mount --bind "+src+" "+\
> -						self.settings["chroot_path"]+x)
> +					retval=os.system("mount --bind " + src + " " +
> +						self.settings["chroot_path"] + src)
>  			if retval!=0:
>  				self.unbind()
> -				raise CatalystError,"Couldn't bind mount "+src
> +				raise CatalystError,"Couldn't bind mount " + src
>  
>  	def unbind(self):
>  		ouch=0
> @@ -934,25 +933,26 @@ class generic_stage_target(generic_target):
>  		myrevmounts.reverse()
>  		""" Unmount in reverse order for nested bind-mounts """
>  		for x in myrevmounts:
> -			if not os.path.exists(mypath+x):
> +			if not os.path.exists(mypath + self.mountmap[x]):
>  				continue
>  
> -			if not ismount(mypath+x):
> +			if not ismount(mypath + self.mountmap[x]):
>  				continue
>  
>  			retval=os.system("umount "+\
> -				os.path.join(mypath,x.lstrip(os.path.sep)))
> +				os.path.join(mypath, self.mountmap[x].lstrip(os.path.sep)))
>  
>  			if retval!=0:
> -				warn("First attempt to unmount: "+mypath+x+" failed.")
> +				warn("First attempt to unmount: " + mypath +
> +					self.mountmap[x] +" failed.")
>  				warn("Killing any pids still running in the chroot")
>  
>  				self.kill_chroot_pids()
>  
> -				retval2=os.system("umount "+mypath+x)
> +				retval2=os.system("umount " + mypath + self.mountmap[x])
>  				if retval2!=0:
>  					ouch=1
> -					warn("Couldn't umount bind mount: "+mypath+x)
> +					warn("Couldn't umount bind mount: " + mypath + self.mountmap[x])
>  
>  			if "SNAPCACHE" in self.settings and x == "/usr/portage":
>  				try:
> @@ -1118,9 +1118,9 @@ class generic_stage_target(generic_target):
>  				"Could not replace /etc/hosts",env=self.env)
>  
>  		""" Remove our overlay """
> -		if os.path.exists(self.settings["chroot_path"]+"/usr/local/portage"):
> -			cmd("rm -rf "+self.settings["chroot_path"]+"/usr/local/portage",\
> -				"Could not remove /usr/local/portage",env=self.env)
> +		if os.path.exists(self.settings["chroot_path"] + self.settings["local_overlay"]):
> +			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",\
>  				"Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSq93wAAoJEKXdFCfdEflKSkgQAKZROZEkF40YRVInP9T2eGVQ
S7C4BjXL0Qos74azrlOJooZO43v2N4tkEmYg8rt/Wq44eGWHjku6If1+tnwKNx4m
nhzHQlT6tE+M8ZMSKMEu5H+pWIPH8d2YKy40ljpPNlTFBty0q64KRMTHNs0ysuQA
DiuqbY2L/CKOV4rcNrflMQPyf77D8arBULUOufBDs/D5M7O3wdiOaqAGr0GOqUbm
JG438VtaJLm4OHr8bOtJU4fk9I5yWp2igZAL3bhN9HUqfh+mTJkzjDsdSDpx6+hu
SZHe8CSnCpe4SVSKCppUzXdbSCLuLsF/dYAt06wnYWDZ68IiZDwOLu/AXLIjfzjV
f/6WCZlK2MHiFfgHC4BE+3xIKvMSOVvS72cM8BHD2gIvSsXibzWX6VG/DvZRpqHK
3uCDlR4JUc1Yenx842C2S9DjG6vRD6ISLKRML8DvvK0NjbmHR1BUNrm2WpB6jGD3
Lsx3hK62bKcWWT4e9exwKiqVIfqzGEZRNaWuHIimxNto9T8xoz7ss0Vvl9w9f2Ml
cF6FSic8tUuJFWdG/itna75ddALYbNqH4wRHMnOC0mOPAU79sKDxuUPo3P2bK4q4
di3oKlOflry9LxV1jpyK6tRFSR1rogg3NN6yGvijKSpbT04zozJm2dNo62o2k9EC
dnft0lEhKkksRngGU9VZ
=eYhc
-----END PGP SIGNATURE-----


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

* Re: [gentoo-catalyst] [PATCH 1/4] Add more configured defaults
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 1/4] Add more configured defaults Brian Dolbec
  2013-12-14  4:12   ` Rick "Zero_Chaos" Farina
@ 2013-12-14  4:51   ` Matt Turner
  2013-12-14 11:54     ` Brian Dolbec
  2013-12-14 14:33   ` Dylan Baker
  2 siblings, 1 reply; 79+ messages in thread
From: Matt Turner @ 2013-12-14  4:51 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

On Fri, Dec 13, 2013 at 7:07 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
> Use the new configured snapshot_name and portdir settings
> Use the portdir setting rather than hard-coded path
> ---
>  catalyst                        | 14 +++++++++-----
>  modules/generic_stage_target.py |  6 ++++--
>  modules/snapshot_target.py      | 14 +++++++++-----
>  modules/tinderbox_target.py     |  4 ++--
>  4 files changed, 24 insertions(+), 14 deletions(-)
>
> diff --git a/catalyst b/catalyst
> index ba26f3c..19ec77e 100755
> --- a/catalyst
> +++ b/catalyst
> @@ -61,11 +61,15 @@ def parse_config(myconfig):
>         myconf={}
>         config_file=""
>
> -       confdefaults={ "storedir":"/var/tmp/catalyst",\
> -               "sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles",\
> -               "portdir":"/usr/portage","options":"",\
> -               "snapshot_cache":"/var/tmp/catalyst/snapshot_cache",\
> -               "hash_function":"crc32"}
> +       confdefaults={
> +               "hash_function": "crc32",
> +               "portdir": "/usr/portage",
> +               "repo_name": "portage",
> +               "sharedir": "/usr/lib/catalyst",
> +               "snapshot_name": "portage-",
> +               "snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
> +               "storedir": "/var/tmp/catalyst",
> +               }

I agree that adding a key:value to store "portage-" seems unnecessary.
I don't think we should do this unless someone has a compelling
reason.

Also, we lost "options" here. Is this intentional or consequential?

>
>         # first, try the one passed (presumably from the cmdline)
>         if myconfig:
> diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
> index 848aca2..c2888b6 100644
> --- a/modules/generic_stage_target.py
> +++ b/modules/generic_stage_target.py
> @@ -410,7 +410,8 @@ class generic_stage_target(generic_target):
>
>         def set_snapshot_path(self):
>                 self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
> -                       "/snapshots/portage-"+self.settings["snapshot"]+".tar.xz")
> +                       "/snapshots/" + self.settings["snapshot_name"] +
> +                       self.settings["snapshot"]+".tar.xz")
>
>                 if os.path.exists(self.settings["snapshot_path"]):
>                         self.settings["snapshot_path_hash"]=\
> @@ -418,7 +419,8 @@ class generic_stage_target(generic_target):
>                                 hash_function=self.settings["hash_function"],verbose=False)
>                 else:
>                         self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
> -                               "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2")
> +                               "/snapshots/" + self.settings["snapshot_name"] +
> +                               self.settings["snapshot"]+".tar.bz2")
>
>                         if os.path.exists(self.settings["snapshot_path"]):
>                                 self.settings["snapshot_path_hash"]=\
> diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py
> index e93a86a..29d6e87 100644
> --- a/modules/snapshot_target.py
> +++ b/modules/snapshot_target.py
> @@ -18,8 +18,9 @@ class snapshot_target(generic_stage_target):
>                 self.settings=myspec
>                 self.settings["target_subpath"]="portage"
>                 st=self.settings["storedir"]
> -               self.settings["snapshot_path"]=normpath(st+"/snapshots/portage-"+self.settings["version_stamp"]\
> -                       +".tar.bz2")
> +               self.settings["snapshot_path"]=normpath(st + "/snapshots/"
> +                       + self.settings["snapshot_name"]
> +                       + self.settings["version_stamp"] + ".tar.bz2")
>                 self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpath"])
>
>         def setup(self):
> @@ -46,11 +47,14 @@ class snapshot_target(generic_stage_target):
>                 if not os.path.exists(mytmp):
>                         os.makedirs(mytmp)
>
> -               cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ --exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* "+\
> -                       self.settings["portdir"]+"/ "+mytmp+"/portage/","Snapshot failure",env=self.env)
> +               cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ " +
> +                       "--exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* " +
> +                       self.settings["portdir"] + "/ " + mytmp + "/%s/" % self.settings["repo_name"],
> +                       "Snapshot failure",env=self.env)
>
>                 print "Compressing Portage snapshot tarball..."
> -               cmd("tar -I lbzip2 -cf "+self.settings["snapshot_path"]+" -C "+mytmp+" portage",\
> +               cmd("tar -I lbzip2 -cf " + self.settings["snapshot_path"] + " -C " +
> +                       mytmp + " %s" % self.settings["repo_name"],

There's no need for "%s" % ... here. Just mytmp + " " +
self.settings["repo_name"].

>                         "Snapshot creation failure",env=self.env)
>
>                 self.gen_contents_file(self.settings["snapshot_path"])
> diff --git a/modules/tinderbox_target.py b/modules/tinderbox_target.py
> index 46fe082..d6d3ea3 100644
> --- a/modules/tinderbox_target.py
> +++ b/modules/tinderbox_target.py
> @@ -29,8 +29,8 @@ class tinderbox_target(generic_stage_target):
>                         raise CatalystError,"Tinderbox aborting due to error."
>
>         def set_cleanables(self):
> -           self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",\
> -                                       "/usr/portage"]
> +           self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",
> +                                       self.settings['portdir']]
>
>         def set_action_sequence(self):
>                 #Default action sequence for run method
> --
> 1.8.3.2
>
>


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

* Re: [gentoo-catalyst] [PATCH 3/4] Adapt commit c52962b6bd2 to use the new configured settings values.
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 3/4] Adapt commit c52962b6bd2 to use the new configured settings values Brian Dolbec
@ 2013-12-14  4:59   ` Dustin C. Hatch
  2013-12-14  6:12     ` Brian Dolbec
  2013-12-14 14:54   ` Dylan Baker
  1 sibling, 1 reply; 79+ messages in thread
From: Dustin C. Hatch @ 2013-12-14  4:59 UTC (permalink / raw
  To: gentoo-catalyst

On 12/13/2013 21:07, Brian Dolbec wrote:
> ---
>   modules/generic_stage_target.py | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
> index 342c65b..1fbc733 100644
> --- a/modules/generic_stage_target.py
> +++ b/modules/generic_stage_target.py
> @@ -1066,9 +1066,9 @@ class generic_stage_target(generic_target):
>   						"/use will cause portage to ignore"
>   					print "\tpackage.use in the profile and portage_confdir. You've been warned!"
>
> -			myf.write('PORTDIR="/usr/portage"\n')
> -			myf.write('DISTDIR="${PORTDIR}/distfiles"\n')
> -			myf.write('PKGDIR="${PORTDIR}/packages"\n')
> +			myf.write('PORTDIR="%s"\n' % self.settings['portdir'])
> +			myf.write('DISTDIR="%s"\n' % self.settings['distdir'])
> +			myf.write('PKGDIR="%s"\n' % self.settings['packagedir'])
>
>   			""" Setup the portage overlay """
>   			if "portage_overlay" in self.settings:
>
Do we need to still do this? Since the default location isn't hardcoded 
anymore, but set in repos.conf, it can be confusing if PORTDIR is set in 
make.conf, because it doesn't even get used.

-- 
♫Dustin
http://dustin.hatch.name/


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

* Re: [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths.
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths Brian Dolbec
  2013-12-14  4:26   ` Rick "Zero_Chaos" Farina
@ 2013-12-14  5:08   ` Matt Turner
  2013-12-14 11:15     ` Brian Dolbec
  2013-12-14 14:51   ` [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths Dylan Baker
  2 siblings, 1 reply; 79+ messages in thread
From: Matt Turner @ 2013-12-14  5:08 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

On Fri, Dec 13, 2013 at 7:07 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
> Migrate more hardcoded paths to use settings variables instead.

I can't really make any sense of the commit title, and it'd be
preferable to do one path per patch.

> ---
>  catalyst                        |  3 ++
>  modules/generic_stage_target.py | 80 ++++++++++++++++++++---------------------
>  2 files changed, 43 insertions(+), 40 deletions(-)
>
> diff --git a/catalyst b/catalyst
> index 19ec77e..60cea3e 100755
> --- a/catalyst
> +++ b/catalyst
> @@ -62,8 +62,11 @@ def parse_config(myconfig):
>         config_file=""
>
>         confdefaults={
> +               "distdir": "/usr/portage/distfiles",
>                 "hash_function": "crc32",
> +               "packagedir": "/usr/portage/packages",
>                 "portdir": "/usr/portage",
> +               "port_tmpdir": "/var/tmp/portage",
>                 "repo_name": "portage",
>                 "sharedir": "/usr/lib/catalyst",
>                 "snapshot_name": "portage-",
> diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
> index c2888b6..342c65b 100644
> --- a/modules/generic_stage_target.py
> +++ b/modules/generic_stage_target.py
> @@ -179,11 +179,11 @@ class generic_stage_target(generic_target):
>                                 "/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
>                                 "/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
>                 else:
> -                       self.mounts=["/proc","/dev","/usr/portage/distfiles","/var/tmp/portage"]
> -                       self.mountmap={"/proc":"/proc","/dev":"/dev","/dev/pts":"/dev/pts",\
> -                               "/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
> +                       self.mounts=["proc","dev", "distdir", "port_tmpdir"]
> +                       self.mountmap={"proc":"/proc", "dev":"/dev", "pts":"/dev/pts",
> +                               "distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}
>                 if os.uname()[0] == "Linux":
> -                       self.mounts.append("/dev/pts")
> +                       self.mounts.append("pts")
>
>                 self.set_mounts()
>
> @@ -195,16 +195,15 @@ class generic_stage_target(generic_target):
>                         self.set_pkgcache_path()
>                         print "Location of the package cache is "+\
>                                 self.settings["pkgcache_path"]
> -                       self.mounts.append("/usr/portage/packages")
> -                       self.mountmap["/usr/portage/packages"]=\
> -                               self.settings["pkgcache_path"]
> +                       self.mounts.append("packagedir")
> +                       self.mountmap["packagedir"] = self.settings["pkgcache_path"]
>
>                 if "KERNCACHE" in self.settings:
>                         self.set_kerncache_path()
>                         print "Location of the kerncache is "+\
>                                 self.settings["kerncache_path"]
> -                       self.mounts.append("/tmp/kerncache")
> -                       self.mountmap["/tmp/kerncache"]=self.settings["kerncache_path"]
> +                       self.mounts.append("kerncache")
> +                       self.mountmap["kerncache"]=self.settings["kerncache_path"]
>
>                 if "CCACHE" in self.settings:
>                         if "CCACHE_DIR" in os.environ:
> @@ -216,8 +215,8 @@ class generic_stage_target(generic_target):
>                                 raise CatalystError,\
>                                         "Compiler cache support can't be enabled (can't find "+\
>                                         ccdir+")"
> -                       self.mounts.append("/var/tmp/ccache")
> -                       self.mountmap["/var/tmp/ccache"]=ccdir
> +                       self.mounts.append("ccache")
> +                       self.mountmap["ccache"]=ccdir
>                         """ for the chroot: """
>                         self.env["CCACHE_DIR"]="/var/tmp/ccache"
>
> @@ -406,7 +405,7 @@ class generic_stage_target(generic_target):
>
>         def set_cleanables(self):
>                 self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/tmp/*",\
> -                       "/root/*","/usr/portage"]
> +                       "/root/*", self.settings["portdir"]]
>
>         def set_snapshot_path(self):
>                 self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
> @@ -615,21 +614,21 @@ class generic_stage_target(generic_target):
>                         return
>
>                 for x in self.mounts:
> -                       if not os.path.exists(mypath+x):
> +                       if not os.path.exists(mypath + self.mountmap[x]):
>                                 continue
>
> -                       if ismount(mypath+x):
> +                       if ismount(mypath +self.mountmap[x]):
>                                 """ Something is still mounted "" """
>                                 try:
> -                                       print x+" is still mounted; performing auto-bind-umount...",
> +                                       print self.mountmap[x] + " is still mounted; performing auto-bind-umount...",
>                                         """ Try to umount stuff ourselves """
>                                         self.unbind()
> -                                       if ismount(mypath+x):
> -                                               raise CatalystError, "Auto-unbind failed for "+x
> +                                       if ismount(mypath + self.mountmap[x]):
> +                                               raise CatalystError, "Auto-unbind failed for " + self.mountmap[x]
>                                         else:
>                                                 print "Auto-unbind successful..."
>                                 except CatalystError:
> -                                       raise CatalystError, "Unable to auto-unbind "+x
> +                                       raise CatalystError, "Unable to auto-unbind " + self.mountmap[x]
>
>         def unpack(self):
>                 unpack=True
> @@ -787,7 +786,7 @@ class generic_stage_target(generic_target):
>                                 print "Valid snapshot cache, skipping unpack of portage tree..."
>                                 unpack=False
>                 else:
> -                       destdir=normpath(self.settings["chroot_path"]+"/usr/portage")
> +                       destdir=normpath(self.settings["chroot_path"] + self.settings["portdir"])
>                         cleanup_errmsg="Error removing existing snapshot directory."
>                         cleanup_msg=\
>                                 "Cleaning up existing portage tree (This can take a long time)..."
> @@ -801,7 +800,7 @@ class generic_stage_target(generic_target):
>
>                         if "AUTORESUME" in self.settings \
>                                 and os.path.exists(self.settings["chroot_path"]+\
> -                                       "/usr/portage/") \
> +                                       self.settings["portdir"]) \
>                                 and os.path.exists(self.settings["autoresume_path"]\
>                                         +"unpack_portage") \
>                                 and self.settings["snapshot_path_hash"] == snapshot_hash:
> @@ -848,7 +847,7 @@ class generic_stage_target(generic_target):
>                         cmd("rm -f "+self.settings["chroot_path"]+"/etc/portage/make.profile",\
>                                         "Error zapping profile link",env=self.env)
>                         cmd("mkdir -p "+self.settings["chroot_path"]+"/etc/portage/")
> -                       cmd("ln -sf ../../usr/portage/profiles/"+\
> +                       cmd("ln -sf ../.." + self.settings["portdir"] + "/profiles/"+\
>                                 self.settings["target_profile"]+" "+\
>                                 self.settings["chroot_path"]+"/etc/portage/make.profile",\
>                                 "Error creating profile link",env=self.env)
> @@ -874,10 +873,10 @@ class generic_stage_target(generic_target):
>                                 if os.path.exists(x):
>                                         print "Copying overlay dir " +x
>                                         cmd("mkdir -p "+self.settings["chroot_path"]+\
> -                                               "/usr/local/portage",\
> +                                               self.settings["local_overlay"],\
>                                                 "Could not make portage_overlay dir",env=self.env)
>                                         cmd("cp -R "+x+"/* "+self.settings["chroot_path"]+\
> -                                               "/usr/local/portage",\
> +                                               self.settings["local_overlay"],\
>                                                 "Could not copy portage_overlay",env=self.env)
>
>         def root_overlay(self):
> @@ -897,7 +896,7 @@ class generic_stage_target(generic_target):
>
>         def bind(self):
>                 for x in self.mounts:
> -                       if not os.path.exists(self.settings["chroot_path"]+x):
> +                       if not os.path.exists(self.settings["chroot_path"] + self.mountmap[x]):
>                                 os.makedirs(self.settings["chroot_path"]+x,0755)
>
>                         if not os.path.exists(self.mountmap[x]):
> @@ -909,11 +908,11 @@ class generic_stage_target(generic_target):
>                                 self.snapshot_lock_object.read_lock()
>                         if os.uname()[0] == "FreeBSD":
>                                 if src == "/dev":
> -                                       retval=os.system("mount -t devfs none "+\
> -                                               self.settings["chroot_path"]+x)
> +                                       retval=os.system("mount -t devfs none " +
> +                                               self.settings["chroot_path"] + src)
>                                 else:
> -                                       retval=os.system("mount_nullfs "+src+" "+\
> -                                               self.settings["chroot_path"]+x)
> +                                       retval=os.system("mount_nullfs " + src + " " +
> +                                               self.settings["chroot_path"] + src)
>                         else:
>                                 if src == "tmpfs":
>                                         if "var_tmpfs_portage" in self.settings:
> @@ -921,11 +920,11 @@ class generic_stage_target(generic_target):
>                                                         self.settings["var_tmpfs_portage"]+"G "+src+" "+\
>                                                         self.settings["chroot_path"]+x)
>                                 else:
> -                                       retval=os.system("mount --bind "+src+" "+\
> -                                               self.settings["chroot_path"]+x)
> +                                       retval=os.system("mount --bind " + src + " " +
> +                                               self.settings["chroot_path"] + src)
>                         if retval!=0:
>                                 self.unbind()
> -                               raise CatalystError,"Couldn't bind mount "+src
> +                               raise CatalystError,"Couldn't bind mount " + src
>
>         def unbind(self):
>                 ouch=0
> @@ -934,25 +933,26 @@ class generic_stage_target(generic_target):
>                 myrevmounts.reverse()
>                 """ Unmount in reverse order for nested bind-mounts """
>                 for x in myrevmounts:
> -                       if not os.path.exists(mypath+x):
> +                       if not os.path.exists(mypath + self.mountmap[x]):
>                                 continue
>
> -                       if not ismount(mypath+x):
> +                       if not ismount(mypath + self.mountmap[x]):
>                                 continue
>
>                         retval=os.system("umount "+\
> -                               os.path.join(mypath,x.lstrip(os.path.sep)))
> +                               os.path.join(mypath, self.mountmap[x].lstrip(os.path.sep)))
>
>                         if retval!=0:
> -                               warn("First attempt to unmount: "+mypath+x+" failed.")
> +                               warn("First attempt to unmount: " + mypath +
> +                                       self.mountmap[x] +" failed.")
>                                 warn("Killing any pids still running in the chroot")
>
>                                 self.kill_chroot_pids()
>
> -                               retval2=os.system("umount "+mypath+x)
> +                               retval2=os.system("umount " + mypath + self.mountmap[x])
>                                 if retval2!=0:
>                                         ouch=1
> -                                       warn("Couldn't umount bind mount: "+mypath+x)
> +                                       warn("Couldn't umount bind mount: " + mypath + self.mountmap[x])
>
>                         if "SNAPCACHE" in self.settings and x == "/usr/portage":
>                                 try:
> @@ -1118,9 +1118,9 @@ class generic_stage_target(generic_target):
>                                 "Could not replace /etc/hosts",env=self.env)
>
>                 """ Remove our overlay """
> -               if os.path.exists(self.settings["chroot_path"]+"/usr/local/portage"):
> -                       cmd("rm -rf "+self.settings["chroot_path"]+"/usr/local/portage",\
> -                               "Could not remove /usr/local/portage",env=self.env)
> +               if os.path.exists(self.settings["chroot_path"] + self.settings["local_overlay"]):
> +                       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",\
>                                 "Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
> --
> 1.8.3.2
>
>

There are piles of unrelated changes. :(


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

* Re: [gentoo-catalyst] [PATCH 4/4] cleanup long lines, improve usage() output formatting slightly
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 4/4] cleanup long lines, improve usage() output formatting slightly Brian Dolbec
@ 2013-12-14  5:14   ` Matt Turner
  2013-12-14  5:22     ` W. Trevor King
  2013-12-14  6:21     ` Brian Dolbec
  0 siblings, 2 replies; 79+ messages in thread
From: Matt Turner @ 2013-12-14  5:14 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

On Fri, Dec 13, 2013 at 7:07 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
> ---
>  catalyst | 83 +++++++++++++++++++++++++++++++++++++---------------------------
>  1 file changed, 48 insertions(+), 35 deletions(-)
>
> diff --git a/catalyst b/catalyst
> index 60cea3e..a68a2ba 100755
> --- a/catalyst
> +++ b/catalyst
> @@ -24,31 +24,33 @@ __version__="2.0.15"
>  conf_values={}
>
>  def usage():
> -       print "Usage catalyst [options] [-C variable=value...] [ -s identifier]"
> -       print " -a --clear-autoresume   clear autoresume flags"
> -       print " -c --config     use specified configuration file"
> -       print " -C --cli        catalyst commandline (MUST BE LAST OPTION)"
> -       print " -d --debug      enable debugging"
> -       print " -f --file       read specfile"
> -       print " -F --fetchonly  fetch files only"
> -       print " -h --help       print this help message"
> -       print " -p --purge      clear tmp dirs,package cache and autoresume flags"
> -       print " -P --purgeonly  clear tmp dirs,package cache and autoresume flags and exit"
> -       print " -T --purgetmponly  clear tmp dirs and autoresume flags and exit"
> -       print " -s --snapshot   generate a release snapshot"
> -       print " -V --version    display version information"
> -       print " -v --verbose    verbose output"
> -       print
> -       print "Usage examples:"
> -       print
> -       print "Using the commandline option (-C, --cli) to build a Portage snapshot:"
> -       print "catalyst -C target=snapshot version_stamp=my_date"
> -       print
> -       print "Using the snapshot option (-s, --snapshot) to build a release snapshot:"
> -       print "catalyst -s 20071121"
> -       print
> -       print "Using the specfile option (-f, --file) to build a stage target:"
> -       print "catalyst -f stage1-specfile.spec"
> +       print """Usage catalyst [options] [-C variable=value...] [ -s identifier]
> + -a --clear-autoresume  clear autoresume flags
> + -c --config            use specified configuration file
> + -C --cli               catalyst commandline (MUST BE LAST OPTION)
> + -d --debug             enable debugging
> + -f --file              read specfile
> + -F --fetchonly         fetch files only
> + -h --help              print this help message
> + -p --purge             clear tmp dirs,package cache, autoresume flags
> + -P --purgeonly         clear tmp dirs,package cache, autoresume flags and exit
> + -T --purgetmponly      clear tmp dirs and autoresume flags and exit
> + -s --snapshot          generate a release snapshot
> + -V --version           display version information
> + -v --verbose           verbose output
> +
> +Usage examples:
> +
> +Using the commandline option (-C, --cli) to build a Portage snapshot:
> +catalyst -C target=snapshot version_stamp=my_date
> +
> +Using the snapshot option (-s, --snapshot) to build a release snapshot:
> +catalyst -s 20071121"
> +
> +Using the specfile option (-f, --file) to build a stage target:
> +catalyst -f stage1-specfile.spec
> +"""
> +
>
>  def version():
>         print "Catalyst, version "+__version__
> @@ -77,7 +79,8 @@ def parse_config(myconfig):
>         # first, try the one passed (presumably from the cmdline)
>         if myconfig:
>                 if os.path.exists(myconfig):
> -                       print "Using command line specified Catalyst configuration file, "+myconfig
> +                       print "Using command line specified Catalyst configuration file, "+\

No need to add \

(same comment applies elsewhere)


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

* Re: [gentoo-catalyst] [PATCH 4/4] cleanup long lines, improve usage() output formatting slightly
  2013-12-14  5:14   ` Matt Turner
@ 2013-12-14  5:22     ` W. Trevor King
  2013-12-14  6:21     ` Brian Dolbec
  1 sibling, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14  5:22 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

[-- Attachment #1: Type: text/plain, Size: 662 bytes --]

On Fri, Dec 13, 2013 at 09:14:02PM -0800, Matt Turner wrote:
> On Fri, Dec 13, 2013 at 7:07 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
> > -                       print "Using command line specified Catalyst configuration file, "+myconfig
> > +                       print "Using command line specified Catalyst configuration file, "+\
> 
> No need to add \
> 
> (same comment applies elsewhere)

I think he's just wrapping overly-long lines, of which Catalyst has
many ;).

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 3/4] Adapt commit c52962b6bd2 to use the new configured settings values.
  2013-12-14  4:59   ` Dustin C. Hatch
@ 2013-12-14  6:12     ` Brian Dolbec
  0 siblings, 0 replies; 79+ messages in thread
From: Brian Dolbec @ 2013-12-14  6:12 UTC (permalink / raw
  To: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 1651 bytes --]

On Fri, 2013-12-13 at 22:59 -0600, Dustin C. Hatch wrote:
> On 12/13/2013 21:07, Brian Dolbec wrote:
> > ---
> >   modules/generic_stage_target.py | 6 +++---
> >   1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
> > index 342c65b..1fbc733 100644
> > --- a/modules/generic_stage_target.py
> > +++ b/modules/generic_stage_target.py
> > @@ -1066,9 +1066,9 @@ class generic_stage_target(generic_target):
> >   						"/use will cause portage to ignore"
> >   					print "\tpackage.use in the profile and portage_confdir. You've been warned!"
> >
> > -			myf.write('PORTDIR="/usr/portage"\n')
> > -			myf.write('DISTDIR="${PORTDIR}/distfiles"\n')
> > -			myf.write('PKGDIR="${PORTDIR}/packages"\n')
> > +			myf.write('PORTDIR="%s"\n' % self.settings['portdir'])
> > +			myf.write('DISTDIR="%s"\n' % self.settings['distdir'])
> > +			myf.write('PKGDIR="%s"\n' % self.settings['packagedir'])
> >
> >   			""" Setup the portage overlay """
> >   			if "portage_overlay" in self.settings:
> >
> Do we need to still do this? Since the default location isn't hardcoded 
> anymore, but set in repos.conf, it can be confusing if PORTDIR is set in 
> make.conf, because it doesn't even get used.
> 

This patch is to fix recent commits to master that conflicted with
commits done in the rewrite branch 1 year ago.  All this coding was done
long before the recent repos.conf changes shoved on us.  There are lots
more changes to come.  If at that time, if things are settled, then it
will be time to update for the repos.conf mess imposed on us.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 4/4] cleanup long lines, improve usage() output formatting slightly
  2013-12-14  5:14   ` Matt Turner
  2013-12-14  5:22     ` W. Trevor King
@ 2013-12-14  6:21     ` Brian Dolbec
  2013-12-14 14:56       ` Dylan Baker
  1 sibling, 1 reply; 79+ messages in thread
From: Brian Dolbec @ 2013-12-14  6:21 UTC (permalink / raw
  To: Matt Turner; +Cc: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

On Fri, 2013-12-13 at 21:14 -0800, Matt Turner wrote:
> On Fri, Dec 13, 2013 at 7:07 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
> > -                       print "Using command line specified Catalyst configuration file, "+myconfig
> > +                       print "Using command line specified Catalyst configuration file, "+\
> 
> No need to add \
> 
> (same comment applies elsewhere)

General rule is if you are making something multiline, it needs to be
enclosed in ()'s or []'s, etc..  I'm quite certain that the old print
statement needs the line continuation "\" symbol since there are no ()'s
enclosing all blocks to be printed.  That may have changed at some point
so that it is not required in more recent python versions.  Actually
when using the newer python()  you don't even need to use + between
blocks of text on multiple lines.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths.
  2013-12-14  5:08   ` Matt Turner
@ 2013-12-14 11:15     ` Brian Dolbec
  2013-12-14 16:37       ` W. Trevor King
  0 siblings, 1 reply; 79+ messages in thread
From: Brian Dolbec @ 2013-12-14 11:15 UTC (permalink / raw
  To: Matt Turner; +Cc: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 16297 bytes --]

On Fri, 2013-12-13 at 21:08 -0800, Matt Turner wrote:
> On Fri, Dec 13, 2013 at 7:07 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
> > Migrate more hardcoded paths to use settings variables instead.
> 
> I can't really make any sense of the commit title, 

This is the full commit message in git:

Remove self.mounts and self.mountmap's use of paths for keys and paths.

Migrate more hardcoded paths to use settings variables instead.
---------------

git send-email broke it up, using the first line as the subject, the
other lines are included in the main text body.



> and it'd be
> preferable to do one path per patch.

Re-coding that mounts and mountmap mess was hard enough and required
lots of testing, fixing to get it correct and working.  Splitting it up
even more is an exercise in futility.

> 
> > ---
> >  catalyst                        |  3 ++
> >  modules/generic_stage_target.py | 80 ++++++++++++++++++++---------------------
> >  2 files changed, 43 insertions(+), 40 deletions(-)
> >
> > diff --git a/catalyst b/catalyst
> > index 19ec77e..60cea3e 100755
> > --- a/catalyst
> > +++ b/catalyst
> > @@ -62,8 +62,11 @@ def parse_config(myconfig):
> >         config_file=""
> >
> >         confdefaults={
> > +               "distdir": "/usr/portage/distfiles",
> >                 "hash_function": "crc32",
> > +               "packagedir": "/usr/portage/packages",
> >                 "portdir": "/usr/portage",
> > +               "port_tmpdir": "/var/tmp/portage",
> >                 "repo_name": "portage",
> >                 "sharedir": "/usr/lib/catalyst",
> >                 "snapshot_name": "portage-",
> > diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
> > index c2888b6..342c65b 100644
> > --- a/modules/generic_stage_target.py
> > +++ b/modules/generic_stage_target.py
> > @@ -179,11 +179,11 @@ class generic_stage_target(generic_target):
> >                                 "/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
> >                                 "/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
> >                 else:
> > -                       self.mounts=["/proc","/dev","/usr/portage/distfiles","/var/tmp/portage"]
> > -                       self.mountmap={"/proc":"/proc","/dev":"/dev","/dev/pts":"/dev/pts",\
> > -                               "/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
> > +                       self.mounts=["proc","dev", "distdir", "port_tmpdir"]
> > +                       self.mountmap={"proc":"/proc", "dev":"/dev", "pts":"/dev/pts",
> > +                               "distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}
> >                 if os.uname()[0] == "Linux":
> > -                       self.mounts.append("/dev/pts")
> > +                       self.mounts.append("pts")
> >
> >                 self.set_mounts()
> >
> > @@ -195,16 +195,15 @@ class generic_stage_target(generic_target):
> >                         self.set_pkgcache_path()
> >                         print "Location of the package cache is "+\
> >                                 self.settings["pkgcache_path"]
> > -                       self.mounts.append("/usr/portage/packages")
> > -                       self.mountmap["/usr/portage/packages"]=\
> > -                               self.settings["pkgcache_path"]
> > +                       self.mounts.append("packagedir")
> > +                       self.mountmap["packagedir"] = self.settings["pkgcache_path"]
> >
> >                 if "KERNCACHE" in self.settings:
> >                         self.set_kerncache_path()
> >                         print "Location of the kerncache is "+\
> >                                 self.settings["kerncache_path"]
> > -                       self.mounts.append("/tmp/kerncache")
> > -                       self.mountmap["/tmp/kerncache"]=self.settings["kerncache_path"]
> > +                       self.mounts.append("kerncache")
> > +                       self.mountmap["kerncache"]=self.settings["kerncache_path"]
> >
> >                 if "CCACHE" in self.settings:
> >                         if "CCACHE_DIR" in os.environ:
> > @@ -216,8 +215,8 @@ class generic_stage_target(generic_target):
> >                                 raise CatalystError,\
> >                                         "Compiler cache support can't be enabled (can't find "+\
> >                                         ccdir+")"
> > -                       self.mounts.append("/var/tmp/ccache")
> > -                       self.mountmap["/var/tmp/ccache"]=ccdir
> > +                       self.mounts.append("ccache")
> > +                       self.mountmap["ccache"]=ccdir
> >                         """ for the chroot: """
> >                         self.env["CCACHE_DIR"]="/var/tmp/ccache"
> >
> > @@ -406,7 +405,7 @@ class generic_stage_target(generic_target):
> >
> >         def set_cleanables(self):
> >                 self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/tmp/*",\
> > -                       "/root/*","/usr/portage"]
> > +                       "/root/*", self.settings["portdir"]]
> >
> >         def set_snapshot_path(self):
> >                 self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
> > @@ -615,21 +614,21 @@ class generic_stage_target(generic_target):
> >                         return
> >
> >                 for x in self.mounts:
> > -                       if not os.path.exists(mypath+x):
> > +                       if not os.path.exists(mypath + self.mountmap[x]):
> >                                 continue
> >
> > -                       if ismount(mypath+x):
> > +                       if ismount(mypath +self.mountmap[x]):
> >                                 """ Something is still mounted "" """
> >                                 try:
> > -                                       print x+" is still mounted; performing auto-bind-umount...",
> > +                                       print self.mountmap[x] + " is still mounted; performing auto-bind-umount...",
> >                                         """ Try to umount stuff ourselves """
> >                                         self.unbind()
> > -                                       if ismount(mypath+x):
> > -                                               raise CatalystError, "Auto-unbind failed for "+x
> > +                                       if ismount(mypath + self.mountmap[x]):
> > +                                               raise CatalystError, "Auto-unbind failed for " + self.mountmap[x]
> >                                         else:
> >                                                 print "Auto-unbind successful..."
> >                                 except CatalystError:
> > -                                       raise CatalystError, "Unable to auto-unbind "+x
> > +                                       raise CatalystError, "Unable to auto-unbind " + self.mountmap[x]
> >
> >         def unpack(self):
> >                 unpack=True
> > @@ -787,7 +786,7 @@ class generic_stage_target(generic_target):
> >                                 print "Valid snapshot cache, skipping unpack of portage tree..."
> >                                 unpack=False
> >                 else:
> > -                       destdir=normpath(self.settings["chroot_path"]+"/usr/portage")
> > +                       destdir=normpath(self.settings["chroot_path"] + self.settings["portdir"])
> >                         cleanup_errmsg="Error removing existing snapshot directory."
> >                         cleanup_msg=\
> >                                 "Cleaning up existing portage tree (This can take a long time)..."
> > @@ -801,7 +800,7 @@ class generic_stage_target(generic_target):
> >
> >                         if "AUTORESUME" in self.settings \
> >                                 and os.path.exists(self.settings["chroot_path"]+\
> > -                                       "/usr/portage/") \
> > +                                       self.settings["portdir"]) \
> >                                 and os.path.exists(self.settings["autoresume_path"]\
> >                                         +"unpack_portage") \
> >                                 and self.settings["snapshot_path_hash"] == snapshot_hash:
> > @@ -848,7 +847,7 @@ class generic_stage_target(generic_target):
> >                         cmd("rm -f "+self.settings["chroot_path"]+"/etc/portage/make.profile",\
> >                                         "Error zapping profile link",env=self.env)
> >                         cmd("mkdir -p "+self.settings["chroot_path"]+"/etc/portage/")
> > -                       cmd("ln -sf ../../usr/portage/profiles/"+\
> > +                       cmd("ln -sf ../.." + self.settings["portdir"] + "/profiles/"+\
> >                                 self.settings["target_profile"]+" "+\
> >                                 self.settings["chroot_path"]+"/etc/portage/make.profile",\
> >                                 "Error creating profile link",env=self.env)
> > @@ -874,10 +873,10 @@ class generic_stage_target(generic_target):
> >                                 if os.path.exists(x):
> >                                         print "Copying overlay dir " +x
> >                                         cmd("mkdir -p "+self.settings["chroot_path"]+\
> > -                                               "/usr/local/portage",\
> > +                                               self.settings["local_overlay"],\
> >                                                 "Could not make portage_overlay dir",env=self.env)
> >                                         cmd("cp -R "+x+"/* "+self.settings["chroot_path"]+\
> > -                                               "/usr/local/portage",\
> > +                                               self.settings["local_overlay"],\
> >                                                 "Could not copy portage_overlay",env=self.env)
> >
> >         def root_overlay(self):
> > @@ -897,7 +896,7 @@ class generic_stage_target(generic_target):
> >
> >         def bind(self):
> >                 for x in self.mounts:
> > -                       if not os.path.exists(self.settings["chroot_path"]+x):
> > +                       if not os.path.exists(self.settings["chroot_path"] + self.mountmap[x]):
> >                                 os.makedirs(self.settings["chroot_path"]+x,0755)
> >
> >                         if not os.path.exists(self.mountmap[x]):
> > @@ -909,11 +908,11 @@ class generic_stage_target(generic_target):
> >                                 self.snapshot_lock_object.read_lock()
> >                         if os.uname()[0] == "FreeBSD":
> >                                 if src == "/dev":
> > -                                       retval=os.system("mount -t devfs none "+\
> > -                                               self.settings["chroot_path"]+x)
> > +                                       retval=os.system("mount -t devfs none " +
> > +                                               self.settings["chroot_path"] + src)
> >                                 else:
> > -                                       retval=os.system("mount_nullfs "+src+" "+\
> > -                                               self.settings["chroot_path"]+x)
> > +                                       retval=os.system("mount_nullfs " + src + " " +
> > +                                               self.settings["chroot_path"] + src)
> >                         else:
> >                                 if src == "tmpfs":
> >                                         if "var_tmpfs_portage" in self.settings:
> > @@ -921,11 +920,11 @@ class generic_stage_target(generic_target):
> >                                                         self.settings["var_tmpfs_portage"]+"G "+src+" "+\
> >                                                         self.settings["chroot_path"]+x)
> >                                 else:
> > -                                       retval=os.system("mount --bind "+src+" "+\
> > -                                               self.settings["chroot_path"]+x)
> > +                                       retval=os.system("mount --bind " + src + " " +
> > +                                               self.settings["chroot_path"] + src)
> >                         if retval!=0:
> >                                 self.unbind()
> > -                               raise CatalystError,"Couldn't bind mount "+src
> > +                               raise CatalystError,"Couldn't bind mount " + src
> >
> >         def unbind(self):
> >                 ouch=0
> > @@ -934,25 +933,26 @@ class generic_stage_target(generic_target):
> >                 myrevmounts.reverse()
> >                 """ Unmount in reverse order for nested bind-mounts """
> >                 for x in myrevmounts:
> > -                       if not os.path.exists(mypath+x):
> > +                       if not os.path.exists(mypath + self.mountmap[x]):
> >                                 continue
> >
> > -                       if not ismount(mypath+x):
> > +                       if not ismount(mypath + self.mountmap[x]):
> >                                 continue
> >
> >                         retval=os.system("umount "+\
> > -                               os.path.join(mypath,x.lstrip(os.path.sep)))
> > +                               os.path.join(mypath, self.mountmap[x].lstrip(os.path.sep)))
> >
> >                         if retval!=0:
> > -                               warn("First attempt to unmount: "+mypath+x+" failed.")
> > +                               warn("First attempt to unmount: " + mypath +
> > +                                       self.mountmap[x] +" failed.")
> >                                 warn("Killing any pids still running in the chroot")
> >
> >                                 self.kill_chroot_pids()
> >
> > -                               retval2=os.system("umount "+mypath+x)
> > +                               retval2=os.system("umount " + mypath + self.mountmap[x])
> >                                 if retval2!=0:
> >                                         ouch=1
> > -                                       warn("Couldn't umount bind mount: "+mypath+x)
> > +                                       warn("Couldn't umount bind mount: " + mypath + self.mountmap[x])
> >
> >                         if "SNAPCACHE" in self.settings and x == "/usr/portage":
> >                                 try:
> > @@ -1118,9 +1118,9 @@ class generic_stage_target(generic_target):
> >                                 "Could not replace /etc/hosts",env=self.env)
> >
> >                 """ Remove our overlay """
> > -               if os.path.exists(self.settings["chroot_path"]+"/usr/local/portage"):
> > -                       cmd("rm -rf "+self.settings["chroot_path"]+"/usr/local/portage",\
> > -                               "Could not remove /usr/local/portage",env=self.env)
> > +               if os.path.exists(self.settings["chroot_path"] + self.settings["local_overlay"]):
> > +                       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",\
> >                                 "Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
> > --
> > 1.8.3.2
> >
> >
> 
> There are piles of unrelated changes. :(

Yes, there are 2 distinct commits in one,  one is the mounts, mountmap
changes, the other is the migrate more hard coded paths.  The latter
changes the "/usr/local/portage" hard coding to using a setting
variable.  It was done before I found the feature in gitg that lets me
select individual lines to include in a commit.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 1/4] Add more configured defaults
  2013-12-14  4:51   ` Matt Turner
@ 2013-12-14 11:54     ` Brian Dolbec
  0 siblings, 0 replies; 79+ messages in thread
From: Brian Dolbec @ 2013-12-14 11:54 UTC (permalink / raw
  To: gentoo-catalyst@lists.gentoo.org

[-- Attachment #1: Type: text/plain, Size: 2852 bytes --]

On Fri, 2013-12-13 at 20:51 -0800, Matt Turner wrote:
> On Fri, Dec 13, 2013 at 7:07 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
> > Use the new configured snapshot_name and portdir settings
> > Use the portdir setting rather than hard-coded path
> > ---
> >  catalyst                        | 14 +++++++++-----
> >  modules/generic_stage_target.py |  6 ++++--
> >  modules/snapshot_target.py      | 14 +++++++++-----
> >  modules/tinderbox_target.py     |  4 ++--
> >  4 files changed, 24 insertions(+), 14 deletions(-)
> >
> > diff --git a/catalyst b/catalyst
> > index ba26f3c..19ec77e 100755
> > --- a/catalyst
> > +++ b/catalyst
> > @@ -61,11 +61,15 @@ def parse_config(myconfig):
> >         myconf={}
> >         config_file=""
> >
> > -       confdefaults={ "storedir":"/var/tmp/catalyst",\
> > -               "sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles",\
> > -               "portdir":"/usr/portage","options":"",\
> > -               "snapshot_cache":"/var/tmp/catalyst/snapshot_cache",\
> > -               "hash_function":"crc32"}
> > +       confdefaults={
> > +               "hash_function": "crc32",
> > +               "portdir": "/usr/portage",
> > +               "repo_name": "portage",
> > +               "sharedir": "/usr/lib/catalyst",
> > +               "snapshot_name": "portage-",
> > +               "snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
> > +               "storedir": "/var/tmp/catalyst",
> > +               }
> 
> I agree that adding a key:value to store "portage-" seems unnecessary.
> I don't think we should do this unless someone has a compelling
> reason.
> 

Reasons for the change:

1) it is bad design to have things hard-coded in many places throughout
the code.

2) this makes it one easy to edit and central place to change it.

3) I feel the name is incorrect and I intend to lobby for it to be
changed during the tree move from /usr/portage to the new location
somewhere in /var (bikeshedding likely to continue on the final location
once catalyst is actually capable of producing stages with and for the
moved tree. Which is _the_ reason I got started coding on catalyst in
the first place.).  I regard portage as the name of the package manager
and not the tree, the repo_name is "gentoo", not "portage".  Plus it is
likely to be less confusing for noobs first installing gentoo that get
confused between portage the package manager and portage the tree.


P.S. plus you didn't have to code it.  It has been done for you ;)


> Also, we lost "options" here. Is this intentional or consequential?
> 

likely another rebase error.  I did revamp the options system which had
duplications all through the code.  But I don't believe that should be
showing up here.


> > --
> > 1.8.3.2
> >
> >


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 1/4] Add more configured defaults
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 1/4] Add more configured defaults Brian Dolbec
  2013-12-14  4:12   ` Rick "Zero_Chaos" Farina
  2013-12-14  4:51   ` Matt Turner
@ 2013-12-14 14:33   ` Dylan Baker
  2013-12-14 16:31     ` W. Trevor King
  2013-12-15  0:05     ` W. Trevor King
  2 siblings, 2 replies; 79+ messages in thread
From: Dylan Baker @ 2013-12-14 14:33 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

[-- Attachment #1: Type: text/plain, Size: 5407 bytes --]

On Friday, December 13, 2013 07:07:13 PM Brian Dolbec wrote:
> Use the new configured snapshot_name and portdir settings
> Use the portdir setting rather than hard-coded path
> ---
>  catalyst                        | 14 +++++++++-----
>  modules/generic_stage_target.py |  6 ++++--
>  modules/snapshot_target.py      | 14 +++++++++-----
>  modules/tinderbox_target.py     |  4 ++--
>  4 files changed, 24 insertions(+), 14 deletions(-)
> 
> diff --git a/catalyst b/catalyst
> index ba26f3c..19ec77e 100755
> --- a/catalyst
> +++ b/catalyst
> @@ -61,11 +61,15 @@ def parse_config(myconfig):
>  	myconf={}
>  	config_file=""
> 
> -	confdefaults={ "storedir":"/var/tmp/catalyst",\
> -		"sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles",\
> -		"portdir":"/usr/portage","options":"",\
> -		"snapshot_cache":"/var/tmp/catalyst/snapshot_cache",\
> -		"hash_function":"crc32"}
> +	confdefaults={
> +		"hash_function": "crc32",
> +		"portdir": "/usr/portage",
> +		"repo_name": "portage",
> +		"sharedir": "/usr/lib/catalyst",
> +		"snapshot_name": "portage-",
> +		"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
> +		"storedir": "/var/tmp/catalyst",
> +		}

pleas keep the formatting style; no comma on the last element and closing 
brace on the same line

> 
>  	# first, try the one passed (presumably from the cmdline)
>  	if myconfig:
> diff --git a/modules/generic_stage_target.py
> b/modules/generic_stage_target.py index 848aca2..c2888b6 100644
> --- a/modules/generic_stage_target.py
> +++ b/modules/generic_stage_target.py
> @@ -410,7 +410,8 @@ class generic_stage_target(generic_target):
> 
>  	def set_snapshot_path(self):
>  		self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
> -			"/snapshots/portage-"+self.settings["snapshot"]+".tar.xz")
> +			"/snapshots/" + self.settings["snapshot_name"] +
> +			self.settings["snapshot"]+".tar.xz")

please be consistent with spaces between operators; follow whatever PEP8 says 
to do this case :)

I'd also suggest using the str.format() method instead of concatenating a 
large number of strings and variables, it's much more readable IMHO:
self.settings["snapshot_path"] = os.path.normpath(
	"{0}/snapshots/{1}{2}.tar.xz".format(
		self.settings["storedir"], self.settings["snapshot_name"],
		self.settings["snapshot"]))

> 
>  		if os.path.exists(self.settings["snapshot_path"]):
>  			self.settings["snapshot_path_hash"]=\
> @@ -418,7 +419,8 @@ class generic_stage_target(generic_target):
>  				hash_function=self.settings["hash_function"],verbose=False)
>  		else:
>  			
self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
> -				"/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2")
> +				"/snapshots/" + self.settings["snapshot_name"] +
> +				self.settings["snapshot"]+".tar.bz2")

see my previous comment

> 
>  			if os.path.exists(self.settings["snapshot_path"]):
>  				self.settings["snapshot_path_hash"]=\
> diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py
> index e93a86a..29d6e87 100644
> --- a/modules/snapshot_target.py
> +++ b/modules/snapshot_target.py
> @@ -18,8 +18,9 @@ class snapshot_target(generic_stage_target):
>  		self.settings=myspec
>  		self.settings["target_subpath"]="portage"
>  		st=self.settings["storedir"]
> -		
self.settings["snapshot_path"]=normpath(st+"/snapshots/portage-"+self.set
> tings["version_stamp"]\ -			+".tar.bz2")
> +		self.settings["snapshot_path"]=normpath(st + "/snapshots/"
> +			+ self.settings["snapshot_name"]
> +			+ self.settings["version_stamp"] + ".tar.bz2")

again

>  		
self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpa
> th"])
> 
>  	def setup(self):
> @@ -46,11 +47,14 @@ class snapshot_target(generic_stage_target):
>  		if not os.path.exists(mytmp):
>  			os.makedirs(mytmp)
> 
> -		cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/
> --exclude /local/ --exclude CVS/ --exclude .svn
> --filter=H_**/files/digest-* "+\ -			self.settings["portdir"]+"/
> "+mytmp+"/portage/","Snapshot failure",env=self.env) +		cmd("rsync -a
> --delete --exclude /packages/ --exclude /distfiles/ " + +			"--exclude
> /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* " +
> +			self.settings["portdir"] + "/ " + mytmp + "/%s/" %
> self.settings["repo_name"], +			"Snapshot failure",env=self.env)
> 
>  		print "Compressing Portage snapshot tarball..."
> -		cmd("tar -I lbzip2 -cf "+self.settings["snapshot_path"]+" -C 
"+mytmp+"
> portage",\ +		cmd("tar -I lbzip2 -cf " + 
self.settings["snapshot_path"] + "
> -C " + +			mytmp + " %s" % self.settings["repo_name"],
>  			"Snapshot creation failure",env=self.env)
> 
>  		self.gen_contents_file(self.settings["snapshot_path"])
> diff --git a/modules/tinderbox_target.py b/modules/tinderbox_target.py
> index 46fe082..d6d3ea3 100644
> --- a/modules/tinderbox_target.py
> +++ b/modules/tinderbox_target.py
> @@ -29,8 +29,8 @@ class tinderbox_target(generic_stage_target):
>  			raise CatalystError,"Tinderbox aborting due to error."
> 
>  	def set_cleanables(self):
> -	   
> self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",\
> -					"/usr/portage"]
> +	   
> self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",
> +					self.settings['portdir']]

spaces between the elements of a list pls.

> 
>  	def set_action_sequence(self):
>  		#Default action sequence for run method

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths.
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths Brian Dolbec
  2013-12-14  4:26   ` Rick "Zero_Chaos" Farina
  2013-12-14  5:08   ` Matt Turner
@ 2013-12-14 14:51   ` Dylan Baker
  2013-12-14 16:42     ` W. Trevor King
  2 siblings, 1 reply; 79+ messages in thread
From: Dylan Baker @ 2013-12-14 14:51 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

[-- Attachment #1: Type: text/plain, Size: 10392 bytes --]

On Friday, December 13, 2013 07:07:14 PM Brian Dolbec wrote:
> Migrate more hardcoded paths to use settings variables instead.
> ---
>  catalyst                        |  3 ++
>  modules/generic_stage_target.py | 80
> ++++++++++++++++++++--------------------- 2 files changed, 43
> insertions(+), 40 deletions(-)
> 
> diff --git a/catalyst b/catalyst
> index 19ec77e..60cea3e 100755
> --- a/catalyst
> +++ b/catalyst
> @@ -62,8 +62,11 @@ def parse_config(myconfig):
>  	config_file=""
> 
>  	confdefaults={
> +		"distdir": "/usr/portage/distfiles",
>  		"hash_function": "crc32",
> +		"packagedir": "/usr/portage/packages",
>  		"portdir": "/usr/portage",
> +		"port_tmpdir": "/var/tmp/portage",
>  		"repo_name": "portage",
>  		"sharedir": "/usr/lib/catalyst",
>  		"snapshot_name": "portage-",
> diff --git a/modules/generic_stage_target.py
> b/modules/generic_stage_target.py index c2888b6..342c65b 100644
> --- a/modules/generic_stage_target.py
> +++ b/modules/generic_stage_target.py
> @@ -179,11 +179,11 @@ class generic_stage_target(generic_target):
>  				
"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
>  				
"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"t
> mpfs"} else:
> -			
self.mounts=["/proc","/dev","/usr/portage/distfiles","/var/tmp/portage"]
> -			
self.mountmap={"/proc":"/proc","/dev":"/dev","/dev/pts":"/dev/pts",\
> -				
"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"
> tmpfs"} 
> +			self.mounts=["proc","dev", "distdir", "port_tmpdir"]
> +			self.mountmap={"proc":"/proc", "dev":"/dev", "pts":"/dev/pts",
> +				"distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}

This is work for a seperate patch, but let's kill the self.mounts and replace 
it's use with self.mountmap.iterkeys()

>  		if os.uname()[0] == "Linux":
> -			self.mounts.append("/dev/pts")
> +			self.mounts.append("pts")
> 
>  		self.set_mounts()
> 
> @@ -195,16 +195,15 @@ class generic_stage_target(generic_target):
>  			self.set_pkgcache_path()
>  			print "Location of the package cache is "+\
>  				self.settings["pkgcache_path"]
> -			self.mounts.append("/usr/portage/packages")
> -			self.mountmap["/usr/portage/packages"]=\
> -				self.settings["pkgcache_path"]
> +			self.mounts.append("packagedir")
> +			self.mountmap["packagedir"] = self.settings["pkgcache_path"]
> 
>  		if "KERNCACHE" in self.settings:
>  			self.set_kerncache_path()
>  			print "Location of the kerncache is "+\
>  				self.settings["kerncache_path"]
> -			self.mounts.append("/tmp/kerncache")
> -			self.mountmap["/tmp/kerncache"]=self.settings["kerncache_path"]
> +			self.mounts.append("kerncache")
> +			self.mountmap["kerncache"]=self.settings["kerncache_path"]
> 
>  		if "CCACHE" in self.settings:
>  			if "CCACHE_DIR" in os.environ:
> @@ -216,8 +215,8 @@ class generic_stage_target(generic_target):
>  				raise CatalystError,\
>  					"Compiler cache support can't be enabled (can't find "+\
>  					ccdir+")"
> -			self.mounts.append("/var/tmp/ccache")
> -			self.mountmap["/var/tmp/ccache"]=ccdir
> +			self.mounts.append("ccache")
> +			self.mountmap["ccache"]=ccdir
>  			""" for the chroot: """
>  			self.env["CCACHE_DIR"]="/var/tmp/ccache"
> 
> @@ -406,7 +405,7 @@ class generic_stage_target(generic_target):
> 
>  	def set_cleanables(self):
>  		
self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/tmp/*",\
> -			"/root/*","/usr/portage"]
> +			"/root/*", self.settings["portdir"]]
> 
>  	def set_snapshot_path(self):
>  		self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
> @@ -615,21 +614,21 @@ class generic_stage_target(generic_target):
>  			return
> 
>  		for x in self.mounts:
> -			if not os.path.exists(mypath+x):
> +			if not os.path.exists(mypath + self.mountmap[x]):
>  				continue
> 
> -			if ismount(mypath+x):
> +			if ismount(mypath +self.mountmap[x]):

add a space after the '+' operator

>  				""" Something is still mounted "" """
>  				try:
> -					print x+" is still mounted; performing auto-bind-
umount...",
> +					print self.mountmap[x] + " is still mounted; performing
> auto-bind-umount...", """ Try to umount stuff ourselves """
>  					self.unbind()
> -					if ismount(mypath+x):
> -						raise CatalystError, "Auto-unbind failed for "+x
> +					if ismount(mypath + self.mountmap[x]):
> +						raise CatalystError, "Auto-unbind failed for " + 
self.mountmap[x]
>  					else:
>  						print "Auto-unbind successful..."
>  				except CatalystError:
> -					raise CatalystError, "Unable to auto-unbind "+x
> +					raise CatalystError, "Unable to auto-unbind " + 
self.mountmap[x]
> 
>  	def unpack(self):
>  		unpack=True
> @@ -787,7 +786,7 @@ class generic_stage_target(generic_target):
>  				print "Valid snapshot cache, skipping unpack of portage 
tree..."
>  				unpack=False
>  		else:
> -			destdir=normpath(self.settings["chroot_path"]+"/usr/portage")
> +			destdir=normpath(self.settings["chroot_path"] +

add a space after the '=' operator

There's more of this. please look through and add spaces beteen all of the 
operators, at least on the lines you've touched. This is standard python 
coding style and adhering to it makes all of our lives easier :)

> self.settings["portdir"]) cleanup_errmsg="Error removing existing snapshot
> directory."
>  			cleanup_msg=\
>  				"Cleaning up existing portage tree (This can take a long 
time)..."
> @@ -801,7 +800,7 @@ class generic_stage_target(generic_target):
> 
>  			if "AUTORESUME" in self.settings \
>  				and os.path.exists(self.settings["chroot_path"]+\
> -					"/usr/portage/") \
> +					self.settings["portdir"]) \
>  				and os.path.exists(self.settings["autoresume_path"]\
>  					+"unpack_portage") \

>  				and self.settings["snapshot_path_hash"] == snapshot_hash:
> @@ -848,7 +847,7 @@ class generic_stage_target(generic_target):
>  			cmd("rm -f 
"+self.settings["chroot_path"]+"/etc/portage/make.profile",\
>  					"Error zapping profile link",env=self.env)
>  			cmd("mkdir -p "+self.settings["chroot_path"]+"/etc/portage/")
> -			cmd("ln -sf ../../usr/portage/profiles/"+\
> +			cmd("ln -sf ../.." + self.settings["portdir"] + "/profiles/"+\
>  				self.settings["target_profile"]+" "+\
>  				self.settings["chroot_path"]+"/etc/portage/make.profile",\
>  				"Error creating profile link",env=self.env)
> @@ -874,10 +873,10 @@ class generic_stage_target(generic_target):
>  				if os.path.exists(x):
>  					print "Copying overlay dir " +x
>  					cmd("mkdir -p "+self.settings["chroot_path"]+\
> -						"/usr/local/portage",\
> +						self.settings["local_overlay"],\
>  						"Could not make portage_overlay dir",env=self.env)
>  					cmd("cp -R "+x+"/* "+self.settings["chroot_path"]+\
> -						"/usr/local/portage",\
> +						self.settings["local_overlay"],\
>  						"Could not copy portage_overlay",env=self.env)
> 
>  	def root_overlay(self):
> @@ -897,7 +896,7 @@ class generic_stage_target(generic_target):
> 
>  	def bind(self):
>  		for x in self.mounts:
> -			if not os.path.exists(self.settings["chroot_path"]+x):
> +			if not os.path.exists(self.settings["chroot_path"] + 
self.mountmap[x]):
>  				os.makedirs(self.settings["chroot_path"]+x,0755)
> 
>  			if not os.path.exists(self.mountmap[x]):
> @@ -909,11 +908,11 @@ class generic_stage_target(generic_target):
>  				self.snapshot_lock_object.read_lock()
>  			if os.uname()[0] == "FreeBSD":
>  				if src == "/dev":
> -					retval=os.system("mount -t devfs none "+\
> -						self.settings["chroot_path"]+x)
> +					retval=os.system("mount -t devfs none " +
> +						self.settings["chroot_path"] + src)
>  				else:
> -					retval=os.system("mount_nullfs "+src+" "+\
> -						self.settings["chroot_path"]+x)
> +					retval=os.system("mount_nullfs " + src + " " +
> +						self.settings["chroot_path"] + src)
>  			else:
>  				if src == "tmpfs":
>  					if "var_tmpfs_portage" in self.settings:
> @@ -921,11 +920,11 @@ class generic_stage_target(generic_target):
>  							self.settings["var_tmpfs_portage"]+"G "+src+" "+\
>  							self.settings["chroot_path"]+x)
>  				else:
> -					retval=os.system("mount --bind "+src+" "+\
> -						self.settings["chroot_path"]+x)
> +					retval=os.system("mount --bind " + src + " " +
> +						self.settings["chroot_path"] + src)
>  			if retval!=0:
>  				self.unbind()
> -				raise CatalystError,"Couldn't bind mount "+src
> +				raise CatalystError,"Couldn't bind mount " + src
> 
>  	def unbind(self):
>  		ouch=0
> @@ -934,25 +933,26 @@ class generic_stage_target(generic_target):
>  		myrevmounts.reverse()
>  		""" Unmount in reverse order for nested bind-mounts """
>  		for x in myrevmounts:
> -			if not os.path.exists(mypath+x):
> +			if not os.path.exists(mypath + self.mountmap[x]):
>  				continue
> 
> -			if not ismount(mypath+x):
> +			if not ismount(mypath + self.mountmap[x]):
>  				continue
> 
>  			retval=os.system("umount "+\
> -				os.path.join(mypath,x.lstrip(os.path.sep)))
> +				os.path.join(mypath, self.mountmap[x].lstrip(os.path.sep)))
> 
>  			if retval!=0:
> -				warn("First attempt to unmount: "+mypath+x+" failed.")
> +				warn("First attempt to unmount: " + mypath +
> +					self.mountmap[x] +" failed.")
>  				warn("Killing any pids still running in the chroot")
> 
>  				self.kill_chroot_pids()
> 
> -				retval2=os.system("umount "+mypath+x)
> +				retval2=os.system("umount " + mypath + self.mountmap[x])
>  				if retval2!=0:
>  					ouch=1
> -					warn("Couldn't umount bind mount: "+mypath+x)
> +					warn("Couldn't umount bind mount: " + mypath + 
self.mountmap[x])
> 
>  			if "SNAPCACHE" in self.settings and x == "/usr/portage":
>  				try:
> @@ -1118,9 +1118,9 @@ class generic_stage_target(generic_target):
>  				"Could not replace /etc/hosts",env=self.env)
> 
>  		""" Remove our overlay """
> -		if os.path.exists(self.settings["chroot_path"]+"/usr/local/portage"):
> -			cmd("rm -rf "+self.settings["chroot_path"]+"/usr/local/portage",\
> -				"Could not remove /usr/local/portage",env=self.env)
> +		if os.path.exists(self.settings["chroot_path"] +
> self.settings["local_overlay"]): +			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",\
>  				"Could not remove PORTDIR_OVERLAY from 
make.conf",env=self.env)

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 3/4] Adapt commit c52962b6bd2 to use the new configured settings values.
  2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 3/4] Adapt commit c52962b6bd2 to use the new configured settings values Brian Dolbec
  2013-12-14  4:59   ` Dustin C. Hatch
@ 2013-12-14 14:54   ` Dylan Baker
  2013-12-14 16:07     ` Dylan Baker
  2013-12-14 16:22     ` Brian Dolbec
  1 sibling, 2 replies; 79+ messages in thread
From: Dylan Baker @ 2013-12-14 14:54 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

[-- Attachment #1: Type: text/plain, Size: 1091 bytes --]

On Friday, December 13, 2013 07:07:15 PM Brian Dolbec wrote:
> ---
>  modules/generic_stage_target.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/modules/generic_stage_target.py
> b/modules/generic_stage_target.py index 342c65b..1fbc733 100644
> --- a/modules/generic_stage_target.py
> +++ b/modules/generic_stage_target.py
> @@ -1066,9 +1066,9 @@ class generic_stage_target(generic_target):
>  						"/use will cause portage to ignore"
>  					print "\tpackage.use in the profile and portage_confdir. 
You've been
> warned!"
> 
> -			myf.write('PORTDIR="/usr/portage"\n')
> -			myf.write('DISTDIR="${PORTDIR}/distfiles"\n')
> -			myf.write('PKGDIR="${PORTDIR}/packages"\n')
> +			myf.write('PORTDIR="%s"\n' % self.settings['portdir'])
> +			myf.write('DISTDIR="%s"\n' % self.settings['distdir'])
> +			myf.write('PKGDIR="%s"\n' % self.settings['packagedir'])

what is the point of this? These produce exactly the same output, except the 
previous is more readable.

> 
>  			""" Setup the portage overlay """
>  			if "portage_overlay" in self.settings:

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 4/4] cleanup long lines, improve usage() output formatting slightly
  2013-12-14  6:21     ` Brian Dolbec
@ 2013-12-14 14:56       ` Dylan Baker
  2013-12-14 16:02         ` Brian Dolbec
  0 siblings, 1 reply; 79+ messages in thread
From: Dylan Baker @ 2013-12-14 14:56 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec, Matt Turner

[-- Attachment #1: Type: text/plain, Size: 1014 bytes --]

On Friday, December 13, 2013 10:21:20 PM Brian Dolbec wrote:
> On Fri, 2013-12-13 at 21:14 -0800, Matt Turner wrote:
> > On Fri, Dec 13, 2013 at 7:07 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
> > > -                       print "Using command line specified Catalyst
> > > configuration file, "+myconfig +                       print "Using
> > > command line specified Catalyst configuration file, "+\> 
> > No need to add \
> > 
> > (same comment applies elsewhere)
> 
> General rule is if you are making something multiline, it needs to be
> enclosed in ()'s or []'s, etc..  I'm quite certain that the old print
> statement needs the line continuation "\" symbol since there are no ()'s
> enclosing all blocks to be printed.  That may have changed at some point
> so that it is not required in more recent python versions.  Actually
> when using the newer python()  you don't even need to use + between
> blocks of text on multiple lines.

You are perfectly free to use () with the print keyword in python 2.x

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 4/4] cleanup long lines, improve usage() output formatting slightly
  2013-12-14 14:56       ` Dylan Baker
@ 2013-12-14 16:02         ` Brian Dolbec
  0 siblings, 0 replies; 79+ messages in thread
From: Brian Dolbec @ 2013-12-14 16:02 UTC (permalink / raw
  To: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 1357 bytes --]

On Sat, 2013-12-14 at 06:56 -0800, Dylan Baker wrote:
> On Friday, December 13, 2013 10:21:20 PM Brian Dolbec wrote:
> > On Fri, 2013-12-13 at 21:14 -0800, Matt Turner wrote:
> > > On Fri, Dec 13, 2013 at 7:07 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
> > > > -                       print "Using command line specified Catalyst
> > > > configuration file, "+myconfig +                       print "Using
> > > > command line specified Catalyst configuration file, "+\> 
> > > No need to add \
> > > 
> > > (same comment applies elsewhere)
> > 
> > General rule is if you are making something multiline, it needs to be
> > enclosed in ()'s or []'s, etc..  I'm quite certain that the old print
> > statement needs the line continuation "\" symbol since there are no ()'s
> > enclosing all blocks to be printed.  That may have changed at some point
> > so that it is not required in more recent python versions.  Actually
> > when using the newer python()  you don't even need to use + between
> > blocks of text on multiple lines.
> 
> You are perfectly free to use () with the print keyword in python 2.x

That is also a py3 compatibility change.  So I WAS trying to keep that
separate and done after the main mess was cleaned up.


{and can everyone try to do list replies only, we don't need multiple
copies of the same mail}

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 3/4] Adapt commit c52962b6bd2 to use the new configured settings values.
  2013-12-14 14:54   ` Dylan Baker
@ 2013-12-14 16:07     ` Dylan Baker
  2013-12-14 16:22     ` Brian Dolbec
  1 sibling, 0 replies; 79+ messages in thread
From: Dylan Baker @ 2013-12-14 16:07 UTC (permalink / raw
  To: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 1539 bytes --]

Please ignore my last email. I should drink my coffee *before* I begin
reviewing patches.


On Sat, Dec 14, 2013 at 6:54 AM, Dylan Baker <baker.dylan.c@gmail.com>wrote:

> On Friday, December 13, 2013 07:07:15 PM Brian Dolbec wrote:
> > ---
> >  modules/generic_stage_target.py | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/modules/generic_stage_target.py
> > b/modules/generic_stage_target.py index 342c65b..1fbc733 100644
> > --- a/modules/generic_stage_target.py
> > +++ b/modules/generic_stage_target.py
> > @@ -1066,9 +1066,9 @@ class generic_stage_target(generic_target):
> >                                               "/use will cause portage
> to ignore"
> >                                       print "\tpackage.use in the
> profile and portage_confdir.
> You've been
> > warned!"
> >
> > -                     myf.write('PORTDIR="/usr/portage"\n')
> > -                     myf.write('DISTDIR="${PORTDIR}/distfiles"\n')
> > -                     myf.write('PKGDIR="${PORTDIR}/packages"\n')
> > +                     myf.write('PORTDIR="%s"\n' %
> self.settings['portdir'])
> > +                     myf.write('DISTDIR="%s"\n' %
> self.settings['distdir'])
> > +                     myf.write('PKGDIR="%s"\n' %
> self.settings['packagedir'])
>
> what is the point of this? These produce exactly the same output, except
> the
> previous is more readable.
>
> >
> >                       """ Setup the portage overlay """
> >                       if "portage_overlay" in self.settings:
>

[-- Attachment #2: Type: text/html, Size: 2273 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 3/4] Adapt commit c52962b6bd2 to use the new configured settings values.
  2013-12-14 14:54   ` Dylan Baker
  2013-12-14 16:07     ` Dylan Baker
@ 2013-12-14 16:22     ` Brian Dolbec
  1 sibling, 0 replies; 79+ messages in thread
From: Brian Dolbec @ 2013-12-14 16:22 UTC (permalink / raw
  To: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 1491 bytes --]

On Sat, 2013-12-14 at 06:54 -0800, Dylan Baker wrote:
> On Friday, December 13, 2013 07:07:15 PM Brian Dolbec wrote:
> > ---
> >  modules/generic_stage_target.py | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/modules/generic_stage_target.py
> > b/modules/generic_stage_target.py index 342c65b..1fbc733 100644
> > --- a/modules/generic_stage_target.py
> > +++ b/modules/generic_stage_target.py
> > @@ -1066,9 +1066,9 @@ class generic_stage_target(generic_target):
> >  						"/use will cause portage to ignore"
> >  					print "\tpackage.use in the profile and portage_confdir. 
> You've been
> > warned!"
> > 
> > -			myf.write('PORTDIR="/usr/portage"\n')
> > -			myf.write('DISTDIR="${PORTDIR}/distfiles"\n')
> > -			myf.write('PKGDIR="${PORTDIR}/packages"\n')
> > +			myf.write('PORTDIR="%s"\n' % self.settings['portdir'])
> > +			myf.write('DISTDIR="%s"\n' % self.settings['distdir'])
> > +			myf.write('PKGDIR="%s"\n' % self.settings['packagedir'])
> 
> what is the point of this? These produce exactly the same output, except the 
> previous is more readable.
> 
Sure it is more readable in that one spot. BUT...
The point is the entire reason for the whole re-write I started in the
first place.  Removing hard coded paths scattered throughout the code.
Putting them in one easily modified and maintainable place. 

> > 
> >  			""" Setup the portage overlay """
> >  			if "portage_overlay" in self.settings:


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 1/4] Add more configured defaults
  2013-12-14 14:33   ` Dylan Baker
@ 2013-12-14 16:31     ` W. Trevor King
  2013-12-15  0:05     ` W. Trevor King
  1 sibling, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 16:31 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]

On Sat, Dec 14, 2013 at 06:33:43AM -0800, Dylan Baker wrote:
> On Friday, December 13, 2013 07:07:13 PM Brian Dolbec wrote:
> > -	confdefaults={ "storedir":"/var/tmp/catalyst",\
> > -		"sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles",\
> > -		"portdir":"/usr/portage","options":"",\
> > -		"snapshot_cache":"/var/tmp/catalyst/snapshot_cache",\
> > -		"hash_function":"crc32"}
> > +	confdefaults={
> > +		"hash_function": "crc32",
> > +		"portdir": "/usr/portage",
> > +		"repo_name": "portage",
> > +		"sharedir": "/usr/lib/catalyst",
> > +		"snapshot_name": "portage-",
> > +		"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
> > +		"storedir": "/var/tmp/catalyst",
> > +		}
> 
> pleas keep the formatting style; no comma on the last element and
> closing brace on the same line

The “one entry per line, comma after last element, separate brace
lines” format is both easier to read and easier to diff.  All the keys
are lined up in an alphabetized column for you, and if you add
something after storedir entry, you don't have to touch the storedir
line to remove a closing brace and add a comma.

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths.
  2013-12-14 11:15     ` Brian Dolbec
@ 2013-12-14 16:37       ` W. Trevor King
  2013-12-14 18:05         ` W. Trevor King
  0 siblings, 1 reply; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 16:37 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Matt Turner

[-- Attachment #1: Type: text/plain, Size: 1618 bytes --]

On Sat, Dec 14, 2013 at 03:15:42AM -0800, Brian Dolbec wrote:
> On Fri, 2013-12-13 at 21:08 -0800, Matt Turner wrote:
> > On Fri, Dec 13, 2013 at 7:07 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
> > > Migrate more hardcoded paths to use settings variables instead.
> > 
> > I can't really make any sense of the commit title, 
> 
> This is the full commit message in git:
> 
> Remove self.mounts and self.mountmap's use of paths for keys and paths.
> 
> Migrate more hardcoded paths to use settings variables instead.
> ---------------
> 
> git send-email broke it up, using the first line as the subject, the
> other lines are included in the main text body.

`git log --oneline` will also only use the first line of the commit
message, so it's nice to have it make sense.  I don't think the
current version reads too badly, but perhaps:

  Don't use paths as mountmap keys

would cover it more succinctly?

> > and it'd be preferable to do one path per patch.
> 
> Re-coding that mounts and mountmap mess was hard enough and required
> lots of testing, fixing to get it correct and working.  Splitting it
> up even more is an exercise in futility.

I'm playing around with this now ;).  We'll see if I can get the
commits reshuffled and preserve the same tree hash as Brian's a1f054e [1].

Cheers,
Trevor

[1]: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=a1f054e5efaec3877a964e6a72410b5bbee9c03b

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths.
  2013-12-14 14:51   ` [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths Dylan Baker
@ 2013-12-14 16:42     ` W. Trevor King
  2013-12-14 21:31       ` Dustin C. Hatch
  0 siblings, 1 reply; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 16:42 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]

On Sat, Dec 14, 2013 at 06:51:45AM -0800, Dylan Baker wrote:
> This is work for a seperate patch, but let's kill the self.mounts
> and replace it's use with self.mountmap.iterkeys()

So fill in mountmap with everything possible, and then pull keys out
of it if you don't need them?  Currently mountmap is “where would you
like ‘x’ mounted?” and mounts is “would you like ‘x’ mounted?”.  Those
seem separate enough that two attributes isn't crazy ;).

> > -			destdir=normpath(self.settings["chroot_path"]+"/usr/portage")
> > +			destdir=normpath(self.settings["chroot_path"] +
> 
> add a space after the '=' operator
> 
> There's more of this. please look through and add spaces beteen all
> of the operators, at least on the lines you've touched. This is
> standard python coding style and adhering to it makes all of our
> lives easier :)

The current code base is so far from PEP 8 that changing touched
sections to match PEP 8 looks really out of place.  In this instance
it's probably fine, but I'd ok with putting off all/most PEP 8
cleanups to their own pure-reformatting commits.

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths.
  2013-12-14 16:37       ` W. Trevor King
@ 2013-12-14 18:05         ` W. Trevor King
  2013-12-14 18:44           ` Matt Turner
  0 siblings, 1 reply; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 18:05 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Matt Turner

[-- Attachment #1: Type: text/plain, Size: 6325 bytes --]

On Sat, Dec 14, 2013 at 08:37:14AM -0800, W. Trevor King wrote:
> On Sat, Dec 14, 2013 at 03:15:42AM -0800, Brian Dolbec wrote:
> > On Fri, 2013-12-13 at 21:08 -0800, Matt Turner wrote:
> > > and it'd be preferable to do one path per patch.
> > 
> > Re-coding that mounts and mountmap mess was hard enough and
> > required lots of testing, fixing to get it correct and working.
> > Splitting it up even more is an exercise in
>
> I'm playing around with this now ;).  We'll see if I can get the
> commits reshuffled and preserve the same tree hash as Brian's
> a1f054e [1].

Ok, I've refactored the Git history up to a1f054e.  Here's the diff
vs. a1f054e:

  $ git diff a1f054e..wking/dolsen-rewrite-part-1
  diff --git a/catalyst b/catalyst
  index a68a2ba..ebda844 100755
  --- a/catalyst
  +++ b/catalyst
  @@ -66,11 +66,12 @@ def parse_config(myconfig):
          confdefaults={
                  "distdir": "/usr/portage/distfiles",
                  "hash_function": "crc32",
  +               "options": "",
                  "packagedir": "/usr/portage/packages",
                  "portdir": "/usr/portage",
                  "port_tmpdir": "/var/tmp/portage",
                  "repo_name": "portage",
  -               "sharedir": "/usr/lib/catalyst",
  +               "sharedir": "/usr/share/catalyst",
                  "snapshot_name": "portage-",
                  "snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
                  "storedir": "/var/tmp/catalyst",
  diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
  index 1fbc733..800ddfa 100644
  --- a/modules/generic_stage_target.py
  +++ b/modules/generic_stage_target.py
  @@ -179,11 +179,11 @@ class generic_stage_target(generic_target):
                                  "/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
                                  "/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
                  else:
  -                       self.mounts=["proc","dev", "distdir", "port_tmpdir"]
  -                       self.mountmap={"proc":"/proc", "dev":"/dev", "pts":"/dev/pts",
  +                       self.mounts=["proc", "dev", "distdir", "port_tmpdir"]
  +                       self.mountmap={"proc":"/proc", "dev":"/dev", "devpts":"/dev/pts",
                                  "distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}
                  if os.uname()[0] == "Linux":
  -                       self.mounts.append("pts")
  +                       self.mounts.append("devpts")

                  self.set_mounts()

  diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py
  index 29d6e87..9e65c24 100644
  --- a/modules/snapshot_target.py
  +++ b/modules/snapshot_target.py
  @@ -54,7 +54,7 @@ class snapshot_target(generic_stage_target):

                  print "Compressing Portage snapshot tarball..."
                  cmd("tar -I lbzip2 -cf " + self.settings["snapshot_path"] + " -C " +
  -                       mytmp + " %s" % self.settings["repo_name"],
  +                       mytmp + " " + self.settings["repo_name"],
                          "Snapshot creation failure",env=self.env)

                  self.gen_contents_file(self.settings["snapshot_path"])

And here's the request-pull:

  $ git request-pull origin/master wking wking/dolsen-rewrite-part-1
  The following changes since commit 1c86c64113491885b159529dacb452ce6a3e5f4b:

    catalyst 2.0.15 (2013-11-13 13:59:25 -0800)

  are available in the git repository at:

    git://tremily.us/catalyst.git dolsen-rewrite-part-1

  for you to fetch changes up to 907c35fb1e1cae75cc78d45b054c3c43ac9deb48:

    cleanup long lines, improve usage() output formatting slightly (2013-12-14 09:48:22 -0800)

  ----------------------------------------------------------------
  Brian Dolbec (20):
        modules/tinderbox_target.py: Use 'portdir' instead of hard-coding '/usr/portage'
        modules/generic_stage_target.py: Use 'portdir' instead of hard-coding '/usr/portage'
        modules/generic_stage_target.py: Use 'portdir' instead of hard-coding '/usr/portage'
        modules/generic_stage_target.py: Use 'distdir' instead of hard-coding '${PORTAGE}/distfiles'
        modules/generic_stage_target.py: Use a 'local_overlay' setting instead of hard-coding '/usr/local/portage'
        catalyst: Split confdefaults into line-per-entry
        catalyst: Add 'repo_name' default
        catalyst: Add 'snapshot_name' default
        catalyst: Add 'packagedir' default instead of hard-coding '/usr/portage/packages'
        catalyst: Add 'port_tmpdir' default instead of hard-coding '/var/tmp/portage'
        modules/generic_stage_target.py: Don't use paths as mountmap keys
        modules/generic_stage_target.py: Use 'proc' instead of '/proc' as the mountmap key
        modules/generic_stage_target.py: Use 'dev' instead of '/dev' as the mountmap key
        modules/generic_stage_target.py: Use 'distdir' instead of '/usr/portage/distfiles' as the mountmap key
        modules/generic_stage_target.py: Use 'port_tmpdir' instead of '/var/tmp/portage' as the mountmap key
        modules/generic_stage_target.py: Use 'devpts' instead of '/dev/pts' as the mountmap key
        modules/generic_stage_target.py: Use 'packagedir' instead of '/usr/portage/packages' as the mountmap key
        modules/generic_stage_target.py: Use 'kerncache' instead of '/tmp/kerncache' as the mountmap key
        modules/generic_stage_target.py: Use 'ccache' instead of '/var/tmp/ccache' as the mountmap key
        cleanup long lines, improve usage() output formatting slightly

   catalyst                        | 101 ++++++++++++++++++++++++----------------
   modules/generic_stage_target.py |  92 ++++++++++++++++++------------------
   modules/snapshot_target.py      |  14 ++++--
   modules/tinderbox_target.py     |   4 +-
   4 files changed, 119 insertions(+), 92 deletions(-)

I can submit them to the list via `git send-email` if you'd like, just
let me know.

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths.
  2013-12-14 18:05         ` W. Trevor King
@ 2013-12-14 18:44           ` Matt Turner
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
  0 siblings, 1 reply; 79+ messages in thread
From: Matt Turner @ 2013-12-14 18:44 UTC (permalink / raw
  To: gentoo-catalyst

On Sat, Dec 14, 2013 at 10:05 AM, W. Trevor King <wking@tremily.us> wrote:
>> On Sat, Dec 14, 2013 at 03:15:42AM -0800, Brian Dolbec wrote:
> And here's the request-pull:
>
>   $ git request-pull origin/master wking wking/dolsen-rewrite-part-1
>   The following changes since commit 1c86c64113491885b159529dacb452ce6a3e5f4b:
>
>     catalyst 2.0.15 (2013-11-13 13:59:25 -0800)
>
>   are available in the git repository at:
>
>     git://tremily.us/catalyst.git dolsen-rewrite-part-1
>
>   for you to fetch changes up to 907c35fb1e1cae75cc78d45b054c3c43ac9deb48:
>
>     cleanup long lines, improve usage() output formatting slightly (2013-12-14 09:48:22 -0800)
>
>   ----------------------------------------------------------------
>   Brian Dolbec (20):
>         modules/tinderbox_target.py: Use 'portdir' instead of hard-coding '/usr/portage'
>         modules/generic_stage_target.py: Use 'portdir' instead of hard-coding '/usr/portage'
>         modules/generic_stage_target.py: Use 'portdir' instead of hard-coding '/usr/portage'
>         modules/generic_stage_target.py: Use 'distdir' instead of hard-coding '${PORTAGE}/distfiles'
>         modules/generic_stage_target.py: Use a 'local_overlay' setting instead of hard-coding '/usr/local/portage'
>         catalyst: Split confdefaults into line-per-entry
>         catalyst: Add 'repo_name' default
>         catalyst: Add 'snapshot_name' default
>         catalyst: Add 'packagedir' default instead of hard-coding '/usr/portage/packages'
>         catalyst: Add 'port_tmpdir' default instead of hard-coding '/var/tmp/portage'
>         modules/generic_stage_target.py: Don't use paths as mountmap keys
>         modules/generic_stage_target.py: Use 'proc' instead of '/proc' as the mountmap key
>         modules/generic_stage_target.py: Use 'dev' instead of '/dev' as the mountmap key
>         modules/generic_stage_target.py: Use 'distdir' instead of '/usr/portage/distfiles' as the mountmap key
>         modules/generic_stage_target.py: Use 'port_tmpdir' instead of '/var/tmp/portage' as the mountmap key
>         modules/generic_stage_target.py: Use 'devpts' instead of '/dev/pts' as the mountmap key
>         modules/generic_stage_target.py: Use 'packagedir' instead of '/usr/portage/packages' as the mountmap key
>         modules/generic_stage_target.py: Use 'kerncache' instead of '/tmp/kerncache' as the mountmap key
>         modules/generic_stage_target.py: Use 'ccache' instead of '/var/tmp/ccache' as the mountmap key
>         cleanup long lines, improve usage() output formatting slightly
>
>    catalyst                        | 101 ++++++++++++++++++++++++----------------
>    modules/generic_stage_target.py |  92 ++++++++++++++++++------------------
>    modules/snapshot_target.py      |  14 ++++--
>    modules/tinderbox_target.py     |   4 +-
>    4 files changed, 119 insertions(+), 92 deletions(-)
>
> I can submit them to the list via `git send-email` if you'd like, just
> let me know.
>
> Cheers,
> Trevor

Awesome, thanks for doing this. This is exactly how this patch series
should look and was super easy to review. I feel they're basically
ready to go, but I want everyone to be in the habit of sending patches
to the list, so please do.

Preemptive review: I saw just a few minor things, almost entirely
dealing with lack of whitespace around operators. git log -p --reverse
origin/master..wking/dolsen-rewrite-part-1 and then search for ^\+.*[^
]\+[^ ] (less regex) finds a couple.

I'd opt to just put parenthesis around prints where we're going to be
line wrapping its argument. It accomplishes the same thing as the
trailing slash, but moves us slightly in the direction of python3. So,
fix up lines you think it possible that match ^\+.*\\$

The other thing: I think we should drop most of the last patch for
now. Wrapping long lines before we switch from 8-space tabs to PEP8
4-space style seems premature. The other half of that commit that
replaces a series of prints with a single one looks good though.

You may want to put your Signed-off-by on the patches to note that you
refactored them heavily.

Thanks again,
Matt


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

* Re: [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths.
  2013-12-14 16:42     ` W. Trevor King
@ 2013-12-14 21:31       ` Dustin C. Hatch
  0 siblings, 0 replies; 79+ messages in thread
From: Dustin C. Hatch @ 2013-12-14 21:31 UTC (permalink / raw
  To: gentoo-catalyst

On 12/14/2013 10:42, W. Trevor King wrote:
> The current code base is so far from PEP 8 that changing touched
> sections to match PEP 8 looks really out of place.  In this instance
> it's probably fine, but I'd ok with putting off all/most PEP 8
> cleanups to their own pure-reformatting commits.
>
> Cheers,
> Trevor
>
I strongly agree with this idea. If we start mixing PEP8 and non PEP8 
compliant code, it will get really hard to read really fast. I think we 
should wait until most if not all of this rewrite get onto master before 
we start changing stuff for the sake of reformatting.

-- 
♫Dustin
http://dustin.hatch.name/


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

* [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1)
  2013-12-14 18:44           ` Matt Turner
@ 2013-12-14 22:24             ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 01/21] modules/tinderbox_target.py: Use 'portdir' instead of hard-coding '/usr/portage' W. Trevor King
                                 ` (22 more replies)
  0 siblings, 23 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: W. Trevor King

From: "W. Trevor King" <wking@tremily.us>

On Sat, Dec 14, 2013 at 10:44:13AM -0800, Matt Turner wrote:
> I feel they're basically ready to go, but I want everyone to be in
> the habit of sending patches to the list, so please do.

Here you go :).

> Preemptive review: I saw just a few minor things, almost entirely
> dealing with lack of whitespace around operators. git log -p --reverse
> origin/master..wking/dolsen-rewrite-part-1 and then search for ^\+.*[^
> ]\+[^ ] (less regex) finds a couple.

I added spaces around = and +.  Beyond that, I agree with Dustin:

On Sat, Dec 14, 2013 at 03:31:50PM -0600, Dustin C. Hatch wrote:
> On 12/14/2013 10:42, W. Trevor King wrote:
> > The current code base is so far from PEP 8 that changing touched
> > sections to match PEP 8 looks really out of place.  In this
> > instance it's probably fine, but I'd ok with putting off all/most
> > PEP 8 cleanups to their own pure-reformatting commits.
>
> I strongly agree with this idea. If we start mixing PEP8 and non
> PEP8 compliant code, it will get really hard to read really fast. I
> think we should wait until most if not all of this rewrite get onto
> master before we start changing stuff for the sake of reformatting.

On Sat, Dec 14, 2013 at 10:44:13AM -0800, Matt Turner wrote:
> I'd opt to just put parenthesis around prints where we're going to be
> line wrapping its argument. It accomplishes the same thing as the
> trailing slash, but moves us slightly in the direction of python3. So,
> fix up lines you think it possible that match ^\+.*\\$

Whitespace inconsistency is still readable, but having ‘print(…)’
where we touch lines, surrounded by ‘print …’ where we didn't touch
lines is a bit too far for me ;).  Can we just move to:

  from __future__ import print_function

and ‘print(…)’ as a mass-replace once we finish the rest of Brian's
series?

> The other thing: I think we should drop most of the last patch for
> now. Wrapping long lines before we switch from 8-space tabs to PEP8
> 4-space style seems premature. The other half of that commit that
> replaces a series of prints with a single one looks good though.

I've split the commit and placed the long-line wrapping at the end of
this part of the series.  There aren't too many lines in there, so
rebasing the remainder of the series onto master shouldn't be to bad
if you don't merge the last commit from this part.

> You may want to put your Signed-off-by on the patches to note that
> you refactored them heavily.

Done.  Brian, I'll wait until you've acked this form of your branch,
and then add sign-offs from you too, so you can ok (or not) my Git
refactoring.

Cheers,
Trevor

Brian Dolbec (21):
  modules/tinderbox_target.py: Use 'portdir' instead of hard-coding
    '/usr/portage'
  modules/generic_stage_target.py: Use 'portdir' instead of hard-coding
    '/usr/portage'
  modules/generic_stage_target.py: Use 'portdir' instead of hard-coding
    '/usr/portage'
  modules/generic_stage_target.py: Use 'distdir' instead of hard-coding
    '${PORTAGE}/distfiles'
  modules/generic_stage_target.py: Use a 'local_overlay' setting instead
    of hard-coding '/usr/local/portage'
  catalyst: Split confdefaults into line-per-entry
  catalyst: Add 'repo_name' default
  catalyst: Add 'snapshot_name' default
  catalyst: Add 'packagedir' default instead of hard-coding
    '/usr/portage/packages'
  catalyst: Add 'port_tmpdir' default instead of hard-coding
    '/var/tmp/portage'
  modules/generic_stage_target.py: Don't use paths as mountmap keys
  modules/generic_stage_target.py: Use 'proc' instead of '/proc' as the
    mountmap key
  modules/generic_stage_target.py: Use 'dev' instead of '/dev' as the
    mountmap key
  modules/generic_stage_target.py: Use 'distdir' instead of
    '/usr/portage/distfiles' as the mountmap key
  modules/generic_stage_target.py: Use 'port_tmpdir' instead of
    '/var/tmp/portage' as the mountmap key
  modules/generic_stage_target.py: Use 'devpts' instead of '/dev/pts' as
    the mountmap key
  modules/generic_stage_target.py: Use 'packagedir' instead of
    '/usr/portage/packages' as the mountmap key
  modules/generic_stage_target.py: Use 'kerncache' instead of
    '/tmp/kerncache' as the mountmap key
  modules/generic_stage_target.py: Use 'ccache' instead of
    '/var/tmp/ccache' as the mountmap key
  catalst: improve usage() output formatting slightly
  catalyst: cleanup long lines

 catalyst                        | 101 ++++++++++++++++++++++++----------------
 modules/generic_stage_target.py |  92 ++++++++++++++++++------------------
 modules/snapshot_target.py      |  14 ++++--
 modules/tinderbox_target.py     |   8 +++-
 4 files changed, 123 insertions(+), 92 deletions(-)

-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 01/21] modules/tinderbox_target.py: Use 'portdir' instead of hard-coding '/usr/portage'
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 02/21] modules/generic_stage_target.py: " W. Trevor King
                                 ` (21 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content
changes with additional whitespace cleanups.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 modules/tinderbox_target.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/tinderbox_target.py b/modules/tinderbox_target.py
index 46fe082..ca55610 100644
--- a/modules/tinderbox_target.py
+++ b/modules/tinderbox_target.py
@@ -29,8 +29,12 @@ class tinderbox_target(generic_stage_target):
 			raise CatalystError,"Tinderbox aborting due to error."
 
 	def set_cleanables(self):
-	    self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",\
-					"/usr/portage"]
+		self.settings['cleanables'] = [
+			'/etc/resolv.conf',
+			'/var/tmp/*',
+			'/root/*',
+			self.settings['portdir'],
+			]
 
 	def set_action_sequence(self):
 		#Default action sequence for run method
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 02/21] modules/generic_stage_target.py: Use 'portdir' instead of hard-coding '/usr/portage'
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 01/21] modules/tinderbox_target.py: Use 'portdir' instead of hard-coding '/usr/portage' W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 03/21] " W. Trevor King
                                 ` (20 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 modules/generic_stage_target.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 848aca2..0871cba 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -406,7 +406,7 @@ class generic_stage_target(generic_target):
 
 	def set_cleanables(self):
 		self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/tmp/*",\
-			"/root/*","/usr/portage"]
+			"/root/*", self.settings["portdir"]]
 
 	def set_snapshot_path(self):
 		self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
@@ -785,7 +785,7 @@ class generic_stage_target(generic_target):
 				print "Valid snapshot cache, skipping unpack of portage tree..."
 				unpack=False
 		else:
-			destdir=normpath(self.settings["chroot_path"]+"/usr/portage")
+			destdir = normpath(self.settings["chroot_path"] + self.settings["portdir"])
 			cleanup_errmsg="Error removing existing snapshot directory."
 			cleanup_msg=\
 				"Cleaning up existing portage tree (This can take a long time)..."
@@ -799,7 +799,7 @@ class generic_stage_target(generic_target):
 
 			if "AUTORESUME" in self.settings \
 				and os.path.exists(self.settings["chroot_path"]+\
-					"/usr/portage/") \
+					self.settings["portdir"]) \
 				and os.path.exists(self.settings["autoresume_path"]\
 					+"unpack_portage") \
 				and self.settings["snapshot_path_hash"] == snapshot_hash:
@@ -846,7 +846,7 @@ class generic_stage_target(generic_target):
 			cmd("rm -f "+self.settings["chroot_path"]+"/etc/portage/make.profile",\
 					"Error zapping profile link",env=self.env)
 			cmd("mkdir -p "+self.settings["chroot_path"]+"/etc/portage/")
-			cmd("ln -sf ../../usr/portage/profiles/"+\
+			cmd("ln -sf ../.." + self.settings["portdir"] + "/profiles/" + \
 				self.settings["target_profile"]+" "+\
 				self.settings["chroot_path"]+"/etc/portage/make.profile",\
 				"Error creating profile link",env=self.env)
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 03/21] modules/generic_stage_target.py: Use 'portdir' instead of hard-coding '/usr/portage'
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 01/21] modules/tinderbox_target.py: Use 'portdir' instead of hard-coding '/usr/portage' W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 02/21] modules/generic_stage_target.py: " W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 04/21] modules/generic_stage_target.py: Use 'distdir' instead of hard-coding '${PORTAGE}/distfiles' W. Trevor King
                                 ` (19 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 modules/generic_stage_target.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 0871cba..0803a8c 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -1064,7 +1064,7 @@ class generic_stage_target(generic_target):
 						"/use will cause portage to ignore"
 					print "\tpackage.use in the profile and portage_confdir. You've been warned!"
 
-			myf.write('PORTDIR="/usr/portage"\n')
+			myf.write('PORTDIR="%s"\n' % self.settings['portdir'])
 			myf.write('DISTDIR="${PORTDIR}/distfiles"\n')
 			myf.write('PKGDIR="${PORTDIR}/packages"\n')
 
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 04/21] modules/generic_stage_target.py: Use 'distdir' instead of hard-coding '${PORTAGE}/distfiles'
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (2 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 03/21] " W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 05/21] modules/generic_stage_target.py: Use a 'local_overlay' setting instead of hard-coding '/usr/local/portage' W. Trevor King
                                 ` (18 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 modules/generic_stage_target.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 0803a8c..fc54fbf 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -1065,7 +1065,7 @@ class generic_stage_target(generic_target):
 					print "\tpackage.use in the profile and portage_confdir. You've been warned!"
 
 			myf.write('PORTDIR="%s"\n' % self.settings['portdir'])
-			myf.write('DISTDIR="${PORTDIR}/distfiles"\n')
+			myf.write('DISTDIR="%s"\n' % self.settings['distdir'])
 			myf.write('PKGDIR="${PORTDIR}/packages"\n')
 
 			""" Setup the portage overlay """
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 05/21] modules/generic_stage_target.py: Use a 'local_overlay' setting instead of hard-coding '/usr/local/portage'
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (3 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 04/21] modules/generic_stage_target.py: Use 'distdir' instead of hard-coding '${PORTAGE}/distfiles' W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 06/21] catalyst: Split confdefaults into line-per-entry W. Trevor King
                                 ` (17 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 modules/generic_stage_target.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index fc54fbf..6ee35d2 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -872,10 +872,10 @@ class generic_stage_target(generic_target):
 				if os.path.exists(x):
 					print "Copying overlay dir " +x
 					cmd("mkdir -p "+self.settings["chroot_path"]+\
-						"/usr/local/portage",\
+						self.settings["local_overlay"],\
 						"Could not make portage_overlay dir",env=self.env)
 					cmd("cp -R "+x+"/* "+self.settings["chroot_path"]+\
-						"/usr/local/portage",\
+						self.settings["local_overlay"],\
 						"Could not copy portage_overlay",env=self.env)
 
 	def root_overlay(self):
@@ -1116,9 +1116,9 @@ class generic_stage_target(generic_target):
 				"Could not replace /etc/hosts",env=self.env)
 
 		""" Remove our overlay """
-		if os.path.exists(self.settings["chroot_path"]+"/usr/local/portage"):
-			cmd("rm -rf "+self.settings["chroot_path"]+"/usr/local/portage",\
-				"Could not remove /usr/local/portage",env=self.env)
+		if os.path.exists(self.settings["chroot_path"] + self.settings["local_overlay"]):
+			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",\
 				"Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 06/21] catalyst: Split confdefaults into line-per-entry
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (4 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 05/21] modules/generic_stage_target.py: Use a 'local_overlay' setting instead of hard-coding '/usr/local/portage' W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 07/21] catalyst: Add 'repo_name' default W. Trevor King
                                 ` (16 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

This makes it easy to find the key you're looking for.  Future
additions and removals will also have cleaner diffs.

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 catalyst | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/catalyst b/catalyst
index ba26f3c..e229133 100755
--- a/catalyst
+++ b/catalyst
@@ -61,11 +61,15 @@ def parse_config(myconfig):
 	myconf={}
 	config_file=""
 
-	confdefaults={ "storedir":"/var/tmp/catalyst",\
-		"sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles",\
-		"portdir":"/usr/portage","options":"",\
-		"snapshot_cache":"/var/tmp/catalyst/snapshot_cache",\
-		"hash_function":"crc32"}
+	confdefaults = {
+		"distdir": "/usr/portage/distfiles",
+		"hash_function": "crc32",
+		"options": "",
+		"portdir": "/usr/portage",
+		"sharedir": "/usr/share/catalyst",
+		"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
+		"storedir": "/var/tmp/catalyst",
+		}
 
 	# first, try the one passed (presumably from the cmdline)
 	if myconfig:
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 07/21] catalyst: Add 'repo_name' default
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (5 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 06/21] catalyst: Split confdefaults into line-per-entry W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 08/21] catalyst: Add 'snapshot_name' default W. Trevor King
                                 ` (15 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 catalyst                   | 1 +
 modules/snapshot_target.py | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/catalyst b/catalyst
index e229133..0fc65b0 100755
--- a/catalyst
+++ b/catalyst
@@ -66,6 +66,7 @@ def parse_config(myconfig):
 		"hash_function": "crc32",
 		"options": "",
 		"portdir": "/usr/portage",
+		"repo_name": "portage",
 		"sharedir": "/usr/share/catalyst",
 		"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
 		"storedir": "/var/tmp/catalyst",
diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py
index e93a86a..02b9831 100644
--- a/modules/snapshot_target.py
+++ b/modules/snapshot_target.py
@@ -46,11 +46,14 @@ class snapshot_target(generic_stage_target):
 		if not os.path.exists(mytmp):
 			os.makedirs(mytmp)
 
-		cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ --exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* "+\
-			self.settings["portdir"]+"/ "+mytmp+"/portage/","Snapshot failure",env=self.env)
+		cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ " +
+			"--exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* " +
+			self.settings["portdir"] + "/ " + mytmp + "/%s/" % self.settings["repo_name"],
+			"Snapshot failure", env=self.env)
 
 		print "Compressing Portage snapshot tarball..."
-		cmd("tar -I lbzip2 -cf "+self.settings["snapshot_path"]+" -C "+mytmp+" portage",\
+		cmd("tar -I lbzip2 -cf " + self.settings["snapshot_path"] + " -C " +
+			mytmp + " " + self.settings["repo_name"],
 			"Snapshot creation failure",env=self.env)
 
 		self.gen_contents_file(self.settings["snapshot_path"])
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 08/21] catalyst: Add 'snapshot_name' default
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (6 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 07/21] catalyst: Add 'repo_name' default W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 09/21] catalyst: Add 'packagedir' default instead of hard-coding '/usr/portage/packages' W. Trevor King
                                 ` (14 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 catalyst                        | 1 +
 modules/generic_stage_target.py | 6 ++++--
 modules/snapshot_target.py      | 5 +++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/catalyst b/catalyst
index 0fc65b0..131529a 100755
--- a/catalyst
+++ b/catalyst
@@ -68,6 +68,7 @@ def parse_config(myconfig):
 		"portdir": "/usr/portage",
 		"repo_name": "portage",
 		"sharedir": "/usr/share/catalyst",
+		"snapshot_name": "portage-",
 		"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
 		"storedir": "/var/tmp/catalyst",
 		}
diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 6ee35d2..63661fe 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -410,7 +410,8 @@ class generic_stage_target(generic_target):
 
 	def set_snapshot_path(self):
 		self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
-			"/snapshots/portage-"+self.settings["snapshot"]+".tar.xz")
+			"/snapshots/" + self.settings["snapshot_name"] +
+			self.settings["snapshot"] + ".tar.xz")
 
 		if os.path.exists(self.settings["snapshot_path"]):
 			self.settings["snapshot_path_hash"]=\
@@ -418,7 +419,8 @@ class generic_stage_target(generic_target):
 				hash_function=self.settings["hash_function"],verbose=False)
 		else:
 			self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
-				"/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2")
+				"/snapshots/" + self.settings["snapshot_name"] +
+				self.settings["snapshot"] + ".tar.bz2")
 
 			if os.path.exists(self.settings["snapshot_path"]):
 				self.settings["snapshot_path_hash"]=\
diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py
index 02b9831..ba1bab5 100644
--- a/modules/snapshot_target.py
+++ b/modules/snapshot_target.py
@@ -18,8 +18,9 @@ class snapshot_target(generic_stage_target):
 		self.settings=myspec
 		self.settings["target_subpath"]="portage"
 		st=self.settings["storedir"]
-		self.settings["snapshot_path"]=normpath(st+"/snapshots/portage-"+self.settings["version_stamp"]\
-			+".tar.bz2")
+		self.settings["snapshot_path"] = normpath(st + "/snapshots/"
+			+ self.settings["snapshot_name"]
+			+ self.settings["version_stamp"] + ".tar.bz2")
 		self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpath"])
 
 	def setup(self):
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 09/21] catalyst: Add 'packagedir' default instead of hard-coding '/usr/portage/packages'
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (7 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 08/21] catalyst: Add 'snapshot_name' default W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 10/21] catalyst: Add 'port_tmpdir' default instead of hard-coding '/var/tmp/portage' W. Trevor King
                                 ` (13 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 catalyst                        | 1 +
 modules/generic_stage_target.py | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/catalyst b/catalyst
index 131529a..c62b745 100755
--- a/catalyst
+++ b/catalyst
@@ -65,6 +65,7 @@ def parse_config(myconfig):
 		"distdir": "/usr/portage/distfiles",
 		"hash_function": "crc32",
 		"options": "",
+		"packagedir": "/usr/portage/packages",
 		"portdir": "/usr/portage",
 		"repo_name": "portage",
 		"sharedir": "/usr/share/catalyst",
diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 63661fe..c890773 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -1068,7 +1068,7 @@ class generic_stage_target(generic_target):
 
 			myf.write('PORTDIR="%s"\n' % self.settings['portdir'])
 			myf.write('DISTDIR="%s"\n' % self.settings['distdir'])
-			myf.write('PKGDIR="${PORTDIR}/packages"\n')
+			myf.write('PKGDIR="%s"\n' % self.settings['packagedir'])
 
 			""" Setup the portage overlay """
 			if "portage_overlay" in self.settings:
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 10/21] catalyst: Add 'port_tmpdir' default instead of hard-coding '/var/tmp/portage'
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (8 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 09/21] catalyst: Add 'packagedir' default instead of hard-coding '/usr/portage/packages' W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-15  2:56                 ` Brian Dolbec
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 11/21] modules/generic_stage_target.py: Don't use paths as mountmap keys W. Trevor King
                                 ` (12 subsequent siblings)
  22 siblings, 1 reply; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 catalyst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/catalyst b/catalyst
index c62b745..cafc6e5 100755
--- a/catalyst
+++ b/catalyst
@@ -67,6 +67,7 @@ def parse_config(myconfig):
 		"options": "",
 		"packagedir": "/usr/portage/packages",
 		"portdir": "/usr/portage",
+		"port_tmpdir": "/var/tmp/portage",
 		"repo_name": "portage",
 		"sharedir": "/usr/share/catalyst",
 		"snapshot_name": "portage-",
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 11/21] modules/generic_stage_target.py: Don't use paths as mountmap keys
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (9 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 10/21] catalyst: Add 'port_tmpdir' default instead of hard-coding '/var/tmp/portage' W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 12/21] modules/generic_stage_target.py: Use 'proc' instead of '/proc' as the mountmap key W. Trevor King
                                 ` (11 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 modules/generic_stage_target.py | 41 +++++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index c890773..a68b356 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -615,21 +615,21 @@ class generic_stage_target(generic_target):
 			return
 
 		for x in self.mounts:
-			if not os.path.exists(mypath+x):
+			if not os.path.exists(mypath + self.mountmap[x]):
 				continue
 
-			if ismount(mypath+x):
+			if ismount(mypath + self.mountmap[x]):
 				""" Something is still mounted "" """
 				try:
-					print x+" is still mounted; performing auto-bind-umount...",
+					print self.mountmap[x] + " is still mounted; performing auto-bind-umount...",
 					""" Try to umount stuff ourselves """
 					self.unbind()
-					if ismount(mypath+x):
-						raise CatalystError, "Auto-unbind failed for "+x
+					if ismount(mypath + self.mountmap[x]):
+						raise CatalystError, "Auto-unbind failed for " + self.mountmap[x]
 					else:
 						print "Auto-unbind successful..."
 				except CatalystError:
-					raise CatalystError, "Unable to auto-unbind "+x
+					raise CatalystError, "Unable to auto-unbind " + self.mountmap[x]
 
 	def unpack(self):
 		unpack=True
@@ -897,7 +897,7 @@ class generic_stage_target(generic_target):
 
 	def bind(self):
 		for x in self.mounts:
-			if not os.path.exists(self.settings["chroot_path"]+x):
+			if not os.path.exists(self.settings["chroot_path"] + self.mountmap[x]):
 				os.makedirs(self.settings["chroot_path"]+x,0755)
 
 			if not os.path.exists(self.mountmap[x]):
@@ -909,11 +909,11 @@ class generic_stage_target(generic_target):
 				self.snapshot_lock_object.read_lock()
 			if os.uname()[0] == "FreeBSD":
 				if src == "/dev":
-					retval=os.system("mount -t devfs none "+\
-						self.settings["chroot_path"]+x)
+					retval = os.system("mount -t devfs none " +
+						self.settings["chroot_path"] + src)
 				else:
-					retval=os.system("mount_nullfs "+src+" "+\
-						self.settings["chroot_path"]+x)
+					retval = os.system("mount_nullfs " + src + " " +
+						self.settings["chroot_path"] + src)
 			else:
 				if src == "tmpfs":
 					if "var_tmpfs_portage" in self.settings:
@@ -921,11 +921,11 @@ class generic_stage_target(generic_target):
 							self.settings["var_tmpfs_portage"]+"G "+src+" "+\
 							self.settings["chroot_path"]+x)
 				else:
-					retval=os.system("mount --bind "+src+" "+\
-						self.settings["chroot_path"]+x)
+					retval = os.system("mount --bind " + src + " " +
+						self.settings["chroot_path"] + src)
 			if retval!=0:
 				self.unbind()
-				raise CatalystError,"Couldn't bind mount "+src
+				raise CatalystError,"Couldn't bind mount " + src
 
 	def unbind(self):
 		ouch=0
@@ -934,25 +934,26 @@ class generic_stage_target(generic_target):
 		myrevmounts.reverse()
 		""" Unmount in reverse order for nested bind-mounts """
 		for x in myrevmounts:
-			if not os.path.exists(mypath+x):
+			if not os.path.exists(mypath + self.mountmap[x]):
 				continue
 
-			if not ismount(mypath+x):
+			if not ismount(mypath + self.mountmap[x]):
 				continue
 
 			retval=os.system("umount "+\
-				os.path.join(mypath,x.lstrip(os.path.sep)))
+				os.path.join(mypath, self.mountmap[x].lstrip(os.path.sep)))
 
 			if retval!=0:
-				warn("First attempt to unmount: "+mypath+x+" failed.")
+				warn("First attempt to unmount: " + mypath +
+					self.mountmap[x] +" failed.")
 				warn("Killing any pids still running in the chroot")
 
 				self.kill_chroot_pids()
 
-				retval2=os.system("umount "+mypath+x)
+				retval2 = os.system("umount " + mypath + self.mountmap[x])
 				if retval2!=0:
 					ouch=1
-					warn("Couldn't umount bind mount: "+mypath+x)
+					warn("Couldn't umount bind mount: " + mypath + self.mountmap[x])
 
 			if "SNAPCACHE" in self.settings and x == "/usr/portage":
 				try:
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 12/21] modules/generic_stage_target.py: Use 'proc' instead of '/proc' as the mountmap key
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (10 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 11/21] modules/generic_stage_target.py: Don't use paths as mountmap keys W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 13/21] modules/generic_stage_target.py: Use 'dev' instead of '/dev' " W. Trevor King
                                 ` (10 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index a68b356..490430f 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -179,8 +179,8 @@ class generic_stage_target(generic_target):
 				"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		else:
-			self.mounts=["/proc","/dev","/usr/portage/distfiles","/var/tmp/portage"]
-			self.mountmap={"/proc":"/proc","/dev":"/dev","/dev/pts":"/dev/pts",\
+			self.mounts = ["proc","/dev","/usr/portage/distfiles","/var/tmp/portage"]
+			self.mountmap = {"proc":"/proc", "/dev":"/dev", "/dev/pts":"/dev/pts",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		if os.uname()[0] == "Linux":
 			self.mounts.append("/dev/pts")
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 13/21] modules/generic_stage_target.py: Use 'dev' instead of '/dev' as the mountmap key
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (11 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 12/21] modules/generic_stage_target.py: Use 'proc' instead of '/proc' as the mountmap key W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 14/21] modules/generic_stage_target.py: Use 'distdir' instead of '/usr/portage/distfiles' " W. Trevor King
                                 ` (9 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 490430f..bf43eff 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -179,8 +179,8 @@ class generic_stage_target(generic_target):
 				"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		else:
-			self.mounts = ["proc","/dev","/usr/portage/distfiles","/var/tmp/portage"]
-			self.mountmap = {"proc":"/proc", "/dev":"/dev", "/dev/pts":"/dev/pts",\
+			self.mounts = ["proc", "dev","/usr/portage/distfiles", "/var/tmp/portage"]
+			self.mountmap = {"proc":"/proc", "dev":"/dev", "/dev/pts":"/dev/pts",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		if os.uname()[0] == "Linux":
 			self.mounts.append("/dev/pts")
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 14/21] modules/generic_stage_target.py: Use 'distdir' instead of '/usr/portage/distfiles' as the mountmap key
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (12 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 13/21] modules/generic_stage_target.py: Use 'dev' instead of '/dev' " W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 15/21] modules/generic_stage_target.py: Use 'port_tmpdir' instead of '/var/tmp/portage' " W. Trevor King
                                 ` (8 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index bf43eff..e5bdf91 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -179,9 +179,9 @@ class generic_stage_target(generic_target):
 				"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		else:
-			self.mounts = ["proc", "dev","/usr/portage/distfiles", "/var/tmp/portage"]
+			self.mounts = ["proc", "dev", "distdir", "/var/tmp/portage"]
 			self.mountmap = {"proc":"/proc", "dev":"/dev", "/dev/pts":"/dev/pts",\
-				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
+				"distdir":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		if os.uname()[0] == "Linux":
 			self.mounts.append("/dev/pts")
 
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 15/21] modules/generic_stage_target.py: Use 'port_tmpdir' instead of '/var/tmp/portage' as the mountmap key
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (13 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 14/21] modules/generic_stage_target.py: Use 'distdir' instead of '/usr/portage/distfiles' " W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 16/21] modules/generic_stage_target.py: Use 'devpts' instead of '/dev/pts' " W. Trevor King
                                 ` (7 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index e5bdf91..2426b12 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -179,9 +179,9 @@ class generic_stage_target(generic_target):
 				"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		else:
-			self.mounts = ["proc", "dev", "distdir", "/var/tmp/portage"]
+			self.mounts = ["proc", "dev", "distdir", "port_tmpdir"]
 			self.mountmap = {"proc":"/proc", "dev":"/dev", "/dev/pts":"/dev/pts",\
-				"distdir":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
+				"distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}
 		if os.uname()[0] == "Linux":
 			self.mounts.append("/dev/pts")
 
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 16/21] modules/generic_stage_target.py: Use 'devpts' instead of '/dev/pts' as the mountmap key
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (14 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 15/21] modules/generic_stage_target.py: Use 'port_tmpdir' instead of '/var/tmp/portage' " W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 17/21] modules/generic_stage_target.py: Use 'packagedir' instead of '/usr/portage/packages' " W. Trevor King
                                 ` (6 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 2426b12..f8dd352 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -180,10 +180,10 @@ class generic_stage_target(generic_target):
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		else:
 			self.mounts = ["proc", "dev", "distdir", "port_tmpdir"]
-			self.mountmap = {"proc":"/proc", "dev":"/dev", "/dev/pts":"/dev/pts",\
+			self.mountmap = {"proc":"/proc", "dev":"/dev", "devpts":"/dev/pts",
 				"distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}
 		if os.uname()[0] == "Linux":
-			self.mounts.append("/dev/pts")
+			self.mounts.append("devpts")
 
 		self.set_mounts()
 
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 17/21] modules/generic_stage_target.py: Use 'packagedir' instead of '/usr/portage/packages' as the mountmap key
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (15 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 16/21] modules/generic_stage_target.py: Use 'devpts' instead of '/dev/pts' " W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 18/21] modules/generic_stage_target.py: Use 'kerncache' instead of '/tmp/kerncache' " W. Trevor King
                                 ` (5 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 modules/generic_stage_target.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index f8dd352..dc02ad2 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -195,9 +195,8 @@ class generic_stage_target(generic_target):
 			self.set_pkgcache_path()
 			print "Location of the package cache is "+\
 				self.settings["pkgcache_path"]
-			self.mounts.append("/usr/portage/packages")
-			self.mountmap["/usr/portage/packages"]=\
-				self.settings["pkgcache_path"]
+			self.mounts.append("packagedir")
+			self.mountmap["packagedir"] = self.settings["pkgcache_path"]
 
 		if "KERNCACHE" in self.settings:
 			self.set_kerncache_path()
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 18/21] modules/generic_stage_target.py: Use 'kerncache' instead of '/tmp/kerncache' as the mountmap key
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (16 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 17/21] modules/generic_stage_target.py: Use 'packagedir' instead of '/usr/portage/packages' " W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 19/21] modules/generic_stage_target.py: Use 'ccache' instead of '/var/tmp/ccache' " W. Trevor King
                                 ` (4 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index dc02ad2..6a9b980 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -202,8 +202,8 @@ class generic_stage_target(generic_target):
 			self.set_kerncache_path()
 			print "Location of the kerncache is "+\
 				self.settings["kerncache_path"]
-			self.mounts.append("/tmp/kerncache")
-			self.mountmap["/tmp/kerncache"]=self.settings["kerncache_path"]
+			self.mounts.append("kerncache")
+			self.mountmap["kerncache"] = self.settings["kerncache_path"]
 
 		if "CCACHE" in self.settings:
 			if "CCACHE_DIR" in os.environ:
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 19/21] modules/generic_stage_target.py: Use 'ccache' instead of '/var/tmp/ccache' as the mountmap key
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (17 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 18/21] modules/generic_stage_target.py: Use 'kerncache' instead of '/tmp/kerncache' " W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 20/21] catalst: improve usage() output formatting slightly W. Trevor King
                                 ` (3 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 6a9b980..8c983e1 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -215,8 +215,8 @@ class generic_stage_target(generic_target):
 				raise CatalystError,\
 					"Compiler cache support can't be enabled (can't find "+\
 					ccdir+")"
-			self.mounts.append("/var/tmp/ccache")
-			self.mountmap["/var/tmp/ccache"]=ccdir
+			self.mounts.append("ccache")
+			self.mountmap["ccache"] = ccdir
 			""" for the chroot: """
 			self.env["CCACHE_DIR"]="/var/tmp/ccache"
 
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 20/21] catalst: improve usage() output formatting slightly
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (18 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 19/21] modules/generic_stage_target.py: Use 'ccache' instead of '/var/tmp/ccache' " W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 21/21] catalyst: cleanup long lines W. Trevor King
                                 ` (2 subsequent siblings)
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 catalyst | 52 +++++++++++++++++++++++++++-------------------------
 1 file changed, 27 insertions(+), 25 deletions(-)

diff --git a/catalyst b/catalyst
index cafc6e5..38fbdfb 100755
--- a/catalyst
+++ b/catalyst
@@ -24,31 +24,33 @@ __version__="2.0.15"
 conf_values={}
 
 def usage():
-	print "Usage catalyst [options] [-C variable=value...] [ -s identifier]"
-	print " -a --clear-autoresume	clear autoresume flags"
-	print " -c --config     use specified configuration file"
-	print " -C --cli        catalyst commandline (MUST BE LAST OPTION)"
-	print " -d --debug      enable debugging"
-	print " -f --file       read specfile"
-	print " -F --fetchonly  fetch files only"
-	print " -h --help       print this help message"
-	print " -p --purge      clear tmp dirs,package cache and autoresume flags"
-	print " -P --purgeonly  clear tmp dirs,package cache and autoresume flags and exit"
-	print " -T --purgetmponly  clear tmp dirs and autoresume flags and exit"
-	print " -s --snapshot   generate a release snapshot"
-	print " -V --version    display version information"
-	print " -v --verbose    verbose output"
-	print
-	print "Usage examples:"
-	print
-	print "Using the commandline option (-C, --cli) to build a Portage snapshot:"
-	print "catalyst -C target=snapshot version_stamp=my_date"
-	print
-	print "Using the snapshot option (-s, --snapshot) to build a release snapshot:"
-	print "catalyst -s 20071121"
-	print
-	print "Using the specfile option (-f, --file) to build a stage target:"
-	print "catalyst -f stage1-specfile.spec"
+	print """Usage catalyst [options] [-C variable=value...] [ -s identifier]
+ -a --clear-autoresume  clear autoresume flags
+ -c --config            use specified configuration file
+ -C --cli               catalyst commandline (MUST BE LAST OPTION)
+ -d --debug             enable debugging
+ -f --file              read specfile
+ -F --fetchonly         fetch files only
+ -h --help              print this help message
+ -p --purge             clear tmp dirs,package cache, autoresume flags
+ -P --purgeonly         clear tmp dirs,package cache, autoresume flags and exit
+ -T --purgetmponly      clear tmp dirs and autoresume flags and exit
+ -s --snapshot          generate a release snapshot
+ -V --version           display version information
+ -v --verbose           verbose output
+
+Usage examples:
+
+Using the commandline option (-C, --cli) to build a Portage snapshot:
+catalyst -C target=snapshot version_stamp=my_date
+
+Using the snapshot option (-s, --snapshot) to build a release snapshot:
+catalyst -s 20071121"
+
+Using the specfile option (-f, --file) to build a stage target:
+catalyst -f stage1-specfile.spec
+"""
+
 
 def version():
 	print "Catalyst, version "+__version__
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v2 21/21] catalyst: cleanup long lines
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (19 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 20/21] catalst: improve usage() output formatting slightly W. Trevor King
@ 2013-12-14 22:24               ` W. Trevor King
  2013-12-14 22:29               ` [gentoo-catalyst] Re: [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
  2013-12-15  0:24               ` [gentoo-catalyst] " Matt Turner
  22 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:24 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 catalyst | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/catalyst b/catalyst
index 38fbdfb..3983155 100755
--- a/catalyst
+++ b/catalyst
@@ -80,7 +80,8 @@ def parse_config(myconfig):
 	# first, try the one passed (presumably from the cmdline)
 	if myconfig:
 		if os.path.exists(myconfig):
-			print "Using command line specified Catalyst configuration file, "+myconfig
+			print "Using command line specified Catalyst configuration file, " + \
+				myconfig
 			config_file=myconfig
 
 		else:
@@ -90,7 +91,8 @@ def parse_config(myconfig):
 
 	# next, try the default location
 	elif os.path.exists("/etc/catalyst/catalyst.conf"):
-		print "Using default Catalyst configuration file, /etc/catalyst/catalyst.conf"
+		print "Using default Catalyst configuration file," + \
+			" /etc/catalyst/catalyst.conf"
 		config_file="/etc/catalyst/catalyst.conf"
 
 	# can't find a config file (we are screwed), so bail out
@@ -186,14 +188,16 @@ def parse_config(myconfig):
 		conf_values["port_logdir"]=myconf["port_logdir"];
 
 def import_modules():
-	# import catalyst's own modules (i.e. catalyst_support and the arch modules)
+	# import catalyst's own modules
+	# (i.e. catalyst_support and the arch modules)
 	targetmap={}
 
 	try:
 		for x in required_build_targets:
 			try:
 				fh=open(conf_values["sharedir"]+"/modules/"+x+".py")
-				module=imp.load_module(x,fh,"modules/"+x+".py",(".py","r",imp.PY_SOURCE))
+				module = imp.load_module(x,fh,"modules/" + x + ".py",
+					(".py","r",imp.PY_SOURCE))
 				fh.close()
 
 			except IOError:
@@ -203,7 +207,8 @@ def import_modules():
 		for x in valid_build_targets:
 			try:
 				fh=open(conf_values["sharedir"]+"/modules/"+x+".py")
-				module=imp.load_module(x,fh,"modules/"+x+".py",(".py","r",imp.PY_SOURCE))
+				module = imp.load_module(x,fh,"modules/" + x + ".py",
+					(".py","r",imp.PY_SOURCE))
 				module.register(targetmap)
 				fh.close()
 
@@ -221,15 +226,17 @@ def import_modules():
 def build_target(addlargs, targetmap):
 	try:
 		if addlargs["target"] not in targetmap:
-			raise CatalystError,"Target \""+addlargs["target"]+"\" not available."
+			raise CatalystError, \
+				"Target \"%s\" not available." % addlargs["target"]
 
 		mytarget=targetmap[addlargs["target"]](conf_values, addlargs)
 
 		mytarget.run()
 
 	except:
-		modules.catalyst.util.print_traceback()
-		print "!!! catalyst: Error encountered during run of target " + addlargs["target"]
+		catalyst.util.print_traceback()
+		print "!!! catalyst: Error encountered during run of target " + \
+			addlargs["target"]
 		sys.exit(1)
 
 if __name__ == "__main__":
@@ -248,8 +255,12 @@ if __name__ == "__main__":
 
 	# parse out the command line arguments
 	try:
-		opts,args = getopt.getopt(sys.argv[1:], "apPThvdc:C:f:FVs:", ["purge", "purgeonly", "purgetmponly", "help", "version", "debug",\
-			"clear-autoresume", "config=", "cli=", "file=", "fetch", "verbose","snapshot="])
+		opts,args = getopt.getopt(sys.argv[1:], "apPThvdc:C:f:FVs:",
+			["purge", "purgeonly", "purgetmponly", "help", "version", "debug",
+			"clear-autoresume", "config=", "cli=", "file=", "fetch",
+			"verbose","snapshot="
+			]
+		)
 
 	except getopt.GetoptError:
 		usage()
-- 
1.8.3.2



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

* [gentoo-catalyst] Re: [PATCH v2 00/21] rewrite-on-master patches (part 1)
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (20 preceding siblings ...)
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 21/21] catalyst: cleanup long lines W. Trevor King
@ 2013-12-14 22:29               ` W. Trevor King
  2013-12-14 23:10                 ` W. Trevor King
  2013-12-15  0:24               ` [gentoo-catalyst] " Matt Turner
  22 siblings, 1 reply; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 22:29 UTC (permalink / raw
  To: Catalyst

[-- Attachment #1: Type: text/plain, Size: 8947 bytes --]

Oops, I meant to include a diff from v1 in the v2 cover letter.  Here
it is now:

diff --git a/catalyst b/catalyst
index a68a2ba..3983155 100755
--- a/catalyst
+++ b/catalyst
@@ -63,14 +63,15 @@ def parse_config(myconfig):
 	myconf={}
 	config_file=""
 
-	confdefaults={
+	confdefaults = {
 		"distdir": "/usr/portage/distfiles",
 		"hash_function": "crc32",
+		"options": "",
 		"packagedir": "/usr/portage/packages",
 		"portdir": "/usr/portage",
 		"port_tmpdir": "/var/tmp/portage",
 		"repo_name": "portage",
-		"sharedir": "/usr/lib/catalyst",
+		"sharedir": "/usr/share/catalyst",
 		"snapshot_name": "portage-",
 		"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
 		"storedir": "/var/tmp/catalyst",
@@ -79,7 +80,7 @@ def parse_config(myconfig):
 	# first, try the one passed (presumably from the cmdline)
 	if myconfig:
 		if os.path.exists(myconfig):
-			print "Using command line specified Catalyst configuration file, "+\
+			print "Using command line specified Catalyst configuration file, " + \
 				myconfig
 			config_file=myconfig
 
@@ -195,7 +196,7 @@ def import_modules():
 		for x in required_build_targets:
 			try:
 				fh=open(conf_values["sharedir"]+"/modules/"+x+".py")
-				module=imp.load_module(x,fh,"modules/"+x+".py",
+				module = imp.load_module(x,fh,"modules/" + x + ".py",
 					(".py","r",imp.PY_SOURCE))
 				fh.close()
 
@@ -206,7 +207,7 @@ def import_modules():
 		for x in valid_build_targets:
 			try:
 				fh=open(conf_values["sharedir"]+"/modules/"+x+".py")
-				module=imp.load_module(x,fh,"modules/"+x+".py",
+				module = imp.load_module(x,fh,"modules/" + x + ".py",
 					(".py","r",imp.PY_SOURCE))
 				module.register(targetmap)
 				fh.close()
diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 1fbc733..8c983e1 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -179,11 +179,11 @@ class generic_stage_target(generic_target):
 				"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		else:
-			self.mounts=["proc","dev", "distdir", "port_tmpdir"]
-			self.mountmap={"proc":"/proc", "dev":"/dev", "pts":"/dev/pts",
+			self.mounts = ["proc", "dev", "distdir", "port_tmpdir"]
+			self.mountmap = {"proc":"/proc", "dev":"/dev", "devpts":"/dev/pts",
 				"distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}
 		if os.uname()[0] == "Linux":
-			self.mounts.append("pts")
+			self.mounts.append("devpts")
 
 		self.set_mounts()
 
@@ -203,7 +203,7 @@ class generic_stage_target(generic_target):
 			print "Location of the kerncache is "+\
 				self.settings["kerncache_path"]
 			self.mounts.append("kerncache")
-			self.mountmap["kerncache"]=self.settings["kerncache_path"]
+			self.mountmap["kerncache"] = self.settings["kerncache_path"]
 
 		if "CCACHE" in self.settings:
 			if "CCACHE_DIR" in os.environ:
@@ -216,7 +216,7 @@ class generic_stage_target(generic_target):
 					"Compiler cache support can't be enabled (can't find "+\
 					ccdir+")"
 			self.mounts.append("ccache")
-			self.mountmap["ccache"]=ccdir
+			self.mountmap["ccache"] = ccdir
 			""" for the chroot: """
 			self.env["CCACHE_DIR"]="/var/tmp/ccache"
 
@@ -410,7 +410,7 @@ class generic_stage_target(generic_target):
 	def set_snapshot_path(self):
 		self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
 			"/snapshots/" + self.settings["snapshot_name"] +
-			self.settings["snapshot"]+".tar.xz")
+			self.settings["snapshot"] + ".tar.xz")
 
 		if os.path.exists(self.settings["snapshot_path"]):
 			self.settings["snapshot_path_hash"]=\
@@ -419,7 +419,7 @@ class generic_stage_target(generic_target):
 		else:
 			self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
 				"/snapshots/" + self.settings["snapshot_name"] +
-				self.settings["snapshot"]+".tar.bz2")
+				self.settings["snapshot"] + ".tar.bz2")
 
 			if os.path.exists(self.settings["snapshot_path"]):
 				self.settings["snapshot_path_hash"]=\
@@ -617,7 +617,7 @@ class generic_stage_target(generic_target):
 			if not os.path.exists(mypath + self.mountmap[x]):
 				continue
 
-			if ismount(mypath +self.mountmap[x]):
+			if ismount(mypath + self.mountmap[x]):
 				""" Something is still mounted "" """
 				try:
 					print self.mountmap[x] + " is still mounted; performing auto-bind-umount...",
@@ -786,7 +786,7 @@ class generic_stage_target(generic_target):
 				print "Valid snapshot cache, skipping unpack of portage tree..."
 				unpack=False
 		else:
-			destdir=normpath(self.settings["chroot_path"] + self.settings["portdir"])
+			destdir = normpath(self.settings["chroot_path"] + self.settings["portdir"])
 			cleanup_errmsg="Error removing existing snapshot directory."
 			cleanup_msg=\
 				"Cleaning up existing portage tree (This can take a long time)..."
@@ -847,7 +847,7 @@ class generic_stage_target(generic_target):
 			cmd("rm -f "+self.settings["chroot_path"]+"/etc/portage/make.profile",\
 					"Error zapping profile link",env=self.env)
 			cmd("mkdir -p "+self.settings["chroot_path"]+"/etc/portage/")
-			cmd("ln -sf ../.." + self.settings["portdir"] + "/profiles/"+\
+			cmd("ln -sf ../.." + self.settings["portdir"] + "/profiles/" + \
 				self.settings["target_profile"]+" "+\
 				self.settings["chroot_path"]+"/etc/portage/make.profile",\
 				"Error creating profile link",env=self.env)
@@ -908,10 +908,10 @@ class generic_stage_target(generic_target):
 				self.snapshot_lock_object.read_lock()
 			if os.uname()[0] == "FreeBSD":
 				if src == "/dev":
-					retval=os.system("mount -t devfs none " +
+					retval = os.system("mount -t devfs none " +
 						self.settings["chroot_path"] + src)
 				else:
-					retval=os.system("mount_nullfs " + src + " " +
+					retval = os.system("mount_nullfs " + src + " " +
 						self.settings["chroot_path"] + src)
 			else:
 				if src == "tmpfs":
@@ -920,7 +920,7 @@ class generic_stage_target(generic_target):
 							self.settings["var_tmpfs_portage"]+"G "+src+" "+\
 							self.settings["chroot_path"]+x)
 				else:
-					retval=os.system("mount --bind " + src + " " +
+					retval = os.system("mount --bind " + src + " " +
 						self.settings["chroot_path"] + src)
 			if retval!=0:
 				self.unbind()
@@ -949,7 +949,7 @@ class generic_stage_target(generic_target):
 
 				self.kill_chroot_pids()
 
-				retval2=os.system("umount " + mypath + self.mountmap[x])
+				retval2 = os.system("umount " + mypath + self.mountmap[x])
 				if retval2!=0:
 					ouch=1
 					warn("Couldn't umount bind mount: " + mypath + self.mountmap[x])
diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py
index 29d6e87..ba1bab5 100644
--- a/modules/snapshot_target.py
+++ b/modules/snapshot_target.py
@@ -18,7 +18,7 @@ class snapshot_target(generic_stage_target):
 		self.settings=myspec
 		self.settings["target_subpath"]="portage"
 		st=self.settings["storedir"]
-		self.settings["snapshot_path"]=normpath(st + "/snapshots/"
+		self.settings["snapshot_path"] = normpath(st + "/snapshots/"
 			+ self.settings["snapshot_name"]
 			+ self.settings["version_stamp"] + ".tar.bz2")
 		self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpath"])
@@ -50,11 +50,11 @@ class snapshot_target(generic_stage_target):
 		cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ " +
 			"--exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* " +
 			self.settings["portdir"] + "/ " + mytmp + "/%s/" % self.settings["repo_name"],
-			"Snapshot failure",env=self.env)
+			"Snapshot failure", env=self.env)
 
 		print "Compressing Portage snapshot tarball..."
 		cmd("tar -I lbzip2 -cf " + self.settings["snapshot_path"] + " -C " +
-			mytmp + " %s" % self.settings["repo_name"],
+			mytmp + " " + self.settings["repo_name"],
 			"Snapshot creation failure",env=self.env)
 
 		self.gen_contents_file(self.settings["snapshot_path"])
diff --git a/modules/tinderbox_target.py b/modules/tinderbox_target.py
index d6d3ea3..ca55610 100644
--- a/modules/tinderbox_target.py
+++ b/modules/tinderbox_target.py
@@ -29,8 +29,12 @@ class tinderbox_target(generic_stage_target):
 			raise CatalystError,"Tinderbox aborting due to error."
 
 	def set_cleanables(self):
-	    self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",
-					self.settings['portdir']]
+		self.settings['cleanables'] = [
+			'/etc/resolv.conf',
+			'/var/tmp/*',
+			'/root/*',
+			self.settings['portdir'],
+			]
 
 	def set_action_sequence(self):
 		#Default action sequence for run method

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [gentoo-catalyst] Re: [PATCH v2 00/21] rewrite-on-master patches (part 1)
  2013-12-14 22:29               ` [gentoo-catalyst] Re: [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
@ 2013-12-14 23:10                 ` W. Trevor King
  0 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-14 23:10 UTC (permalink / raw
  To: Catalyst

[-- Attachment #1: Type: text/plain, Size: 25524 bytes --]

On Sat, Dec 14, 2013 at 02:29:41PM -0800, W. Trevor King wrote:
> Oops, I meant to include a diff from v1 in the v2 cover letter.  Here
> it is now:

I've also rebased origin/rewrite-on-master onto the top of this
series, so we know where we stand:

The following changes since commit e7dade2e894ba56ad75d308e3531ac1656282f62:

  catalyst: cleanup long lines (2013-12-14 14:16:28 -0800)

are available in the git repository at:

  git://tremily.us/catalyst.git rewrite-without-wtk

for you to fetch changes up to c021dbf9703d4b00bc609b27fd805284325b0a57:

  Strip trailing slash from subpath's if they exist when creating filenames. (2013-12-14 14:50:25 -0800)

----------------------------------------------------------------
Brian Dolbec (60):
      Initial rearrangement of the python directories
      move catalyst_support, builder, catalyst_lock out of modules, into the catalyst's base namespace
      rename the modules subpkg to targets, it better reflects what it contains
      rename files directory to etc to better reflect the directories contents
      Remove unused urllib import.
      Remove unused variable new and an undefined variable s.
      Fix undefined variable: RLIMIT_NOFILE
      Initial creation of a defaults file and Split up support.py
      Move confdefaults out of main.py
      Some options cleanup, unifying their use, reducing redundancy.
      Move LockInUse from support.py to lock.py, fix bad execption raising,  pyflakes cleanup
      Massive pyflakes import cleanup and broken CatalystError calls.
      Begin splitting up generic_stage_target into smaller code blocks.
      some spacing and comment and indent cleanup, etc.
      remove redundant /bin/bash additions in cmd() calls
      Move base stage and target files to thier own sub-pkg
      Update module loading for the new python structure, rename snapshot_target to snapshot
      fix options being reset by a config file
      Fix mounts, mountmap hardcoding removal...
      Use normpath from support
      chmod +x all sh scripts so they can run from the git checkout
      Rename all target .py files and classes without _target in them.
      FIXME! Comment out a small code block causing TypeError.
      Break out more repeated (path1 + path2)'s...
      reduce 2 operations into one simpler one
      Extend ParserBase to do variable substitution.
      Make shdir a complete path to ease it's use.
      Add '--- 'to at the start of all echo messages to aid debugging
      Fix a relative path bug
      Remove trailing slash for consistency in variables
      FIXME! Add a forced debug print statement in cmd() for better debug output
      Commit my testpath file with instructions to run the git checkout code directly without being installed.
      Add archdir to settings
      Fix a bug that portage didn't get rebuilt with the build use flag
      Migrate hardcoded /etc/portage paths
      mixed spaces/tabs and indent cleanup.
      update gitignore
      Fix typo in error message, clean up useless tracebacks
      Fix broken seed stage update...
      fix indent.
      update version to identify the rewite-git code is being run
      Make the use of preserved_libs optional by setting the options variable.
      Migrate version to use snakeoil's format_version() to append git commit info.
      Initial creation of fileops.py
      Refactor ClearBase code to remove code duplication.
      Create AutoResume class to handle all file creation, deletion...
      Fix some paths/normpath usage.  Use pjoin to join paths.     Use os.path.dirname() instead of splitting and rejoining without the filename.
      Remove some dead code
      Fix a long line.
      Rename local unpack var to _unpack
      temp set shebang to python2 until py3 compatibilty is done
      update doc scripts for the new structure
      Make testpath automagic via dwfeed's tweak
      fix '-' in stage names for python imports
      Add set_version command to setup.py.
      Streamline data_files generation with additional keys
      main.py, lock.py, fileops.py  remove shebangs
      Fix livecd source and target paths not ending with a slash
      Add my outgoing directory to ignore
      Strip trailing slash from subpath's if they exist when creating filenames.

Raúl Porcel (1):
      Add support for m68k

W. Trevor King (4):
      setup.py: Add disutils-based packaging
      Makefiles: create files directory before populating it
      Makefile: Set PYTHONPATH=. for make_target_table.py
      version: Remove shebang (Python modules are not scripts)

 .gitignore                                         |  10 +
 MANIFEST.in                                        |   6 +
 Makefile                                           |  19 +-
 bin/catalyst                                       |  46 ++
 catalyst/__init__.py                               |   8 +
 catalyst/arch/__init__.py                          |   1 +
 {arch => catalyst/arch}/alpha.py                   |   5 +-
 {arch => catalyst/arch}/amd64.py                   |   2 +-
 {arch => catalyst/arch}/arm.py                     |   4 +-
 {arch => catalyst/arch}/hppa.py                    |   3 +-
 {arch => catalyst/arch}/ia64.py                    |   3 +-
 catalyst/arch/m68k.py                              |  21 +
 {arch => catalyst/arch}/mips.py                    |   3 +-
 {arch => catalyst/arch}/powerpc.py                 |   9 +-
 {arch => catalyst/arch}/s390.py                    |   3 +-
 {arch => catalyst/arch}/sh.py                      |   3 +-
 {arch => catalyst/arch}/sparc.py                   |   9 +-
 {arch => catalyst/arch}/x86.py                     |   9 +-
 catalyst/base/__init__.py                          |   1 +
 catalyst/base/clearbase.py                         |  83 +++
 catalyst/base/genbase.py                           |  58 ++
 catalyst/base/resume.py                            | 166 +++++
 .../base/stagebase.py                              | 784 +++++++++------------
 catalyst/base/targetbase.py                        |  13 +
 {modules => catalyst}/builder.py                   |   0
 {modules/catalyst => catalyst}/config.py           |  19 +-
 catalyst/contents.py                               |  72 ++
 catalyst/defaults.py                               | 111 +++
 catalyst/fileops.py                                |  44 ++
 catalyst/hash_utils.py                             | 106 +++
 modules/catalyst_lock.py => catalyst/lock.py       |  95 ++-
 catalyst => catalyst/main.py                       | 258 +++----
 catalyst/support.py                                | 319 +++++++++
 catalyst/targets/__init__.py                       |   1 +
 .../targets/embedded.py                            |  16 +-
 modules/grp_target.py => catalyst/targets/grp.py   |  54 +-
 .../targets/livecd_stage1.py                       |  44 +-
 .../targets/livecd_stage2.py                       |  85 +--
 .../targets/netboot.py                             |  53 +-
 .../targets/netboot2.py                            |  82 ++-
 .../targets/snapshot.py                            |  32 +-
 .../stage1_target.py => catalyst/targets/stage1.py |  40 +-
 .../stage2_target.py => catalyst/targets/stage2.py |  33 +-
 .../stage3_target.py => catalyst/targets/stage3.py |  17 +-
 catalyst/targets/stage4.py                         |  39 +
 .../targets/tinderbox.py                           |  28 +-
 {modules/catalyst => catalyst}/util.py             |   0
 catalyst/version.py                                |  59 ++
 doc/HOWTO.txt                                      |  10 +-
 doc/catalyst-spec.5.txt                            |   4 +-
 doc/make_subarch_table_guidexml.py                 |   5 +-
 doc/make_target_table.py                           |  13 +-
 {files => etc}/.gitignore                          |   0
 {files => etc}/catalyst.conf                       |  22 +-
 {files => etc}/catalystrc                          |   0
 modules/catalyst/__init__.py                       |   0
 modules/catalyst_support.py                        | 718 -------------------
 modules/generic_target.py                          |  11 -
 modules/stage4_target.py                           |  43 --
 setup.py                                           | 123 ++++
 targets/embedded/embedded-chroot.sh                |   0
 targets/embedded/embedded-controller.sh            |  22 +-
 targets/embedded/embedded-fs-runscript.sh          |   0
 targets/embedded/embedded-preclean-chroot.sh       |   0
 targets/embedded/unmerge.sh                        |   0
 targets/grp/grp-chroot.sh                          |   0
 targets/grp/grp-controller.sh                      |   6 +-
 targets/grp/grp-preclean-chroot.sh                 |   0
 targets/livecd-stage1/livecd-stage1-chroot.sh      |   0
 targets/livecd-stage1/livecd-stage1-controller.sh  |   4 +-
 .../livecd-stage1/livecd-stage1-preclean-chroot.sh |   0
 targets/livecd-stage2/livecd-stage2-controller.sh  |  22 +-
 targets/netboot/netboot-chroot.sh                  |   0
 targets/netboot/netboot-combine.sh                 |   6 +-
 targets/netboot/netboot-controller.sh              |  24 +-
 targets/netboot/netboot-image.sh                   |   0
 targets/netboot2/netboot2-controller.sh            |  16 +-
 targets/netboot2/netboot2-copyfile.sh              |   0
 targets/netboot2/netboot2-pkg.sh                   |   0
 targets/stage1/build.py                            |   4 +-
 targets/stage1/stage1-chroot.sh                    |  25 +-
 targets/stage1/stage1-controller.sh                |  12 +-
 targets/stage1/stage1-preclean-chroot.sh           |   0
 targets/stage2/stage2-chroot.sh                    |   0
 targets/stage2/stage2-controller.sh                |   6 +-
 targets/stage2/stage2-preclean-chroot.sh           |   0
 targets/stage3/stage3-chroot.sh                    |   0
 targets/stage3/stage3-controller.sh                |   6 +-
 targets/stage3/stage3-preclean-chroot.sh           |   0
 targets/stage4/stage4-chroot.sh                    |   0
 targets/stage4/stage4-controller.sh                |  22 +-
 targets/stage4/stage4-preclean-chroot.sh           |   0
 targets/support/bootloader-setup.sh                |   6 +-
 targets/support/chroot-functions.sh                |  29 +-
 targets/support/create-iso.sh                      |   4 +-
 targets/support/filesystem-functions.sh            |   0
 targets/support/functions.sh                       |  18 +-
 targets/support/kill-chroot-pids.sh                |   0
 targets/support/kmerge.sh                          |  20 +-
 targets/support/livecdfs-update.sh                 |  12 +-
 targets/support/mips-arcload_conf.sh               |   0
 targets/support/netboot2-final.sh                  |   4 +-
 targets/support/post-kmerge.sh                     |   0
 targets/support/pre-kmerge.sh                      |   0
 targets/support/rc-update.sh                       |   0
 targets/support/target_image_setup.sh              |   4 +-
 targets/support/unmerge.sh                         |   0
 targets/tinderbox/tinderbox-chroot.sh              |   0
 targets/tinderbox/tinderbox-controller.sh          |   6 +-
 targets/tinderbox/tinderbox-preclean-chroot.sh     |   0
 testpath                                           |  18 +
 111 files changed, 2277 insertions(+), 1844 deletions(-)
 create mode 100644 MANIFEST.in
 create mode 100755 bin/catalyst
 create mode 100644 catalyst/__init__.py
 create mode 100644 catalyst/arch/__init__.py
 rename {arch => catalyst/arch}/alpha.py (98%)
 rename {arch => catalyst/arch}/amd64.py (99%)
 rename {arch => catalyst/arch}/arm.py (98%)
 rename {arch => catalyst/arch}/hppa.py (95%)
 rename {arch => catalyst/arch}/ia64.py (89%)
 create mode 100644 catalyst/arch/m68k.py
 rename {arch => catalyst/arch}/mips.py (99%)
 rename {arch => catalyst/arch}/powerpc.py (95%)
 rename {arch => catalyst/arch}/s390.py (95%)
 rename {arch => catalyst/arch}/sh.py (98%)
 rename {arch => catalyst/arch}/sparc.py (85%)
 rename {arch => catalyst/arch}/x86.py (95%)
 create mode 100644 catalyst/base/__init__.py
 create mode 100644 catalyst/base/clearbase.py
 create mode 100644 catalyst/base/genbase.py
 create mode 100644 catalyst/base/resume.py
 rename modules/generic_stage_target.py => catalyst/base/stagebase.py (69%)
 create mode 100644 catalyst/base/targetbase.py
 rename {modules => catalyst}/builder.py (100%)
 rename {modules/catalyst => catalyst}/config.py (87%)
 create mode 100644 catalyst/contents.py
 create mode 100644 catalyst/defaults.py
 create mode 100644 catalyst/fileops.py
 create mode 100644 catalyst/hash_utils.py
 rename modules/catalyst_lock.py => catalyst/lock.py (87%)
 rename catalyst => catalyst/main.py (55%)
 create mode 100644 catalyst/support.py
 create mode 100644 catalyst/targets/__init__.py
 rename modules/embedded_target.py => catalyst/targets/embedded.py (85%)
 rename modules/grp_target.py => catalyst/targets/grp.py (73%)
 rename modules/livecd_stage1_target.py => catalyst/targets/livecd_stage1.py (71%)
 rename modules/livecd_stage2_target.py => catalyst/targets/livecd_stage2.py (66%)
 rename modules/netboot_target.py => catalyst/targets/netboot.py (69%)
 rename modules/netboot2_target.py => catalyst/targets/netboot2.py (69%)
 rename modules/snapshot_target.py => catalyst/targets/snapshot.py (79%)
 rename modules/stage1_target.py => catalyst/targets/stage1.py (75%)
 rename modules/stage2_target.py => catalyst/targets/stage2.py (70%)
 rename modules/stage3_target.py => catalyst/targets/stage3.py (65%)
 create mode 100644 catalyst/targets/stage4.py
 rename modules/tinderbox_target.py => catalyst/targets/tinderbox.py (61%)
 rename {modules/catalyst => catalyst}/util.py (100%)
 create mode 100644 catalyst/version.py
 rename {files => etc}/.gitignore (100%)
 rename {files => etc}/catalyst.conf (90%)
 rename {files => etc}/catalystrc (100%)
 delete mode 100644 modules/catalyst/__init__.py
 delete mode 100644 modules/catalyst_support.py
 delete mode 100644 modules/generic_target.py
 delete mode 100644 modules/stage4_target.py
 create mode 100755 setup.py
 mode change 100644 => 100755 targets/embedded/embedded-chroot.sh
 mode change 100644 => 100755 targets/embedded/embedded-controller.sh
 mode change 100644 => 100755 targets/embedded/embedded-fs-runscript.sh
 mode change 100644 => 100755 targets/embedded/embedded-preclean-chroot.sh
 mode change 100644 => 100755 targets/embedded/unmerge.sh
 mode change 100644 => 100755 targets/grp/grp-chroot.sh
 mode change 100644 => 100755 targets/grp/grp-controller.sh
 mode change 100644 => 100755 targets/grp/grp-preclean-chroot.sh
 mode change 100644 => 100755 targets/livecd-stage1/livecd-stage1-chroot.sh
 mode change 100644 => 100755 targets/livecd-stage1/livecd-stage1-controller.sh
 mode change 100644 => 100755 targets/livecd-stage1/livecd-stage1-preclean-chroot.sh
 mode change 100644 => 100755 targets/livecd-stage2/livecd-stage2-controller.sh
 mode change 100644 => 100755 targets/netboot/netboot-chroot.sh
 mode change 100644 => 100755 targets/netboot/netboot-combine.sh
 mode change 100644 => 100755 targets/netboot/netboot-controller.sh
 mode change 100644 => 100755 targets/netboot/netboot-image.sh
 mode change 100644 => 100755 targets/netboot2/netboot2-controller.sh
 mode change 100644 => 100755 targets/netboot2/netboot2-copyfile.sh
 mode change 100644 => 100755 targets/netboot2/netboot2-pkg.sh
 mode change 100644 => 100755 targets/stage1/build.py
 mode change 100644 => 100755 targets/stage1/stage1-chroot.sh
 mode change 100644 => 100755 targets/stage1/stage1-controller.sh
 mode change 100644 => 100755 targets/stage1/stage1-preclean-chroot.sh
 mode change 100644 => 100755 targets/stage2/stage2-chroot.sh
 mode change 100644 => 100755 targets/stage2/stage2-controller.sh
 mode change 100644 => 100755 targets/stage2/stage2-preclean-chroot.sh
 mode change 100644 => 100755 targets/stage3/stage3-chroot.sh
 mode change 100644 => 100755 targets/stage3/stage3-controller.sh
 mode change 100644 => 100755 targets/stage3/stage3-preclean-chroot.sh
 mode change 100644 => 100755 targets/stage4/stage4-chroot.sh
 mode change 100644 => 100755 targets/stage4/stage4-controller.sh
 mode change 100644 => 100755 targets/stage4/stage4-preclean-chroot.sh
 mode change 100644 => 100755 targets/support/bootloader-setup.sh
 mode change 100644 => 100755 targets/support/chroot-functions.sh
 mode change 100644 => 100755 targets/support/create-iso.sh
 mode change 100644 => 100755 targets/support/filesystem-functions.sh
 mode change 100644 => 100755 targets/support/functions.sh
 mode change 100644 => 100755 targets/support/kill-chroot-pids.sh
 mode change 100644 => 100755 targets/support/kmerge.sh
 mode change 100644 => 100755 targets/support/livecdfs-update.sh
 mode change 100644 => 100755 targets/support/mips-arcload_conf.sh
 mode change 100644 => 100755 targets/support/netboot2-final.sh
 mode change 100644 => 100755 targets/support/post-kmerge.sh
 mode change 100644 => 100755 targets/support/pre-kmerge.sh
 mode change 100644 => 100755 targets/support/rc-update.sh
 mode change 100644 => 100755 targets/support/target_image_setup.sh
 mode change 100644 => 100755 targets/support/unmerge.sh
 mode change 100644 => 100755 targets/tinderbox/tinderbox-chroot.sh
 mode change 100644 => 100755 targets/tinderbox/tinderbox-controller.sh
 mode change 100644 => 100755 targets/tinderbox/tinderbox-preclean-chroot.sh
 create mode 100644 testpath

Each of my branches (bugs, releng-link, spec-comments, xsession,
pkgcache-warning, sshd-tweak) apply on either side of this series
without conflicts, after which the diff vs. origin/rewrite-on-master
is:

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
sindex 4ace63d..99f4015 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -198,11 +198,11 @@ class StageBase(TargetBase, ClearBase, GenBase):
 				"portdir":normpath(self.settings["snapshot_cache_path"]+"/" + self.settings["repo_name"]),
 				"distdir":self.settings["distdir"],"port_tmpdir":"tmpfs"}
 		else:
-			self.mounts = ["proc", "dev", "distdir", "port_tmpdir"]
-			self.mountmap = {"proc":"/proc", "dev":"/dev", "devpts":"/dev/pts",
+			self.mounts=["proc","dev", "distdir", "port_tmpdir"]
+			self.mountmap={"proc":"/proc", "dev":"/dev", "pts":"/dev/pts",
 				"distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}
 		if os.uname()[0] == "Linux":
-			self.mounts.append("devpts")
+			self.mounts.append("pts")
 
 		self.set_mounts()
 
@@ -222,7 +222,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			print "Location of the kerncache is "+\
 				self.settings["kerncache_path"]
 			self.mounts.append("kerncache")
-			self.mountmap["kerncache"] = self.settings["kerncache_path"]
+			self.mountmap["kerncache"]=self.settings["kerncache_path"]
 
 		if "ccache" in self.settings["options"]:
 			if "CCACHE_DIR" in os.environ:
@@ -235,7 +235,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 					"Compiler cache support can't be enabled (can't find "+\
 					ccdir+")")
 			self.mounts.append("ccache")
-			self.mountmap["ccache"] = ccdir
+			self.mountmap["ccache"]=ccdir
 			""" for the chroot: """
 			self.env["CCACHE_DIR"] = self.target_mounts["ccache"]
 
@@ -429,7 +429,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 	def set_snapshot_path(self):
 		self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
 			"/snapshots/" + self.settings["snapshot_name"] +
-			self.settings["snapshot"].rstrip('/') + ".tar.xz")
+			self.settings["snapshot"].rstrip('/')+".tar.xz")
 
 		if os.path.exists(self.settings["snapshot_path"]):
 			self.settings["snapshot_path_hash"]=\
@@ -440,7 +440,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 		else:
 			self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
 				"/snapshots/" + self.settings["snapshot_name"] +
-				self.settings["snapshot"].rstrip('/') + ".tar.bz2")
+				self.settings["snapshot"].rstrip('/')+".tar.bz2")
 
 			if os.path.exists(self.settings["snapshot_path"]):
 				self.settings["snapshot_path_hash"]=\
@@ -806,7 +806,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 				print "Valid snapshot cache, skipping unpack of portage tree..."
 				unpack=False
 		else:
-			destdir = normpath(self.settings["chroot_path"] + self.settings["portdir"])
+			destdir=normpath(self.settings["chroot_path"] + self.settings["portdir"])
 			cleanup_errmsg="Error removing existing snapshot directory."
 			cleanup_msg=\
 				"Cleaning up existing portage tree (This can take a long time)..."
@@ -930,10 +930,10 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			if os.uname()[0] == "FreeBSD":
 				if src == "/dev":
 					cmd = "mount -t devfs none " + target
-					retval = os.system(cmd)
+					retval=os.system(cmd)
 				else:
 					cmd = "mount_nullfs " + src + " " + target
-					retval = os.system(cmd)
+					retval=os.system(cmd)
 			else:
 				if src == "tmpfs":
 					if "var_tmpfs_portage" in self.settings:
@@ -944,7 +944,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 				else:
 					cmd = "mount --bind " + src + " " + target
 					#print "bind(); cmd =", cmd
-					retval = os.system(cmd)
+					retval=os.system(cmd)
 			if retval!=0:
 				self.unbind()
 				raise CatalystError("Couldn't bind mount " + src + "\n" + cmd)
@@ -971,7 +971,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 				self.kill_chroot_pids()
 
-				retval2 = os.system("umount " + target)
+				retval2=os.system("umount " + target)
 				if retval2!=0:
 					ouch=1
 					warn("Couldn't umount bind mount: " + target)
diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 78ce29f..58c44c8 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -57,8 +57,7 @@ contents_definitions = {
 }
 
 
-confdefaults = {
+confdefaults={
 	"archdir": "%(PythonDir)s/arch",
 	"distdir": "/usr/portage/distfiles",
 	"hash_function": "crc32",
@@ -71,11 +70,10 @@ confdefaults = {
 	"port_tmpdir": "/var/tmp/portage",
 	"PythonDir": "./catalyst",
 	"repo_name": "portage",
-	"sharedir": "/usr/share/catalyst",
+	"sharedir": "/usr/lib/catalyst",
 	"shdir": "/usr/lib/catalyst/targets/",
 	"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
 	"snapshot_name": "portage-",
-	"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
 	"storedir": "/var/tmp/catalyst",
 	}
 
diff --git a/catalyst/main.py b/catalyst/main.py
old mode 100755
new mode 100644
index 9bac6ce..8546810
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -71,7 +71,7 @@ def parse_config(myconfig):
 	# first, try the one passed (presumably from the cmdline)
 	if myconfig:
 		if os.path.exists(myconfig):
-			print "Using command line specified Catalyst configuration file, " + \
+			print "Using command line specified Catalyst configuration file, "+\
 				myconfig
 			config_file=myconfig
 
diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py
index 1887110..98cae14 100644
--- a/catalyst/targets/snapshot.py
+++ b/catalyst/targets/snapshot.py
@@ -24,7 +24,7 @@ class snapshot(TargetBase, GenBase):
 		#self.settings=myspec
 		self.settings["target_subpath"]="portage"
 		st=self.settings["storedir"]
-		self.settings["snapshot_path"] = normpath(st + "/snapshots/"
+		self.settings["snapshot_path"]=normpath(st + "/snapshots/"
 			+ self.settings["snapshot_name"]
 			+ self.settings["version_stamp"] + ".tar.bz2")
 		self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpath"])
@@ -54,11 +54,11 @@ class snapshot(TargetBase, GenBase):
 		cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ " +
 			"--exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* " +
 			self.settings["portdir"] + "/ " + mytmp + "/%s/" % self.settings["repo_name"],
-			"Snapshot failure", env=self.env)
+			"Snapshot failure",env=self.env)
 
 		print "Compressing Portage snapshot tarball..."
 		cmd("tar -I lbzip2 -cf " + self.settings["snapshot_path"] + " -C " +
-			mytmp + " " + self.settings["repo_name"],
+			mytmp + " %s" % self.settings["repo_name"],
 			"Snapshot creation failure",env=self.env)
 
 		self.gen_contents_file(self.settings["snapshot_path"])
diff --git a/catalyst/targets/tinderbox.py b/catalyst/targets/tinderbox.py
index ed1bc95..2cebaa8 100644
--- a/catalyst/targets/tinderbox.py
+++ b/catalyst/targets/tinderbox.py
@@ -35,12 +35,8 @@ class tinderbox(StageBase):
 				print_traceback=True)
 
 	def set_cleanables(self):
-		self.settings['cleanables'] = [
-			'/etc/resolv.conf',
-			'/var/tmp/*',
-			'/root/*',
-			self.settings['portdir'],
-			]
+		self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",
+					self.settings['portdir']]
 
 	def set_action_sequence(self):
 		#Default action sequence for run method

If that looks ok, I suggest we drop origin/rewrite-on-master in favor
of wking/rewrite-without-wtk.

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [gentoo-catalyst] [PATCH 1/4] Add more configured defaults
  2013-12-14 14:33   ` Dylan Baker
  2013-12-14 16:31     ` W. Trevor King
@ 2013-12-15  0:05     ` W. Trevor King
  1 sibling, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  0:05 UTC (permalink / raw
  To: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 998 bytes --]

On Sat, Dec 14, 2013 at 06:33:43AM -0800, Dylan Baker wrote:
> I'd also suggest using the str.format() method instead of
> concatenating a large number of strings and variables, it's much
> more readable IMHO:
>
> self.settings["snapshot_path"] = os.path.normpath(
> 	"{0}/snapshots/{1}{2}.tar.xz".format(
> 		self.settings["storedir"], self.settings["snapshot_name"],
> 		self.settings["snapshot"]))

I love format().  In fact, I'd suggest:

  normpath('{storedir}/snapshots/{snapshot_name}{snapshot}.tar.xz'.format(
      **self.settings))

However, the string formatting syntax is orthogonal to the
snapshot_name setting, which is what Brian's adding in this patch.  I
think a refactor that converts Catalyst to format() would be great,
but it should probably wait until after Brian's rewrite lands.

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1)
  2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
                                 ` (21 preceding siblings ...)
  2013-12-14 22:29               ` [gentoo-catalyst] Re: [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
@ 2013-12-15  0:24               ` Matt Turner
  2013-12-15  1:40                 ` W. Trevor King
  22 siblings, 1 reply; 79+ messages in thread
From: Matt Turner @ 2013-12-15  0:24 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: W. Trevor King

On Sat, Dec 14, 2013 at 2:24 PM, W. Trevor King <wking@tremily.us> wrote:
> From: "W. Trevor King" <wking@tremily.us>
>
> On Sat, Dec 14, 2013 at 10:44:13AM -0800, Matt Turner wrote:
>> I feel they're basically ready to go, but I want everyone to be in
>> the habit of sending patches to the list, so please do.
>
> Here you go :).

Looks good to me. The whole thing is

Reviewed-by: Matt Turner <mattst88@gentoo.org>

I'd drop the last patch unless it will make rebasing particularly
difficult. Your call.


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

* Re: [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1)
  2013-12-15  0:24               ` [gentoo-catalyst] " Matt Turner
@ 2013-12-15  1:40                 ` W. Trevor King
  0 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  1:40 UTC (permalink / raw
  To: Matt Turner; +Cc: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 1077 bytes --]

On Sat, Dec 14, 2013 at 04:24:25PM -0800, Matt Turner wrote:
> On Sat, Dec 14, 2013 at 2:24 PM, W. Trevor King <wking@tremily.us> wrote:
> > From: "W. Trevor King" <wking@tremily.us>
> >
> > On Sat, Dec 14, 2013 at 10:44:13AM -0800, Matt Turner wrote:
> >> I feel they're basically ready to go, but I want everyone to be in
> >> the habit of sending patches to the list, so please do.
> >
> > Here you go :).
> 
> Looks good to me. The whole thing is
> 
> Reviewed-by: Matt Turner <mattst88@gentoo.org>

Excellent.  Pending issues raised by others, we're just waiting on
Brian's ack of my Git reshuffle and minor tweaks.

> I'd drop the last patch unless it will make rebasing particularly
> difficult. Your call.

I just rebased locally, and it wasn't bad.  Brian touches a number of
these lines later anyway with some logical refactoring, so they'll
just get re-wrapped then.

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [gentoo-catalyst] [PATCH v2 10/21] catalyst: Add 'port_tmpdir' default instead of hard-coding '/var/tmp/portage'
  2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 10/21] catalyst: Add 'port_tmpdir' default instead of hard-coding '/var/tmp/portage' W. Trevor King
@ 2013-12-15  2:56                 ` Brian Dolbec
  2013-12-15  3:07                   ` W. Trevor King
  0 siblings, 1 reply; 79+ messages in thread
From: Brian Dolbec @ 2013-12-15  2:56 UTC (permalink / raw
  To: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 2299 bytes --]

On Sat, 2013-12-14 at 14:24 -0800, W. Trevor King wrote:
> From: Brian Dolbec <dolsen@gentoo.org>
> 
> W. Trevor King: Refactored Git history for Brian Dolbec's content changes.
> 
> Signed-off-by: W. Trevor King <wking@tremily.us>
> ---
>  catalyst | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/catalyst b/catalyst
> index c62b745..cafc6e5 100755
> --- a/catalyst
> +++ b/catalyst
> @@ -67,6 +67,7 @@ def parse_config(myconfig):
>  		"options": "",
>  		"packagedir": "/usr/portage/packages",
>  		"portdir": "/usr/portage",
> +		"port_tmpdir": "/var/tmp/portage",
>  		"repo_name": "portage",
>  		"sharedir": "/usr/share/catalyst",
>  		"snapshot_name": "portage-",


Granted, my commits might have included too much for releng to handle
for review.  Especially after I had merged commits into complete units
where possible (as had been requested).  But, isn't this ridiculous.  I
was even chastised before for adding something that wasn't used right
away. I consequently had to rebase it away.

This should be merged with commit 15 of this (once again) rebased series
at least.  I've copy/pasted it here.

---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index e5bdf91..2426b12 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -179,9 +179,9 @@ class generic_stage_target(generic_target):
                                "/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
                                "/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
                else:
-                       self.mounts = ["proc", "dev", "distdir", "/var/tmp/portage"]
+                       self.mounts = ["proc", "dev", "distdir", "port_tmpdir"]
                        self.mountmap = {"proc":"/proc", "dev":"/dev", "/dev/pts":"/dev/pts",\
-                               "distdir":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
+                               "distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}
                if os.uname()[0] == "Linux":
                        self.mounts.append("/dev/pts")
 


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

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

* Re: [gentoo-catalyst] [PATCH v2 10/21] catalyst: Add 'port_tmpdir' default instead of hard-coding '/var/tmp/portage'
  2013-12-15  2:56                 ` Brian Dolbec
@ 2013-12-15  3:07                   ` W. Trevor King
  2013-12-15  3:22                     ` W. Trevor King
  0 siblings, 1 reply; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  3:07 UTC (permalink / raw
  To: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 1344 bytes --]

On Sat, Dec 14, 2013 at 06:56:23PM -0800, Brian Dolbec wrote:
> On Sat, 2013-12-14 at 14:24 -0800, W. Trevor King wrote:
> > +		"port_tmpdir": "/var/tmp/portage",
> 
> But, isn't this ridiculous.  I was even chastised before for adding
> something that wasn't used right away. I consequently had to rebase
> it away.

Sure.  I don't think we use settings['port_tmpdir'] in this part of
the series though.  I can shift this commit back to the next phase if
folks think that's appropriate.

> -                       self.mounts = ["proc", "dev", "distdir", "/var/tmp/portage"]
> +                       self.mounts = ["proc", "dev", "distdir", "port_tmpdir"]
>                         self.mountmap = {"proc":"/proc", "dev":"/dev", "/dev/pts":"/dev/pts",\
> -                               "distdir":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
> +                               "distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}

This is changing the *mountmap key* to port_tmpdir, but it's not
changing the *mount target*.  I'm not sure where that happens, maybe
it's automatically extracted from settings using the mountmap key?

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [gentoo-catalyst] [PATCH v2 10/21] catalyst: Add 'port_tmpdir' default instead of hard-coding '/var/tmp/portage'
  2013-12-15  3:07                   ` W. Trevor King
@ 2013-12-15  3:22                     ` W. Trevor King
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
  0 siblings, 1 reply; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  3:22 UTC (permalink / raw
  To: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 1200 bytes --]

On Sat, Dec 14, 2013 at 07:07:57PM -0800, W. Trevor King wrote:
> On Sat, Dec 14, 2013 at 06:56:23PM -0800, Brian Dolbec wrote:
> > -                       self.mounts = ["proc", "dev", "distdir", "/var/tmp/portage"]
> > +                       self.mounts = ["proc", "dev", "distdir", "port_tmpdir"]
> >                         self.mountmap = {"proc":"/proc", "dev":"/dev", "/dev/pts":"/dev/pts",\
> > -                               "distdir":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
> > +                               "distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}
> 
> This is changing the *mountmap key* to port_tmpdir, but it's not
> changing the *mount target*.  I'm not sure where that happens, maybe
> it's automatically extracted from settings using the mountmap key?

Oops, I mean't “mount source” not “mount target” :p.  I grepped
through the rest of rewrite-on-master, and I don't see
settings["port_tmpdir"] anywhere.  Perhaps we should just drop this
commit?

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1)
  2013-12-15  3:22                     ` W. Trevor King
@ 2013-12-15  4:00                       ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 01/19] modules/tinderbox_target.py: Use 'portdir' instead of hard-coding '/usr/portage' W. Trevor King
                                           ` (18 more replies)
  0 siblings, 19 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: W. Trevor King

From: "W. Trevor King" <wking@tremily.us>

Here we are again.  Changes since v2:

* Dropped:
  * catalyst: Add 'port_tmpdir' default instead of hard-coding '/var/tmp/portage'
  * catalyst: cleanup long lines
* Added Signed-off-by lines for Brian, after an ack on #gentoo-releng

For the request-pull camp:

  The following changes since commit 1c86c64113491885b159529dacb452ce6a3e5f4b:

    catalyst 2.0.15 (2013-11-13 13:59:25 -0800)

  are available in the git repository at:

    git://tremily.us/catalyst.git dolsen-rewrite-part-1

  for you to fetch changes up to b95ae6e2e570390c406ed9ee8e01d69fa6ffe66e:

    catalst: improve usage() output formatting slightly (2013-12-14 19:51:17 -0800)

And for the send-email camp:

Brian Dolbec (19):
  modules/tinderbox_target.py: Use 'portdir' instead of hard-coding
    '/usr/portage'
  modules/generic_stage_target.py: Use 'portdir' instead of hard-coding
    '/usr/portage'
  modules/generic_stage_target.py: Use 'portdir' instead of hard-coding
    '/usr/portage'
  modules/generic_stage_target.py: Use 'distdir' instead of hard-coding
    '${PORTAGE}/distfiles'
  modules/generic_stage_target.py: Use a 'local_overlay' setting instead
    of hard-coding '/usr/local/portage'
  catalyst: Split confdefaults into line-per-entry
  catalyst: Add 'repo_name' default
  catalyst: Add 'snapshot_name' default
  catalyst: Add 'packagedir' default instead of hard-coding
    '/usr/portage/packages'
  modules/generic_stage_target.py: Don't use paths as mountmap keys
  modules/generic_stage_target.py: Use 'proc' instead of '/proc' as the
    mountmap key
  modules/generic_stage_target.py: Use 'dev' instead of '/dev' as the
    mountmap key
  modules/generic_stage_target.py: Use 'distdir' instead of
    '/usr/portage/distfiles' as the mountmap key
  modules/generic_stage_target.py: Use 'port_tmpdir' instead of
    '/var/tmp/portage' as the mountmap key
  modules/generic_stage_target.py: Use 'devpts' instead of '/dev/pts' as
    the mountmap key
  modules/generic_stage_target.py: Use 'packagedir' instead of
    '/usr/portage/packages' as the mountmap key
  modules/generic_stage_target.py: Use 'kerncache' instead of
    '/tmp/kerncache' as the mountmap key
  modules/generic_stage_target.py: Use 'ccache' instead of
    '/var/tmp/ccache' as the mountmap key
  catalst: improve usage() output formatting slightly

 catalyst                        | 69 +++++++++++++++++--------------
 modules/generic_stage_target.py | 92 +++++++++++++++++++++--------------------
 modules/snapshot_target.py      | 14 ++++---
 modules/tinderbox_target.py     |  8 +++-
 4 files changed, 101 insertions(+), 82 deletions(-)

-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 01/19] modules/tinderbox_target.py: Use 'portdir' instead of hard-coding '/usr/portage'
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 02/19] modules/generic_stage_target.py: " W. Trevor King
                                           ` (17 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content
changes with additional whitespace cleanups.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 modules/tinderbox_target.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/tinderbox_target.py b/modules/tinderbox_target.py
index 46fe082..ca55610 100644
--- a/modules/tinderbox_target.py
+++ b/modules/tinderbox_target.py
@@ -29,8 +29,12 @@ class tinderbox_target(generic_stage_target):
 			raise CatalystError,"Tinderbox aborting due to error."
 
 	def set_cleanables(self):
-	    self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",\
-					"/usr/portage"]
+		self.settings['cleanables'] = [
+			'/etc/resolv.conf',
+			'/var/tmp/*',
+			'/root/*',
+			self.settings['portdir'],
+			]
 
 	def set_action_sequence(self):
 		#Default action sequence for run method
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 02/19] modules/generic_stage_target.py: Use 'portdir' instead of hard-coding '/usr/portage'
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 01/19] modules/tinderbox_target.py: Use 'portdir' instead of hard-coding '/usr/portage' W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 03/19] " W. Trevor King
                                           ` (16 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 modules/generic_stage_target.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 848aca2..0871cba 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -406,7 +406,7 @@ class generic_stage_target(generic_target):
 
 	def set_cleanables(self):
 		self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/tmp/*",\
-			"/root/*","/usr/portage"]
+			"/root/*", self.settings["portdir"]]
 
 	def set_snapshot_path(self):
 		self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
@@ -785,7 +785,7 @@ class generic_stage_target(generic_target):
 				print "Valid snapshot cache, skipping unpack of portage tree..."
 				unpack=False
 		else:
-			destdir=normpath(self.settings["chroot_path"]+"/usr/portage")
+			destdir = normpath(self.settings["chroot_path"] + self.settings["portdir"])
 			cleanup_errmsg="Error removing existing snapshot directory."
 			cleanup_msg=\
 				"Cleaning up existing portage tree (This can take a long time)..."
@@ -799,7 +799,7 @@ class generic_stage_target(generic_target):
 
 			if "AUTORESUME" in self.settings \
 				and os.path.exists(self.settings["chroot_path"]+\
-					"/usr/portage/") \
+					self.settings["portdir"]) \
 				and os.path.exists(self.settings["autoresume_path"]\
 					+"unpack_portage") \
 				and self.settings["snapshot_path_hash"] == snapshot_hash:
@@ -846,7 +846,7 @@ class generic_stage_target(generic_target):
 			cmd("rm -f "+self.settings["chroot_path"]+"/etc/portage/make.profile",\
 					"Error zapping profile link",env=self.env)
 			cmd("mkdir -p "+self.settings["chroot_path"]+"/etc/portage/")
-			cmd("ln -sf ../../usr/portage/profiles/"+\
+			cmd("ln -sf ../.." + self.settings["portdir"] + "/profiles/" + \
 				self.settings["target_profile"]+" "+\
 				self.settings["chroot_path"]+"/etc/portage/make.profile",\
 				"Error creating profile link",env=self.env)
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 03/19] modules/generic_stage_target.py: Use 'portdir' instead of hard-coding '/usr/portage'
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 01/19] modules/tinderbox_target.py: Use 'portdir' instead of hard-coding '/usr/portage' W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 02/19] modules/generic_stage_target.py: " W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 04/19] modules/generic_stage_target.py: Use 'distdir' instead of hard-coding '${PORTAGE}/distfiles' W. Trevor King
                                           ` (15 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 modules/generic_stage_target.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 0871cba..0803a8c 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -1064,7 +1064,7 @@ class generic_stage_target(generic_target):
 						"/use will cause portage to ignore"
 					print "\tpackage.use in the profile and portage_confdir. You've been warned!"
 
-			myf.write('PORTDIR="/usr/portage"\n')
+			myf.write('PORTDIR="%s"\n' % self.settings['portdir'])
 			myf.write('DISTDIR="${PORTDIR}/distfiles"\n')
 			myf.write('PKGDIR="${PORTDIR}/packages"\n')
 
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 04/19] modules/generic_stage_target.py: Use 'distdir' instead of hard-coding '${PORTAGE}/distfiles'
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (2 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 03/19] " W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 05/19] modules/generic_stage_target.py: Use a 'local_overlay' setting instead of hard-coding '/usr/local/portage' W. Trevor King
                                           ` (14 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 modules/generic_stage_target.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 0803a8c..fc54fbf 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -1065,7 +1065,7 @@ class generic_stage_target(generic_target):
 					print "\tpackage.use in the profile and portage_confdir. You've been warned!"
 
 			myf.write('PORTDIR="%s"\n' % self.settings['portdir'])
-			myf.write('DISTDIR="${PORTDIR}/distfiles"\n')
+			myf.write('DISTDIR="%s"\n' % self.settings['distdir'])
 			myf.write('PKGDIR="${PORTDIR}/packages"\n')
 
 			""" Setup the portage overlay """
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 05/19] modules/generic_stage_target.py: Use a 'local_overlay' setting instead of hard-coding '/usr/local/portage'
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (3 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 04/19] modules/generic_stage_target.py: Use 'distdir' instead of hard-coding '${PORTAGE}/distfiles' W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 06/19] catalyst: Split confdefaults into line-per-entry W. Trevor King
                                           ` (13 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 modules/generic_stage_target.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index fc54fbf..6ee35d2 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -872,10 +872,10 @@ class generic_stage_target(generic_target):
 				if os.path.exists(x):
 					print "Copying overlay dir " +x
 					cmd("mkdir -p "+self.settings["chroot_path"]+\
-						"/usr/local/portage",\
+						self.settings["local_overlay"],\
 						"Could not make portage_overlay dir",env=self.env)
 					cmd("cp -R "+x+"/* "+self.settings["chroot_path"]+\
-						"/usr/local/portage",\
+						self.settings["local_overlay"],\
 						"Could not copy portage_overlay",env=self.env)
 
 	def root_overlay(self):
@@ -1116,9 +1116,9 @@ class generic_stage_target(generic_target):
 				"Could not replace /etc/hosts",env=self.env)
 
 		""" Remove our overlay """
-		if os.path.exists(self.settings["chroot_path"]+"/usr/local/portage"):
-			cmd("rm -rf "+self.settings["chroot_path"]+"/usr/local/portage",\
-				"Could not remove /usr/local/portage",env=self.env)
+		if os.path.exists(self.settings["chroot_path"] + self.settings["local_overlay"]):
+			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",\
 				"Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 06/19] catalyst: Split confdefaults into line-per-entry
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (4 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 05/19] modules/generic_stage_target.py: Use a 'local_overlay' setting instead of hard-coding '/usr/local/portage' W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 07/19] catalyst: Add 'repo_name' default W. Trevor King
                                           ` (12 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

This makes it easy to find the key you're looking for.  Future
additions and removals will also have cleaner diffs.

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 catalyst | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/catalyst b/catalyst
index ba26f3c..e229133 100755
--- a/catalyst
+++ b/catalyst
@@ -61,11 +61,15 @@ def parse_config(myconfig):
 	myconf={}
 	config_file=""
 
-	confdefaults={ "storedir":"/var/tmp/catalyst",\
-		"sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles",\
-		"portdir":"/usr/portage","options":"",\
-		"snapshot_cache":"/var/tmp/catalyst/snapshot_cache",\
-		"hash_function":"crc32"}
+	confdefaults = {
+		"distdir": "/usr/portage/distfiles",
+		"hash_function": "crc32",
+		"options": "",
+		"portdir": "/usr/portage",
+		"sharedir": "/usr/share/catalyst",
+		"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
+		"storedir": "/var/tmp/catalyst",
+		}
 
 	# first, try the one passed (presumably from the cmdline)
 	if myconfig:
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 07/19] catalyst: Add 'repo_name' default
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (5 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 06/19] catalyst: Split confdefaults into line-per-entry W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 08/19] catalyst: Add 'snapshot_name' default W. Trevor King
                                           ` (11 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 catalyst                   | 1 +
 modules/snapshot_target.py | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/catalyst b/catalyst
index e229133..0fc65b0 100755
--- a/catalyst
+++ b/catalyst
@@ -66,6 +66,7 @@ def parse_config(myconfig):
 		"hash_function": "crc32",
 		"options": "",
 		"portdir": "/usr/portage",
+		"repo_name": "portage",
 		"sharedir": "/usr/share/catalyst",
 		"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
 		"storedir": "/var/tmp/catalyst",
diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py
index e93a86a..02b9831 100644
--- a/modules/snapshot_target.py
+++ b/modules/snapshot_target.py
@@ -46,11 +46,14 @@ class snapshot_target(generic_stage_target):
 		if not os.path.exists(mytmp):
 			os.makedirs(mytmp)
 
-		cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ --exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* "+\
-			self.settings["portdir"]+"/ "+mytmp+"/portage/","Snapshot failure",env=self.env)
+		cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ " +
+			"--exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* " +
+			self.settings["portdir"] + "/ " + mytmp + "/%s/" % self.settings["repo_name"],
+			"Snapshot failure", env=self.env)
 
 		print "Compressing Portage snapshot tarball..."
-		cmd("tar -I lbzip2 -cf "+self.settings["snapshot_path"]+" -C "+mytmp+" portage",\
+		cmd("tar -I lbzip2 -cf " + self.settings["snapshot_path"] + " -C " +
+			mytmp + " " + self.settings["repo_name"],
 			"Snapshot creation failure",env=self.env)
 
 		self.gen_contents_file(self.settings["snapshot_path"])
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 08/19] catalyst: Add 'snapshot_name' default
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (6 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 07/19] catalyst: Add 'repo_name' default W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 09/19] catalyst: Add 'packagedir' default instead of hard-coding '/usr/portage/packages' W. Trevor King
                                           ` (10 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 catalyst                        | 1 +
 modules/generic_stage_target.py | 6 ++++--
 modules/snapshot_target.py      | 5 +++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/catalyst b/catalyst
index 0fc65b0..131529a 100755
--- a/catalyst
+++ b/catalyst
@@ -68,6 +68,7 @@ def parse_config(myconfig):
 		"portdir": "/usr/portage",
 		"repo_name": "portage",
 		"sharedir": "/usr/share/catalyst",
+		"snapshot_name": "portage-",
 		"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
 		"storedir": "/var/tmp/catalyst",
 		}
diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 6ee35d2..63661fe 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -410,7 +410,8 @@ class generic_stage_target(generic_target):
 
 	def set_snapshot_path(self):
 		self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
-			"/snapshots/portage-"+self.settings["snapshot"]+".tar.xz")
+			"/snapshots/" + self.settings["snapshot_name"] +
+			self.settings["snapshot"] + ".tar.xz")
 
 		if os.path.exists(self.settings["snapshot_path"]):
 			self.settings["snapshot_path_hash"]=\
@@ -418,7 +419,8 @@ class generic_stage_target(generic_target):
 				hash_function=self.settings["hash_function"],verbose=False)
 		else:
 			self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
-				"/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2")
+				"/snapshots/" + self.settings["snapshot_name"] +
+				self.settings["snapshot"] + ".tar.bz2")
 
 			if os.path.exists(self.settings["snapshot_path"]):
 				self.settings["snapshot_path_hash"]=\
diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py
index 02b9831..ba1bab5 100644
--- a/modules/snapshot_target.py
+++ b/modules/snapshot_target.py
@@ -18,8 +18,9 @@ class snapshot_target(generic_stage_target):
 		self.settings=myspec
 		self.settings["target_subpath"]="portage"
 		st=self.settings["storedir"]
-		self.settings["snapshot_path"]=normpath(st+"/snapshots/portage-"+self.settings["version_stamp"]\
-			+".tar.bz2")
+		self.settings["snapshot_path"] = normpath(st + "/snapshots/"
+			+ self.settings["snapshot_name"]
+			+ self.settings["version_stamp"] + ".tar.bz2")
 		self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpath"])
 
 	def setup(self):
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 09/19] catalyst: Add 'packagedir' default instead of hard-coding '/usr/portage/packages'
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (7 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 08/19] catalyst: Add 'snapshot_name' default W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 10/19] modules/generic_stage_target.py: Don't use paths as mountmap keys W. Trevor King
                                           ` (9 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 catalyst                        | 1 +
 modules/generic_stage_target.py | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/catalyst b/catalyst
index 131529a..c62b745 100755
--- a/catalyst
+++ b/catalyst
@@ -65,6 +65,7 @@ def parse_config(myconfig):
 		"distdir": "/usr/portage/distfiles",
 		"hash_function": "crc32",
 		"options": "",
+		"packagedir": "/usr/portage/packages",
 		"portdir": "/usr/portage",
 		"repo_name": "portage",
 		"sharedir": "/usr/share/catalyst",
diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 63661fe..c890773 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -1068,7 +1068,7 @@ class generic_stage_target(generic_target):
 
 			myf.write('PORTDIR="%s"\n' % self.settings['portdir'])
 			myf.write('DISTDIR="%s"\n' % self.settings['distdir'])
-			myf.write('PKGDIR="${PORTDIR}/packages"\n')
+			myf.write('PKGDIR="%s"\n' % self.settings['packagedir'])
 
 			""" Setup the portage overlay """
 			if "portage_overlay" in self.settings:
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 10/19] modules/generic_stage_target.py: Don't use paths as mountmap keys
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (8 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 09/19] catalyst: Add 'packagedir' default instead of hard-coding '/usr/portage/packages' W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 11/19] modules/generic_stage_target.py: Use 'proc' instead of '/proc' as the mountmap key W. Trevor King
                                           ` (8 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 modules/generic_stage_target.py | 41 +++++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index c890773..a68b356 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -615,21 +615,21 @@ class generic_stage_target(generic_target):
 			return
 
 		for x in self.mounts:
-			if not os.path.exists(mypath+x):
+			if not os.path.exists(mypath + self.mountmap[x]):
 				continue
 
-			if ismount(mypath+x):
+			if ismount(mypath + self.mountmap[x]):
 				""" Something is still mounted "" """
 				try:
-					print x+" is still mounted; performing auto-bind-umount...",
+					print self.mountmap[x] + " is still mounted; performing auto-bind-umount...",
 					""" Try to umount stuff ourselves """
 					self.unbind()
-					if ismount(mypath+x):
-						raise CatalystError, "Auto-unbind failed for "+x
+					if ismount(mypath + self.mountmap[x]):
+						raise CatalystError, "Auto-unbind failed for " + self.mountmap[x]
 					else:
 						print "Auto-unbind successful..."
 				except CatalystError:
-					raise CatalystError, "Unable to auto-unbind "+x
+					raise CatalystError, "Unable to auto-unbind " + self.mountmap[x]
 
 	def unpack(self):
 		unpack=True
@@ -897,7 +897,7 @@ class generic_stage_target(generic_target):
 
 	def bind(self):
 		for x in self.mounts:
-			if not os.path.exists(self.settings["chroot_path"]+x):
+			if not os.path.exists(self.settings["chroot_path"] + self.mountmap[x]):
 				os.makedirs(self.settings["chroot_path"]+x,0755)
 
 			if not os.path.exists(self.mountmap[x]):
@@ -909,11 +909,11 @@ class generic_stage_target(generic_target):
 				self.snapshot_lock_object.read_lock()
 			if os.uname()[0] == "FreeBSD":
 				if src == "/dev":
-					retval=os.system("mount -t devfs none "+\
-						self.settings["chroot_path"]+x)
+					retval = os.system("mount -t devfs none " +
+						self.settings["chroot_path"] + src)
 				else:
-					retval=os.system("mount_nullfs "+src+" "+\
-						self.settings["chroot_path"]+x)
+					retval = os.system("mount_nullfs " + src + " " +
+						self.settings["chroot_path"] + src)
 			else:
 				if src == "tmpfs":
 					if "var_tmpfs_portage" in self.settings:
@@ -921,11 +921,11 @@ class generic_stage_target(generic_target):
 							self.settings["var_tmpfs_portage"]+"G "+src+" "+\
 							self.settings["chroot_path"]+x)
 				else:
-					retval=os.system("mount --bind "+src+" "+\
-						self.settings["chroot_path"]+x)
+					retval = os.system("mount --bind " + src + " " +
+						self.settings["chroot_path"] + src)
 			if retval!=0:
 				self.unbind()
-				raise CatalystError,"Couldn't bind mount "+src
+				raise CatalystError,"Couldn't bind mount " + src
 
 	def unbind(self):
 		ouch=0
@@ -934,25 +934,26 @@ class generic_stage_target(generic_target):
 		myrevmounts.reverse()
 		""" Unmount in reverse order for nested bind-mounts """
 		for x in myrevmounts:
-			if not os.path.exists(mypath+x):
+			if not os.path.exists(mypath + self.mountmap[x]):
 				continue
 
-			if not ismount(mypath+x):
+			if not ismount(mypath + self.mountmap[x]):
 				continue
 
 			retval=os.system("umount "+\
-				os.path.join(mypath,x.lstrip(os.path.sep)))
+				os.path.join(mypath, self.mountmap[x].lstrip(os.path.sep)))
 
 			if retval!=0:
-				warn("First attempt to unmount: "+mypath+x+" failed.")
+				warn("First attempt to unmount: " + mypath +
+					self.mountmap[x] +" failed.")
 				warn("Killing any pids still running in the chroot")
 
 				self.kill_chroot_pids()
 
-				retval2=os.system("umount "+mypath+x)
+				retval2 = os.system("umount " + mypath + self.mountmap[x])
 				if retval2!=0:
 					ouch=1
-					warn("Couldn't umount bind mount: "+mypath+x)
+					warn("Couldn't umount bind mount: " + mypath + self.mountmap[x])
 
 			if "SNAPCACHE" in self.settings and x == "/usr/portage":
 				try:
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 11/19] modules/generic_stage_target.py: Use 'proc' instead of '/proc' as the mountmap key
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (9 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 10/19] modules/generic_stage_target.py: Don't use paths as mountmap keys W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 12/19] modules/generic_stage_target.py: Use 'dev' instead of '/dev' " W. Trevor King
                                           ` (7 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index a68b356..490430f 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -179,8 +179,8 @@ class generic_stage_target(generic_target):
 				"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		else:
-			self.mounts=["/proc","/dev","/usr/portage/distfiles","/var/tmp/portage"]
-			self.mountmap={"/proc":"/proc","/dev":"/dev","/dev/pts":"/dev/pts",\
+			self.mounts = ["proc","/dev","/usr/portage/distfiles","/var/tmp/portage"]
+			self.mountmap = {"proc":"/proc", "/dev":"/dev", "/dev/pts":"/dev/pts",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		if os.uname()[0] == "Linux":
 			self.mounts.append("/dev/pts")
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 12/19] modules/generic_stage_target.py: Use 'dev' instead of '/dev' as the mountmap key
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (10 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 11/19] modules/generic_stage_target.py: Use 'proc' instead of '/proc' as the mountmap key W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 13/19] modules/generic_stage_target.py: Use 'distdir' instead of '/usr/portage/distfiles' " W. Trevor King
                                           ` (6 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 490430f..bf43eff 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -179,8 +179,8 @@ class generic_stage_target(generic_target):
 				"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		else:
-			self.mounts = ["proc","/dev","/usr/portage/distfiles","/var/tmp/portage"]
-			self.mountmap = {"proc":"/proc", "/dev":"/dev", "/dev/pts":"/dev/pts",\
+			self.mounts = ["proc", "dev","/usr/portage/distfiles", "/var/tmp/portage"]
+			self.mountmap = {"proc":"/proc", "dev":"/dev", "/dev/pts":"/dev/pts",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		if os.uname()[0] == "Linux":
 			self.mounts.append("/dev/pts")
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 13/19] modules/generic_stage_target.py: Use 'distdir' instead of '/usr/portage/distfiles' as the mountmap key
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (11 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 12/19] modules/generic_stage_target.py: Use 'dev' instead of '/dev' " W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 14/19] modules/generic_stage_target.py: Use 'port_tmpdir' instead of '/var/tmp/portage' " W. Trevor King
                                           ` (5 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index bf43eff..e5bdf91 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -179,9 +179,9 @@ class generic_stage_target(generic_target):
 				"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		else:
-			self.mounts = ["proc", "dev","/usr/portage/distfiles", "/var/tmp/portage"]
+			self.mounts = ["proc", "dev", "distdir", "/var/tmp/portage"]
 			self.mountmap = {"proc":"/proc", "dev":"/dev", "/dev/pts":"/dev/pts",\
-				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
+				"distdir":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		if os.uname()[0] == "Linux":
 			self.mounts.append("/dev/pts")
 
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 14/19] modules/generic_stage_target.py: Use 'port_tmpdir' instead of '/var/tmp/portage' as the mountmap key
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (12 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 13/19] modules/generic_stage_target.py: Use 'distdir' instead of '/usr/portage/distfiles' " W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 15/19] modules/generic_stage_target.py: Use 'devpts' instead of '/dev/pts' " W. Trevor King
                                           ` (4 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index e5bdf91..2426b12 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -179,9 +179,9 @@ class generic_stage_target(generic_target):
 				"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		else:
-			self.mounts = ["proc", "dev", "distdir", "/var/tmp/portage"]
+			self.mounts = ["proc", "dev", "distdir", "port_tmpdir"]
 			self.mountmap = {"proc":"/proc", "dev":"/dev", "/dev/pts":"/dev/pts",\
-				"distdir":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
+				"distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}
 		if os.uname()[0] == "Linux":
 			self.mounts.append("/dev/pts")
 
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 15/19] modules/generic_stage_target.py: Use 'devpts' instead of '/dev/pts' as the mountmap key
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (13 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 14/19] modules/generic_stage_target.py: Use 'port_tmpdir' instead of '/var/tmp/portage' " W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 16/19] modules/generic_stage_target.py: Use 'packagedir' instead of '/usr/portage/packages' " W. Trevor King
                                           ` (3 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 2426b12..f8dd352 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -180,10 +180,10 @@ class generic_stage_target(generic_target):
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
 		else:
 			self.mounts = ["proc", "dev", "distdir", "port_tmpdir"]
-			self.mountmap = {"proc":"/proc", "dev":"/dev", "/dev/pts":"/dev/pts",\
+			self.mountmap = {"proc":"/proc", "dev":"/dev", "devpts":"/dev/pts",
 				"distdir":self.settings["distdir"], "port_tmpdir":"tmpfs"}
 		if os.uname()[0] == "Linux":
-			self.mounts.append("/dev/pts")
+			self.mounts.append("devpts")
 
 		self.set_mounts()
 
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 16/19] modules/generic_stage_target.py: Use 'packagedir' instead of '/usr/portage/packages' as the mountmap key
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (14 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 15/19] modules/generic_stage_target.py: Use 'devpts' instead of '/dev/pts' " W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 17/19] modules/generic_stage_target.py: Use 'kerncache' instead of '/tmp/kerncache' " W. Trevor King
                                           ` (2 subsequent siblings)
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 modules/generic_stage_target.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index f8dd352..dc02ad2 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -195,9 +195,8 @@ class generic_stage_target(generic_target):
 			self.set_pkgcache_path()
 			print "Location of the package cache is "+\
 				self.settings["pkgcache_path"]
-			self.mounts.append("/usr/portage/packages")
-			self.mountmap["/usr/portage/packages"]=\
-				self.settings["pkgcache_path"]
+			self.mounts.append("packagedir")
+			self.mountmap["packagedir"] = self.settings["pkgcache_path"]
 
 		if "KERNCACHE" in self.settings:
 			self.set_kerncache_path()
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 17/19] modules/generic_stage_target.py: Use 'kerncache' instead of '/tmp/kerncache' as the mountmap key
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (15 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 16/19] modules/generic_stage_target.py: Use 'packagedir' instead of '/usr/portage/packages' " W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 18/19] modules/generic_stage_target.py: Use 'ccache' instead of '/var/tmp/ccache' " W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 19/19] catalst: improve usage() output formatting slightly W. Trevor King
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index dc02ad2..6a9b980 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -202,8 +202,8 @@ class generic_stage_target(generic_target):
 			self.set_kerncache_path()
 			print "Location of the kerncache is "+\
 				self.settings["kerncache_path"]
-			self.mounts.append("/tmp/kerncache")
-			self.mountmap["/tmp/kerncache"]=self.settings["kerncache_path"]
+			self.mounts.append("kerncache")
+			self.mountmap["kerncache"] = self.settings["kerncache_path"]
 
 		if "CCACHE" in self.settings:
 			if "CCACHE_DIR" in os.environ:
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 18/19] modules/generic_stage_target.py: Use 'ccache' instead of '/var/tmp/ccache' as the mountmap key
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (16 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 17/19] modules/generic_stage_target.py: Use 'kerncache' instead of '/tmp/kerncache' " W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 19/19] catalst: improve usage() output formatting slightly W. Trevor King
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 modules/generic_stage_target.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 6a9b980..8c983e1 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -215,8 +215,8 @@ class generic_stage_target(generic_target):
 				raise CatalystError,\
 					"Compiler cache support can't be enabled (can't find "+\
 					ccdir+")"
-			self.mounts.append("/var/tmp/ccache")
-			self.mountmap["/var/tmp/ccache"]=ccdir
+			self.mounts.append("ccache")
+			self.mountmap["ccache"] = ccdir
 			""" for the chroot: """
 			self.env["CCACHE_DIR"]="/var/tmp/ccache"
 
-- 
1.8.3.2



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

* [gentoo-catalyst] [PATCH v3 19/19] catalst: improve usage() output formatting slightly
  2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
                                           ` (17 preceding siblings ...)
  2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 18/19] modules/generic_stage_target.py: Use 'ccache' instead of '/var/tmp/ccache' " W. Trevor King
@ 2013-12-15  4:00                         ` W. Trevor King
  18 siblings, 0 replies; 79+ messages in thread
From: W. Trevor King @ 2013-12-15  4:00 UTC (permalink / raw
  To: Catalyst; +Cc: Brian Dolbec, W. Trevor King

From: Brian Dolbec <dolsen@gentoo.org>

W. Trevor King: Refactored Git history for Brian Dolbec's content changes.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
 catalyst | 52 +++++++++++++++++++++++++++-------------------------
 1 file changed, 27 insertions(+), 25 deletions(-)

diff --git a/catalyst b/catalyst
index c62b745..4ea4248 100755
--- a/catalyst
+++ b/catalyst
@@ -24,31 +24,33 @@ __version__="2.0.15"
 conf_values={}
 
 def usage():
-	print "Usage catalyst [options] [-C variable=value...] [ -s identifier]"
-	print " -a --clear-autoresume	clear autoresume flags"
-	print " -c --config     use specified configuration file"
-	print " -C --cli        catalyst commandline (MUST BE LAST OPTION)"
-	print " -d --debug      enable debugging"
-	print " -f --file       read specfile"
-	print " -F --fetchonly  fetch files only"
-	print " -h --help       print this help message"
-	print " -p --purge      clear tmp dirs,package cache and autoresume flags"
-	print " -P --purgeonly  clear tmp dirs,package cache and autoresume flags and exit"
-	print " -T --purgetmponly  clear tmp dirs and autoresume flags and exit"
-	print " -s --snapshot   generate a release snapshot"
-	print " -V --version    display version information"
-	print " -v --verbose    verbose output"
-	print
-	print "Usage examples:"
-	print
-	print "Using the commandline option (-C, --cli) to build a Portage snapshot:"
-	print "catalyst -C target=snapshot version_stamp=my_date"
-	print
-	print "Using the snapshot option (-s, --snapshot) to build a release snapshot:"
-	print "catalyst -s 20071121"
-	print
-	print "Using the specfile option (-f, --file) to build a stage target:"
-	print "catalyst -f stage1-specfile.spec"
+	print """Usage catalyst [options] [-C variable=value...] [ -s identifier]
+ -a --clear-autoresume  clear autoresume flags
+ -c --config            use specified configuration file
+ -C --cli               catalyst commandline (MUST BE LAST OPTION)
+ -d --debug             enable debugging
+ -f --file              read specfile
+ -F --fetchonly         fetch files only
+ -h --help              print this help message
+ -p --purge             clear tmp dirs,package cache, autoresume flags
+ -P --purgeonly         clear tmp dirs,package cache, autoresume flags and exit
+ -T --purgetmponly      clear tmp dirs and autoresume flags and exit
+ -s --snapshot          generate a release snapshot
+ -V --version           display version information
+ -v --verbose           verbose output
+
+Usage examples:
+
+Using the commandline option (-C, --cli) to build a Portage snapshot:
+catalyst -C target=snapshot version_stamp=my_date
+
+Using the snapshot option (-s, --snapshot) to build a release snapshot:
+catalyst -s 20071121"
+
+Using the specfile option (-f, --file) to build a stage target:
+catalyst -f stage1-specfile.spec
+"""
+
 
 def version():
 	print "Catalyst, version "+__version__
-- 
1.8.3.2



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

end of thread, other threads:[~2013-12-15  4:10 UTC | newest]

Thread overview: 79+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-14  3:07 [gentoo-catalyst] rewrite-on-master patches Brian Dolbec
2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 1/4] Add more configured defaults Brian Dolbec
2013-12-14  4:12   ` Rick "Zero_Chaos" Farina
2013-12-14  4:51   ` Matt Turner
2013-12-14 11:54     ` Brian Dolbec
2013-12-14 14:33   ` Dylan Baker
2013-12-14 16:31     ` W. Trevor King
2013-12-15  0:05     ` W. Trevor King
2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths Brian Dolbec
2013-12-14  4:26   ` Rick "Zero_Chaos" Farina
2013-12-14  5:08   ` Matt Turner
2013-12-14 11:15     ` Brian Dolbec
2013-12-14 16:37       ` W. Trevor King
2013-12-14 18:05         ` W. Trevor King
2013-12-14 18:44           ` Matt Turner
2013-12-14 22:24             ` [gentoo-catalyst] [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 01/21] modules/tinderbox_target.py: Use 'portdir' instead of hard-coding '/usr/portage' W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 02/21] modules/generic_stage_target.py: " W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 03/21] " W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 04/21] modules/generic_stage_target.py: Use 'distdir' instead of hard-coding '${PORTAGE}/distfiles' W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 05/21] modules/generic_stage_target.py: Use a 'local_overlay' setting instead of hard-coding '/usr/local/portage' W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 06/21] catalyst: Split confdefaults into line-per-entry W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 07/21] catalyst: Add 'repo_name' default W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 08/21] catalyst: Add 'snapshot_name' default W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 09/21] catalyst: Add 'packagedir' default instead of hard-coding '/usr/portage/packages' W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 10/21] catalyst: Add 'port_tmpdir' default instead of hard-coding '/var/tmp/portage' W. Trevor King
2013-12-15  2:56                 ` Brian Dolbec
2013-12-15  3:07                   ` W. Trevor King
2013-12-15  3:22                     ` W. Trevor King
2013-12-15  4:00                       ` [gentoo-catalyst] [PATCH v3 00/19] rewrite-on-master patches (part 1) W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 01/19] modules/tinderbox_target.py: Use 'portdir' instead of hard-coding '/usr/portage' W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 02/19] modules/generic_stage_target.py: " W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 03/19] " W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 04/19] modules/generic_stage_target.py: Use 'distdir' instead of hard-coding '${PORTAGE}/distfiles' W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 05/19] modules/generic_stage_target.py: Use a 'local_overlay' setting instead of hard-coding '/usr/local/portage' W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 06/19] catalyst: Split confdefaults into line-per-entry W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 07/19] catalyst: Add 'repo_name' default W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 08/19] catalyst: Add 'snapshot_name' default W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 09/19] catalyst: Add 'packagedir' default instead of hard-coding '/usr/portage/packages' W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 10/19] modules/generic_stage_target.py: Don't use paths as mountmap keys W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 11/19] modules/generic_stage_target.py: Use 'proc' instead of '/proc' as the mountmap key W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 12/19] modules/generic_stage_target.py: Use 'dev' instead of '/dev' " W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 13/19] modules/generic_stage_target.py: Use 'distdir' instead of '/usr/portage/distfiles' " W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 14/19] modules/generic_stage_target.py: Use 'port_tmpdir' instead of '/var/tmp/portage' " W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 15/19] modules/generic_stage_target.py: Use 'devpts' instead of '/dev/pts' " W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 16/19] modules/generic_stage_target.py: Use 'packagedir' instead of '/usr/portage/packages' " W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 17/19] modules/generic_stage_target.py: Use 'kerncache' instead of '/tmp/kerncache' " W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 18/19] modules/generic_stage_target.py: Use 'ccache' instead of '/var/tmp/ccache' " W. Trevor King
2013-12-15  4:00                         ` [gentoo-catalyst] [PATCH v3 19/19] catalst: improve usage() output formatting slightly W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 11/21] modules/generic_stage_target.py: Don't use paths as mountmap keys W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 12/21] modules/generic_stage_target.py: Use 'proc' instead of '/proc' as the mountmap key W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 13/21] modules/generic_stage_target.py: Use 'dev' instead of '/dev' " W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 14/21] modules/generic_stage_target.py: Use 'distdir' instead of '/usr/portage/distfiles' " W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 15/21] modules/generic_stage_target.py: Use 'port_tmpdir' instead of '/var/tmp/portage' " W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 16/21] modules/generic_stage_target.py: Use 'devpts' instead of '/dev/pts' " W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 17/21] modules/generic_stage_target.py: Use 'packagedir' instead of '/usr/portage/packages' " W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 18/21] modules/generic_stage_target.py: Use 'kerncache' instead of '/tmp/kerncache' " W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 19/21] modules/generic_stage_target.py: Use 'ccache' instead of '/var/tmp/ccache' " W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 20/21] catalst: improve usage() output formatting slightly W. Trevor King
2013-12-14 22:24               ` [gentoo-catalyst] [PATCH v2 21/21] catalyst: cleanup long lines W. Trevor King
2013-12-14 22:29               ` [gentoo-catalyst] Re: [PATCH v2 00/21] rewrite-on-master patches (part 1) W. Trevor King
2013-12-14 23:10                 ` W. Trevor King
2013-12-15  0:24               ` [gentoo-catalyst] " Matt Turner
2013-12-15  1:40                 ` W. Trevor King
2013-12-14 14:51   ` [gentoo-catalyst] [PATCH 2/4] Remove self.mounts and self.mountmap's use of paths for keys and paths Dylan Baker
2013-12-14 16:42     ` W. Trevor King
2013-12-14 21:31       ` Dustin C. Hatch
2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 3/4] Adapt commit c52962b6bd2 to use the new configured settings values Brian Dolbec
2013-12-14  4:59   ` Dustin C. Hatch
2013-12-14  6:12     ` Brian Dolbec
2013-12-14 14:54   ` Dylan Baker
2013-12-14 16:07     ` Dylan Baker
2013-12-14 16:22     ` Brian Dolbec
2013-12-14  3:07 ` [gentoo-catalyst] [PATCH 4/4] cleanup long lines, improve usage() output formatting slightly Brian Dolbec
2013-12-14  5:14   ` Matt Turner
2013-12-14  5:22     ` W. Trevor King
2013-12-14  6:21     ` Brian Dolbec
2013-12-14 14:56       ` Dylan Baker
2013-12-14 16:02         ` Brian Dolbec

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