aboutsummaryrefslogtreecommitdiff
blob: 9cc1acc916e0fb8b14cf9fc611c664f1e32e0c2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
Tinderbox target
"""
# NOTE: That^^ docstring has influence catalyst-spec(5) man page generation.

from catalyst_support import *
from generic_stage_target import *

class tinderbox_target(generic_stage_target):
	"""
	Builder class for the tinderbox target
	"""
	def __init__(self,spec,addlargs):
		self.required_values=["tinderbox/packages"]
		self.valid_values=self.required_values[:]
		self.valid_values.extend(["tinderbox/use"])
		generic_stage_target.__init__(self,spec,addlargs)

	def run_local(self):
		# tinderbox
		# example call: "grp.sh run xmms vim sys-apps/gleep"
		try:
			if os.path.exists(self.settings["controller_file"]):
			    cmd("/bin/bash "+self.settings["controller_file"]+" run "+\
				list_bashify(self.settings["tinderbox/packages"]),"run script failed.",env=self.env)
		
		except CatalystError:
			self.unbind()
			raise CatalystError,"Tinderbox aborting due to error."

	def set_cleanables(self):
	    self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",\
					"/usr/portage"]
	def set_action_sequence(self):
		#Default action sequence for run method
		self.settings["action_sequence"]=["unpack","unpack_snapshot",\
		              "config_profile_link","setup_confdir","bind","chroot_setup",\
		              "setup_environment","run_local","preclean","unbind","clean",\
		              "clear_autoresume"]
	
def register(foo):
	foo.update({"tinderbox":tinderbox_target})
	return foo