<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>etc/global.spec</filename>
    </added>
    <added>
      <filename>etc/stage.spec</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -55,7 +55,7 @@ if __name__ == &quot;__main__&quot;:
 
 	# parse out the command line arguments
 	try:
-		opts,args = getopt.getopt(sys.argv[1:], &quot;ldhvV&quot;, [&quot;lax&quot;,&quot;debug&quot;,&quot;help&quot;, &quot;verbose&quot;, &quot;version&quot; ])
+		opts,args = getopt.getopt(sys.argv[1:], &quot;ldhvV&quot;, [&quot;lax&quot;,&quot;debug&quot;,&quot;help&quot;, &quot;verbose&quot;, &quot;version&quot;,&quot;replace&quot;])
 	except getopt.GetoptError:
 		usage()
 		sys.exit(2)
@@ -65,7 +65,7 @@ if __name__ == &quot;__main__&quot;:
 	verbose=False
 	myopts=[]
 	strict=True
-	readconfig=True
+	replace=False
 
 	# check preconditions
 	if len(args) == 0:
@@ -82,9 +82,9 @@ if __name__ == &quot;__main__&quot;:
 		if o in (&quot;-V&quot;, &quot;--version&quot;):
 			print &quot;Catalyst version &quot;+__version__
 			sys.exit(1)
-		if o == &quot;--noconfig&quot;:
-			print &quot;Warning: --noconfig option specified - skipping /etc/catalyst.conf...&quot;
-			readconfig=False
+		if o == &quot;--replace&quot;:
+			print &quot;Warning: --replace option specified - any existing output stage will be replaced...&quot;
+			replace=True
 		if o in (&quot;-d&quot;, &quot;--debug&quot;):
 			debug=True
 			print &quot;DEBUG: opts&quot;,opts
@@ -108,15 +108,21 @@ if __name__ == &quot;__main__&quot;:
 	elif host in [ &quot;i386&quot;, &quot;i486&quot;, &quot;i586&quot;, &quot;i686&quot; ]:
 		settings[&quot;hostarch&quot;] = &quot;x86&quot;
 
-	if readconfig:
-		if os.path.exists(&quot;/etc/catalyst.conf&quot;):
-			print &quot;Reading in configuration from /etc/catalyst.conf...&quot;
-			settings.collect(&quot;/etc/catalyst.conf&quot;)
+	if os.path.exists(&quot;/etc/catalyst/global.spec&quot;):
+		print &quot;Reading in configuration from /etc/catalyst/global.spec...&quot;
+		settings.collect(&quot;/etc/catalyst/global.spec&quot;)
+	else:
+		print &quot;Warning: /etc/catalyst/global.spec not found.&quot;
+	
+	if replace:	
+		if settings.has_key(&quot;options&quot;):
+			settings[&quot;options&quot;] = settings[&quot;options&quot;] + &quot; replace&quot;
 		else:
-			print &quot;Warning: /etc/catalyst.conf not found.&quot;
+			settings[&quot;options&quot;] = &quot;replace&quot;
 
 	# the new version of catalyst does not have any configuration file
 	# parse command-line supplied configuration files and spec files in the order they were specified
+
 	for arg in args:
 		settings.collect(arg)
 </diff>
      <filename>catalyst</filename>
    </modified>
    <modified>
      <diff>@@ -354,7 +354,7 @@ def ismount(path):
 	a.close()
 	for line in mylines:
 		mysplit=line.split()
-		if os.path.normpath(path) == os.path.normpath(mysplit2):
+		if os.path.normpath(path) == os.path.normpath(mysplit[2]):
 			print &quot;popen shows&quot;,path,&quot;still mounted. Line: &quot;,line
 			return 1
 	return 0</diff>
      <filename>modules/catalyst_support.py</filename>
    </modified>
    <modified>
      <diff>@@ -20,10 +20,6 @@ mv $[foo] $[oni]
 class FlexDataError(Exception):
 	def __init__(self, message):
 		if message:
-			(type,value)=sys.exc_info()[:2]
-			if value!=None:
-				print 
-				print traceback.print_exc(file=sys.stdout)
 			print
 			print &quot;!!! catalyst: &quot;+message
 			print
@@ -46,7 +42,7 @@ class collection:
 
 		self.evaluated={}
 
-	def expandAll(self):
+	def expand_all(self):
 		# try to expand all variables to find any undefined elements, to record all blanks or throw an exception
 		for key in self.keys():
 			myvar = self[key]
@@ -78,11 +74,7 @@ class collection:
 				string = self.raw[myvar]
 
 		if type(string) != types.StringType:
-			raise FlexDataError(&quot;expandString received non-string: &quot;+repr(string)+&quot;, myvar = &quot;+repr(myvar))
-
-		if myvar == None:
-			# this is to make our exception error messages happy if they trigger
-			myvar = &quot;(None)&quot;
+			raise FlexDataError(&quot;expandString received non-string: &quot;+repr(string)+&quot;, myvar = &quot;+repr(myvar)+&quot; (did you forget '&gt;&gt;' in front of multi-line reference?)&quot;)
 
 		mysplit = string.strip().split(&quot; &quot;)
 		if len(mysplit) == 2 and mysplit[0] == &quot;&lt;&lt;&quot;:
@@ -109,12 +101,15 @@ class collection:
 			if varname in stack:
 				raise KeyError, &quot;Circular reference of '&quot;+varname+&quot;' by '&quot;+stack[-1]+&quot;' ( Call stack: &quot;+repr(stack)+' )'
 			if self.evaluated.has_key(varname):
-				if type(self.evaluated[varname]) == types.ListType:
-					raise FlexDataError,&quot;Trying to expand multi-line value \&quot;&quot;+varname+&quot;\&quot; in single-line value \&quot;&quot;+myvar+&quot;\&quot;&quot;
+				# if myvar == None, we are being called from self.expand_all() and we don't care where we are being expanded from
+				if myvar != None and type(self.evaluated[varname]) == types.ListType:
+					raise FlexDataError,&quot;Trying to expand multi-line value &quot;+repr(varname)+&quot; in single-line value &quot;+repr(myvar)
+				print &quot;DEBUG: looking at self.evaluated[&quot;+varname+&quot;]&quot;
 				ex += self.evaluated[varname]
 			elif self.raw.has_key(varname):
-				if type(self.raw[varname]) == types.ListType:
-					raise FlexDataError,&quot;Trying to expand multi-line value \&quot;&quot;+varname+&quot;\&quot; in single-line value \&quot;&quot;+myvar+&quot;\&quot;&quot;
+				# if myvar == None, we are being called from self.expand_all() and we don't care where we are being expanded from
+				if myvar != None and type(self.raw[varname]) == types.ListType:
+					raise FlexDataError,&quot;Trying to expand multi-line value &quot;+repr(varname)+&quot; in single-line value &quot;+repr(myvar)
 				newstack = stack[:]
 				newstack.append(varname)
 				ex += self.expandString(self.raw[varname],varname,newstack)
@@ -167,7 +162,7 @@ class collection:
 					raise FlexDataError,&quot;Circular reference of '&quot;+mysplit[1]+&quot;' by '&quot;+stack[-1]+&quot;' ( Call stack: &quot;+repr(stack)+' )'
 				newstack = stack[:]
 				newstack.append(mysplit[1])
-				newlines += self.expandMulti(mysplit[1],newstack)
+				newlines += self.expandMulti(self.expandString(string=mysplit[1]),newstack)
 			else:	
 				newlines.append(self.expandString(string=line))
 		self.evaluated[myvar] = newlines
@@ -221,7 +216,7 @@ class collection:
 			else:
 				continue
 
-	def parseline(self,openfile=None):
+	def parseline(self,openfile=None,dups=False):
 		
 		# parseline() will parse a line and return None on EOF, return [] on a blank line with no data, or will
 		# return a list of string elements if there is data on the line, split along whitespace: [ &quot;foo:&quot;, &quot;bar&quot;, &quot;oni&quot; ]
@@ -260,7 +255,8 @@ class collection:
 		if len(mysplit) == 2 and mysplit[0][-1] == &quot;:&quot; and mysplit[1] == &quot;[&quot;:
 			if self.debug:
 				print &quot;DEBUG: MULTI-LINE BLOCK&quot;
-			myvar = mysplit[0]
+			# for myvar, remove trailing colon:
+			myvar = mysplit[0][:-1]
 			mylines = []
 			while 1:
 				curline = openfile.readline()
@@ -271,6 +267,8 @@ class collection:
 					if self.debug:
 						print &quot;DEBUG: end multi-line block&quot;
 					# record value and quit
+					if not dups and self.raw.has_key(myvar):
+						raise FlexDataError,&quot;Error - \&quot;&quot;+myvar+&quot;\&quot; already defined.&quot;
 					self.raw[myvar] = mylines
 					break
 				else:
@@ -278,7 +276,10 @@ class collection:
 					mylines.append(curline[:-1])
 		elif mysplit[0][-1] == &quot;:&quot;:
 			#basic element - rejoin all data elements with spaces and add to self.raw
-			self.raw[mysplit[0][:-1]] = &quot; &quot;.join(mysplit[1:])
+			mykey = mysplit[0][:-1]
+			if not dups and self.raw.has_key(mykey):
+				raise FlexDataError,&quot;Error - \&quot;&quot;+mykey+&quot;\&quot; already defined.&quot;
+			self.raw[mykey] = &quot; &quot;.join(mysplit[1:])
 		return mysplit	
 	
 	def collect(self,filename):</diff>
      <filename>modules/flexdata.py</filename>
    </modified>
    <modified>
      <diff>@@ -64,8 +64,6 @@ class target:
 
 		self.require([&quot;target&quot;,&quot;version&quot;])
 
-		self.settings[&quot;workdir&quot;]=&quot;/var/tmp/catalyst/$[target]-$[version]&quot;
-
 		if not os.path.exists(self.settings[&quot;workdir&quot;]):
 			os.makedirs(self.settings[&quot;workdir&quot;])
 
@@ -75,7 +73,8 @@ class target:
 		self.cmd(self.bin(&quot;rm&quot;) + &quot; -rf &quot;+self.settings[&quot;workdir&quot;])
 
 	def cmd(self,mycmd,myexc=&quot;&quot;,badval=None):
-		print &quot;Executing \&quot;&quot;+mycmd.split(&quot; &quot;)[0]+&quot;\&quot;...&quot;
+		print &quot;Executing \&quot;&quot;+mycmd+&quot;\&quot;...&quot;
+		#print &quot;Executing \&quot;&quot;+mycmd.split(&quot; &quot;)[0]+&quot;\&quot;...&quot;
 		try:
 			sys.stdout.flush()
 			retval=spawn_bash(mycmd,self.env)
@@ -91,6 +90,21 @@ class target:
 
 class chroot(target):
 
+	def kill_chroot_pids(self):
+		cdir=self.settings[&quot;chrootdir&quot;]
+		for pid in os.listdir(&quot;/proc&quot;):
+			if not os.path.isdir(&quot;/proc/&quot;+pid):
+				continue
+			try:
+				mylink = os.readlink(&quot;/proc/&quot;+pid+&quot;/exe&quot;)
+			except OSError:
+				# not a pid directory
+				continue
+			if mylink[0:len(cdir)] == cdir:
+				#we got something in our chroot
+				print &quot;Killing process &quot;+pid+&quot; (&quot;+mylink+&quot;)&quot;
+				self.cmd(&quot;/bin/kill -9 &quot;+pid)
+
 	def exec_in_chroot(self,key):
 
 		if not self.settings.has_key(key):
@@ -111,10 +125,17 @@ class chroot(target):
 
 		outfd.close()
 
-		retval = spawn([&quot;/bin/bash&quot;, outfile ], env=self.env )
+		if self.settings[&quot;arch&quot;] == &quot;x86&quot; and os.uname[4] == &quot;x86_64&quot;:
+			cmds = [self.bin(&quot;linux32&quot;),self.bin(&quot;chroot&quot;),self.settings[&quot;chrootdir&quot;],self.bin(&quot;bash&quot;)]
+		else:
+			cmds = [self.bin(&quot;chroot&quot;),self.settings[&quot;chrootdir&quot;],self.bin(&quot;bash&quot;)]
+
+		cmds.append(&quot;/tmp/&quot;+key+&quot;.sh&quot;)
 
-		return retval
+		retval = spawn(cmds, env=self.env )
 
+		if retval != 0:
+			raise CatalystError, &quot;Command failure: &quot;+&quot; &quot;.join(cmds)
 
 	def __init__(self,settings):
 		target.__init__(self,settings)
@@ -219,6 +240,11 @@ class chroot(target):
 class snapshot(target):
 	def __init__(self,settings):
 		target.__init__(self,settings)
+
+		if os.path.exists(&quot;/etc/catalyst/snapshot.spec&quot;):
+			print &quot;Reading in configuration from /etc/catalyst/snapshot.spec...&quot;
+			self.settings.collect(&quot;/etc/catalyst/snapshot.spec&quot;)
+
 		self.require([&quot;portname&quot;,&quot;portdir&quot;,&quot;version&quot;,&quot;target&quot;])
 		self.require([&quot;storedir/snapshot&quot;])
 
@@ -228,9 +254,16 @@ class snapshot(target):
 			print &quot;Removing existing temporary work directory...&quot;
 			self.cmd( self.bin(&quot;rm&quot;) + &quot; -rf &quot; + self.settings[&quot;workdir&quot;] )
 
-		# do not overwrite snapshot if it already exists
-		if os.path.exists(self.settings[&quot;storedir/snapshot&quot;]):
-			raise CatalystError,&quot;Snapshot &quot;+self.settings[&quot;storedir/snapshot&quot;]+&quot; already exists. Aborting.&quot;
+		if &quot;replace&quot; in self.settings[&quot;options&quot;].split():
+			if os.path.exists(self.settings[&quot;storedir/snapshot&quot;]):
+				print &quot;Removing existing snapshot...&quot;
+				self.cmd( self.bin(&quot;rm&quot;) + &quot; -f &quot; + self.settings[&quot;storedir/snapshot&quot;])
+
+		elif os.path.exists(self.settings[&quot;storedir/snapshot&quot;]):
+			print &quot;Snapshot already exists at &quot;+self.settings[&quot;storedir/snapshot&quot;]+&quot;. Skipping...&quot;
+			return
+		else:
+			print self.settings[&quot;storedir/snapshot&quot;],&quot;does not exist - creating it...&quot;
 				
 		# create required directories
 		for dir in [ os.path.dirname(self.settings[&quot;storedir/snapshot&quot;]), self.settings[&quot;workdir&quot;]+&quot;/portage&quot; ]:
@@ -241,8 +274,10 @@ class snapshot(target):
 		rsync_opts = &quot;-a --delete --exclude /packages/ --exclude /distfiles/ --exclude /local/ --exclude CVS/ --exclude /.git/&quot;
 		rsync_cmd = self.bin(&quot;rsync&quot;) + &quot; &quot; + rsync_opts + &quot; &quot; + os.path.normpath(self.settings[&quot;portdir&quot;])+&quot;/ &quot; + os.path.normpath(self.settings[&quot;workdir&quot;]+&quot;/portage&quot;)+&quot;/&quot;
 		self.cmd(rsync_cmd,&quot;Snapshot failure&quot;)
+		tmpfile=os.path.dirname(self.settings[&quot;storedir/snapshot&quot;])+&quot;/.&quot;+os.path.basename(self.settings[&quot;storedir/snapshot&quot;])
 		
-		self.cmd( self.bin(&quot;tar&quot;) + &quot; -cjf &quot; + self.settings[&quot;storedir/snapshot&quot;]+&quot; -C &quot;+self.settings[&quot;workdir&quot;]+&quot; portage&quot;,&quot;Snapshot creation failure&quot;)
+		self.cmd( self.bin(&quot;tar&quot;) + &quot; -cjf &quot; + tmpfile +&quot; -C &quot;+self.settings[&quot;workdir&quot;]+&quot; portage&quot;,&quot;Snapshot creation failure&quot;)
+		self.cmd( self.bin(&quot;mv&quot;) + &quot; &quot; + tmpfile + &quot; &quot; + self.settings[&quot;storedir/snapshot&quot;], &quot;Couldn't move snapshot to final position&quot; )
 
 		# workdir cleanup is handled by catalyst calling our cleanup() method
 
@@ -250,19 +285,23 @@ class stage(chroot):
 
 	def __init__(self,settings):
 		chroot.__init__(self,settings)
-	
+
+		if os.path.exists(&quot;/etc/catalyst/stage.spec&quot;):
+			print &quot;Reading in configuration from /etc/catalyst/stage.spec...&quot;
+			self.settings.collect(&quot;/etc/catalyst/stage.spec&quot;)
+
 		# In the constructor, we want to define settings but not reference them if we can help it, certain things
 		# like paths may not be able to be fully expanded yet until we define our goodies like &quot;source&quot;, etc.
 
-		self.require([&quot;arch&quot;,&quot;subarch&quot;,&quot;profile&quot;,&quot;storedir/srcstage&quot;,&quot;storedir/deststage&quot;,&quot;storedir/snapshot&quot;])
+		self.require([&quot;arch&quot;,&quot;subarch&quot;,&quot;profile&quot;,&quot;storedir/srcstage&quot;,&quot;storedir/deststage&quot;,&quot;storedir/snapshot&quot;,&quot;CHOST&quot;])
 		
 		# look for user-specified USE, if none specified then fallback to HOSTUSE if specified
 		if not self.settings.has_key(&quot;USE&quot;):
 			if self.settings.has_key(&quot;HOSTUSE&quot;):
 				self.settings[&quot;USE&quot;]=&quot;$[HOSTUSE]&quot;
 
-		# If DISTDIR, USE or CFLAGS not specified, alert the user that they might be missing them
-		self.recommend([&quot;DISTDIR&quot;,&quot;USE&quot;,&quot;CFLAGS&quot;,&quot;MAKEOPTS&quot;])
+		# If distdir, USE or CFLAGS not specified, alert the user that they might be missing them
+		self.recommend([&quot;distdir&quot;,&quot;USE&quot;,&quot;CFLAGS&quot;,&quot;MAKEOPTS&quot;])
 
 		# We also use an initial &quot;~&quot; as a trigger to build an unstable version of the portage tree. This
 		# means we need to use ~arch rather than arch in ACCEPT_KEYWORDS. So if someone specified &quot;~pentium4&quot;
@@ -288,9 +327,19 @@ class stage(chroot):
 			self.mountmap[&quot;/usr/portage/distfiles&quot;]=self.settings[&quot;distdir&quot;]
 
 		self.settings[&quot;chrootdir&quot;]=&quot;$[workdir]/chroot&quot;
-		self.settings[&quot;controller_file&quot;]=&quot;$[sharedir]/targets/$[target]/$[target]-controller.sh&quot;
 
 	def run(self):
+
+		if &quot;replace&quot; in self.settings[&quot;options&quot;].split():
+			if os.path.exists(settings[&quot;storedir/deststage&quot;]):
+				print &quot;Removing existing stage...&quot;
+				self.cmd( self.bin(&quot;rm&quot;) + &quot; -f &quot; + self.settings[&quot;storedir/deststage&quot;])
+		# do not overwrite snapshot if it already exists
+		elif os.path.exists(self.settings[&quot;storedir/deststage&quot;]):
+			print &quot;Stage &quot;+repr(self.settings[&quot;storedir/deststage&quot;])+&quot; already exists - skipping...&quot;
+			return
+			#raise CatalystError,&quot;Snapshot &quot;+self.settings[&quot;storedir/snapshot&quot;]+&quot; already exists. Aborting.&quot;
+
 		# look for required files
 		for loc in [ &quot;storedir/srcstage&quot;, &quot;storedir/snapshot&quot; ]:
 			if not os.path.exists(self.settings[loc]):
@@ -314,16 +363,20 @@ class stage(chroot):
 
 			self.bind()
 
+			self.exec_in_chroot(&quot;chroot/prerun&quot;)
 			self.exec_in_chroot(&quot;chroot/run&quot;)
 			self.exec_in_chroot(&quot;chroot/postrun&quot;)
 			
 			self.unbind()
 			
+			# remove our tweaks...
+
+			self.chroot_cleanup()
+
+			# now let the spec-defined clean script do all the heavy lifting...
+
 			self.exec_in_chroot(&quot;chroot/clean&quot;)
 			
-			# remove our tweaks ...
-			self.chroot_cleanup()
-		
 		except:
 		
 			self.kill_chroot_pids()
@@ -348,7 +401,7 @@ class stage(chroot):
 		self.cmd(unpack_cmd,&quot;Error unpacking source stage.&quot;)
 
 	def unpack_snapshot(self):
-		destdir=normpath(self.settings[&quot;chrootdir&quot;]+&quot;/usr/portage&quot;)
+		destdir=os.path.normpath(self.settings[&quot;chrootdir&quot;]+&quot;/usr/portage&quot;)
 		cleanup_errmsg=&quot;Error removing existing snapshot directory.&quot;
 		cleanup_msg=&quot;Cleaning up existing portage tree (This can take a long time) ...&quot;
 		unpack_cmd=&quot;tar xjpf &quot;+self.settings[&quot;storedir/snapshot&quot;]+&quot; -C &quot;+self.settings[&quot;chrootdir&quot;]+&quot;/usr&quot;
@@ -360,9 +413,6 @@ class stage(chroot):
 		print &quot;Unpacking \&quot;&quot;+self.settings[&quot;storedir/snapshot&quot;]+&quot; ...&quot;
 		self.cmd(unpack_cmd,unpack_errmsg)
 
-	def config_profile_link(self):
-		self.controller(&quot;profile&quot;)
-	
 	def proxy_config(self):
 		# SETUP PROXY SETTINGS - ENVSCRIPT DOESN'T ALWAYS WORK. THIS DOES.
 		print &quot;Writing out proxy settings...&quot;
@@ -401,9 +451,10 @@ class stage(chroot):
 		# Back up original files.
 		for file in [ &quot;/etc/resolv.conf&quot;, &quot;/etc/hosts&quot; ]:
 			respath=self.settings[&quot;chrootdir&quot;]+file
-			if os.path.exists(respath):
-				self.cmd(&quot;/bin/cp &quot;+respath+&quot; &quot;+respath+&quot;.bck&quot;,&quot;Couldn't back up &quot;+file)
-			self.cmd(&quot;/bin/cp &quot;+file+&quot; &quot;+respath,&quot;Couldn't copy &quot;+file+&quot; into place.&quot;)
+			if os.path.exists(file):
+				if os.path.exists(respath):
+					self.cmd(&quot;/bin/cp &quot;+respath+&quot; &quot;+respath+&quot;.bck&quot;,&quot;Couldn't back up &quot;+file)
+				self.cmd(&quot;/bin/cp &quot;+file+&quot; &quot;+respath,&quot;Couldn't copy &quot;+file+&quot; into place.&quot;)
 
 	def portage_config(self):
 		self.cmd(&quot;/bin/rm -f &quot;+self.settings[&quot;chrootdir&quot;]+&quot;/etc/make.conf&quot;,&quot;Could not remove &quot;+self.settings[&quot;chrootdir&quot;]+&quot;/etc/make.conf&quot;)
@@ -421,8 +472,7 @@ class stage(chroot):
 		self.locale_config()
 		self.network_config()
 		self.portage_config()
-		self.config_profile_link()
-
+	
 	def chroot_cleanup(self):
 
 		# Philosophy: Catalyst should only do the bare minimum cleanup in Python. The bulk of the cleanup work should be defined in
@@ -443,25 +493,6 @@ class stage(chroot):
 
 		# Run our &quot;clean&quot; bash script, which should do all of the heavy lifting...
 
-		self.controller(&quot;clean&quot;)
-
-	def controller(self,stage):
-		if not os.path.exists(self.settings[&quot;controller_file&quot;]):
-			raise CatalystError,&quot;Controller file &quot;+self.settings[&quot;controller_file&quot;]+&quot; not found. Aborting.&quot;
-		try:
-			cmd(&quot;/bin/bash &quot;+self.settings[&quot;controller_file&quot;]+&quot; &quot;+stage,stage+&quot; script failed.&quot;,env=self.env)
-		except:
-			self.unbind()
-			raise CatalystError, &quot;Build failed, could not execute &quot;+stage
-	
-	def kill_chroot_pids(self):
-		print &quot;Checking for processes running in chroot and killing them.&quot;
-		cmdpath=self.settings[&quot;sharedir&quot;]+&quot;/misc/kill-chroot-pids.sh&quot;)
-		if not os.path.exists(cmdpath):
-			raise CatalystError,&quot;Couldn't find &quot;+cmdpath+&quot; - Exiting.&quot;
-		self.cmd(&quot;/bin/bash &quot;+cmdpath, &quot;kill-chroot-pids script failed.&quot;)
-	
-
 	def capture(self):
 		&quot;&quot;&quot;capture target in a tarball&quot;&quot;&quot;
 		# IF TARGET EXISTS, REMOVE IT - WE WILL CREATE A NEW ONE</diff>
      <filename>modules/targets.py</filename>
    </modified>
    <modified>
      <diff>@@ -2,4 +2,3 @@ arch: amd64
 CFLAGS: -O2 -pipe
 CHOST: x86_64-pc-linux-gnu
 HOSTUSE: mmx sse sse2
-profile: default/linux/$[arch]/2008.0</diff>
      <filename>specs/arch/amd64.spec</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,4 @@
 arch: x86
 CFLAGS: -O2 -march=athlon-xp -pipe
 CHOST: i686-pc-linux-gnu
-profile: default/linux/$[arch]/2008.0
 HOSTUSE: mmx sse 3dnow</diff>
      <filename>specs/arch/athlon-xp.spec</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,4 @@
 arch: x86
 CFLAGS: -O2 -march=prescott -pipe
 CHOST: i686-pc-linux-gnu
-profile: default/linux/$[arch]/2008.0
 HOSTUSE: mmx sse sse2</diff>
      <filename>specs/arch/core32.spec</filename>
    </modified>
    <modified>
      <diff>@@ -2,4 +2,3 @@ arch: amd64
 CFLAGS: -march=nocona -O2 -pipe
 CHOST: x86_64-pc-linux-gnu
 HOSTUSE: mmx sse sse2
-profile: default/linux/$[arch]/2008.0</diff>
      <filename>specs/arch/core64.spec</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,3 @@
 arch: x86
 CFLAGS: -O2 -march=i686 -pipe
 CHOST: i686-pc-linux-gnu
-profile: default/linux/$[arch]/2008.0</diff>
      <filename>specs/arch/i686.spec</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,4 @@
 arch: x86
 CFLAGS: -O2 -march=pentium4 -pipe
 CHOST: i686-pc-linux-gnu
-profile: default/linux/$[arch]/2008.0
 HOSTUSE: mmx sse sse2</diff>
      <filename>specs/arch/pentium4.spec</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,3 @@
 arch: x86
 CFLAGS: -O2 -mtune=i686 -pipe
 CHOST: i386-pc-linux-gnu
-profile: default/linux/$[arch]/2008.0</diff>
      <filename>specs/arch/x86.spec</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,2 @@
 # what I want
-portname: funtoo
-portdir: /root/git/funtoo-portage
-version: 2008.08.29
 target: snapshot
-
-# config
-storedir: /home/mirror/linux
-storedir/snapshot: $[storedir]/snapshots/$[portname]-$[version].tar.bz2</diff>
      <filename>specs/targets/snapshot.spec</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,5 @@
 target: stage1
 
-subarch: ~amd64
-# stuff we specify - our info:
-version: 2008.08.29 
-
 # REQUIRED:
 # RECOMMENDED, otherwise use HOSTUSE.
 USE: $[HOSTUSE]
@@ -43,9 +39,9 @@ en_US.UTF-8 UTF-8
 # do any cleanup that you need with things bind mounted here:
 
 chroot/postrun: [
-	$[chroot/setup]
+	&gt;&gt; chroot/setup
 	[ -e /var/tmp/ccache ] &amp;&amp; emerge -C dev-util/ccache
-[
+]
 
 # do the stuff here that you need to do, with bind mounts unmounted (for safety:)
 
@@ -91,7 +87,7 @@ print
 ]
 
 chroot/run: [
-$[chroot/setup]
+&gt;&gt; chroot/setup
 if [ -d /var/tmp/ccache ] 
 then
 	export CCACHE_DIR=/var/tmp/ccache
@@ -99,24 +95,28 @@ then
 fi
 
 cat &gt; /tmp/build.py &lt;&lt; EOF
-$[chroot/pythonjunk]
+&gt;&gt; chroot/pythonjunk
 EOF
 
 export buildpkgs=&quot;$(python /tmp/build.py)&quot;
 export STAGE1_USE=&quot;$(portageq envvar STAGE1_USE)&quot;
 export USE=&quot;-* bindist build ${STAGE1_USE}&quot;
 export FEATURES=&quot;nodoc noman noinfo&quot;
-
+[ -e /usr/bin/ccache ] &amp;&amp; export FEATURES=&quot;ccache $FEATURES&quot;
 ## Sanity check profile
-if [ -z &quot;${clst_buildpkgs}&quot; ]
+if [ -z &quot;${buildpkgs}&quot; ]
 then
 	echo &quot;Your profile seems to be broken.&quot;
 	echo &quot;Could not build a list of build packages.&quot;
 	echo &quot;Double check your /etc/make.profile link and the 'packages' files.&quot;
 	exit 1
+else
+	echo &quot;WE ARE BUILDING: ${buildpkgs}&quot;
 fi
 
+export ROOT=&quot;$[ROOT]&quot;
+install -d $[ROOT]
 emerge baselayout
-emerge --noreplace --oneshot ${clst_buildpkgs}
+emerge --noreplace --oneshot ${buildpkgs}
 
 ]</diff>
      <filename>specs/targets/stage1.spec</filename>
    </modified>
    <modified>
      <diff>@@ -1,18 +1,6 @@
 target: stage2
-subarch: ~amd64
 
-# stuff we specify - our info:
-version: 2008.08.29 
-
-# REQUIRED:
-# RECOMMENDED, otherwise use HOSTUSE.
 USE: $[HOSTUSE]
-# arch stuff
-arch: amd64
-CFLAGS: -O2 -pipe
-CHOST: x86_64-pc-linux-gnu
-HOSTUSE: mmx sse sse2
-profile: default/linux/$[arch]/2008.0
 
 chroot/setup: [
 	/usr/sbin/env-update</diff>
      <filename>specs/targets/stage2.spec</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,4 @@
 target: stage3
-subarch: ~amd64
-
-# stuff we specify - our info:
-version: 2008.08.29 
 
 # RECOMMENDED, otherwise use HOSTUSE.
 USE: $[HOSTUSE]
@@ -43,7 +39,7 @@ en_US.UTF-8 UTF-8
 # do any cleanup that you need with things bind mounted here:
 
 chroot/postrun: [
-	$[chroot/setup]
+&lt;&lt; chroot/setup
 	[ -e /var/tmp/ccache ] &amp;&amp; emerge -C dev-util/ccache
 [
 </diff>
      <filename>specs/targets/stage3.spec</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>etc/catalyst.conf</filename>
    </removed>
    <removed>
      <filename>misc/kill-chroot-pids.sh</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>0cc3c221ae363e4f137f7065abe08d180aba8ce0</id>
    </parent>
  </parents>
  <author>
    <name>Daniel Robbins</name>
    <email>drobbins@funtoo.org</email>
  </author>
  <url>http://github.com/funtoo/metro/commit/6a1e20aea2f8168b2cd3d0fd961f3e7836899502</url>
  <id>6a1e20aea2f8168b2cd3d0fd961f3e7836899502</id>
  <committed-date>2008-09-02T18:39:49-07:00</committed-date>
  <authored-date>2008-09-02T18:39:49-07:00</authored-date>
  <message>it's somewhat working!</message>
  <tree>6f8a20e37c800628db38746db66cd33c9d6c7ee0</tree>
  <committer>
    <name>Daniel Robbins</name>
    <email>drobbins@funtoo.org</email>
  </committer>
</commit>
