summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/toaster/bldcontrol/localhostbecontroller.py14
-rw-r--r--bitbake/lib/toaster/orm/models.py12
2 files changed, 16 insertions, 10 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 374991bfdb..1bd51437a6 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -82,6 +82,8 @@ class LocalhostBEController(BuildEnvironmentController):
82 assert self.pokydirname and os.path.exists(self.pokydirname) 82 assert self.pokydirname and os.path.exists(self.pokydirname)
83 self._createdirpath(self.be.builddir) 83 self._createdirpath(self.be.builddir)
84 self._shellcmd("bash -c \"source %s/oe-init-build-env %s\"" % (self.pokydirname, self.be.builddir)) 84 self._shellcmd("bash -c \"source %s/oe-init-build-env %s\"" % (self.pokydirname, self.be.builddir))
85 # delete the templateconf.cfg; it may come from an unsupported layer configuration
86 os.remove(os.path.join(self.be.builddir, "conf/templateconf.cfg"))
85 87
86 88
87 def writeConfFile(self, file_name, variable_list = None, raw = None): 89 def writeConfFile(self, file_name, variable_list = None, raw = None):
@@ -115,9 +117,10 @@ class LocalhostBEController(BuildEnvironmentController):
115 f.seek(0, 2) # jump to the end 117 f.seek(0, 2) # jump to the end
116 toaster_ui_log_filelength = f.tell() 118 toaster_ui_log_filelength = f.tell()
117 119
118 cmd = "bash -c \"source %s/oe-init-build-env %s && bitbake --read conf/toaster-pre.conf --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0 >toaster_server.log && DATABASE_URL=%s BBSERVER=0.0.0.0:-1 daemon -d -i -D %s -o toaster_ui.log -- %s --observe-only -u toasterui &\"" % (self.pokydirname, self.be.builddir, 120 cmd = "bash -c \"source %s/oe-init-build-env %s 2>&1 >toaster_server.log && bitbake --read conf/toaster-pre.conf --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0 2>&1 >toaster_server.log && DATABASE_URL=%s BBSERVER=0.0.0.0:-1 daemon -d -i -D %s -o toaster_ui.log -- %s --observe-only -u toasterui &\"" % (self.pokydirname, self.be.builddir,
119 self.dburl, self.be.builddir, own_bitbake) 121 self.dburl, self.be.builddir, own_bitbake)
120 port = "-1" 122 port = "-1"
123 logger.debug("localhostbecontroller: starting builder \n%s\n" % cmd)
121 cmdoutput = self._shellcmd(cmd) 124 cmdoutput = self._shellcmd(cmd)
122 for i in cmdoutput.split("\n"): 125 for i in cmdoutput.split("\n"):
123 if i.startswith("Bitbake server address"): 126 if i.startswith("Bitbake server address"):
@@ -136,7 +139,7 @@ class LocalhostBEController(BuildEnvironmentController):
136 139
137 retries = 0 140 retries = 0
138 started = False 141 started = False
139 while not started and retries < 30: 142 while not started and retries < 10:
140 started = _toaster_ui_started(toaster_ui_log_filepath, toaster_ui_log_filelength) 143 started = _toaster_ui_started(toaster_ui_log_filepath, toaster_ui_log_filelength)
141 import time 144 import time
142 logger.debug("localhostbecontroller: Waiting bitbake server to start") 145 logger.debug("localhostbecontroller: Waiting bitbake server to start")
@@ -144,7 +147,8 @@ class LocalhostBEController(BuildEnvironmentController):
144 retries += 1 147 retries += 1
145 148
146 if not started: 149 if not started:
147 raise BuildSetupException("localhostbecontroller: Bitbake server did not start in 15 seconds, aborting (Error: '%s')" % (cmdoutput)) 150 toaster_server_log = open(os.path.join(self.be.builddir, "toaster_server.log"), "r").read()
151 raise BuildSetupException("localhostbecontroller: Bitbake server did not start in 5 seconds, aborting (Error: '%s' '%s')" % (cmdoutput, toaster_server_log))
148 152
149 logger.debug("localhostbecontroller: Started bitbake server") 153 logger.debug("localhostbecontroller: Started bitbake server")
150 154
@@ -180,7 +184,7 @@ class LocalhostBEController(BuildEnvironmentController):
180 base = components[-2] if components[-1] == "git" else components[-1] 184 base = components[-2] if components[-1] == "git" else components[-1]
181 185
182 if branch != "HEAD": 186 if branch != "HEAD":
183 return os.path.join(self.be.sourcedir, "_%s_%s.toaster_cloned" % (base, branch)) 187 return "_%s_%s.toaster_cloned" % (base, branch)
184 188
185 189
186 # word of attention; this is a localhost-specific issue; only on the localhost we expect to have "HEAD" releases 190 # word of attention; this is a localhost-specific issue; only on the localhost we expect to have "HEAD" releases
@@ -239,7 +243,7 @@ class LocalhostBEController(BuildEnvironmentController):
239 243
240 # 3. checkout the repositories 244 # 3. checkout the repositories
241 for giturl, commit in gitrepos.keys(): 245 for giturl, commit in gitrepos.keys():
242 localdirname = self.getGitCloneDirectory(giturl, commit) 246 localdirname = os.path.join(self.be.sourcedir, self.getGitCloneDirectory(giturl, commit))
243 logger.debug("localhostbecontroller: giturl %s:%s checking out in current directory %s" % (giturl, commit, localdirname)) 247 logger.debug("localhostbecontroller: giturl %s:%s checking out in current directory %s" % (giturl, commit, localdirname))
244 248
245 # make sure our directory is a git repository 249 # make sure our directory is a git repository
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 2132f8799c..eea98b5e71 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -52,7 +52,7 @@ class ToasterSetting(models.Model):
52 value = models.CharField(max_length=255) 52 value = models.CharField(max_length=255)
53 53
54 def __unicode__(self): 54 def __unicode__(self):
55 return "Setting %s" % self.name 55 return "Setting %s = " % (self.name, self.value)
56 56
57class ProjectManager(models.Manager): 57class ProjectManager(models.Manager):
58 def create_project(self, name, release): 58 def create_project(self, name, release):
@@ -100,7 +100,7 @@ class Project(models.Model):
100 objects = ProjectManager() 100 objects = ProjectManager()
101 101
102 def __unicode__(self): 102 def __unicode__(self):
103 return "%s (%s, %s)" % (self.name, self.release, self.bitbake_version) 103 return "%s (Release %s, BBV %s)" % (self.name, self.release, self.bitbake_version)
104 104
105 def get_current_machine_name(self): 105 def get_current_machine_name(self):
106 try: 106 try:
@@ -896,7 +896,7 @@ class BitbakeVersion(models.Model):
896 dirpath = models.CharField(max_length=255) 896 dirpath = models.CharField(max_length=255)
897 897
898 def __unicode__(self): 898 def __unicode__(self):
899 return "%s (%s)" % (self.name, self.branch) 899 return "%s (Branch: %s)" % (self.name, self.branch)
900 900
901 901
902class Release(models.Model): 902class Release(models.Model):
@@ -1055,8 +1055,10 @@ class Layer_Version(models.Model):
1055 1055
1056# raise Exception(candidate_layer_versions) 1056# raise Exception(candidate_layer_versions)
1057 1057
1058 release_priorities = map(lambda x: (x.layer_source_id, x.priority), project.release.releaselayersourcepriority_set.all().order_by("-priority")) 1058 release_priorities = {}
1059 1059
1060 for ls_id, prio in map(lambda x: (x.layer_source_id, x.priority), project.release.releaselayersourcepriority_set.all().order_by("-priority")):
1061 release_priorities[ls_id] = prio
1060 1062
1061 def _get_ls_priority(ls): 1063 def _get_ls_priority(ls):
1062 # if there is no layer source, we have minus infinite priority, as we don't want this layer selected 1064 # if there is no layer source, we have minus infinite priority, as we don't want this layer selected
@@ -1081,7 +1083,7 @@ class Layer_Version(models.Model):
1081 raise Exception("Cannot determine the vcs_reference for layer version %s" % vars(self)) 1083 raise Exception("Cannot determine the vcs_reference for layer version %s" % vars(self))
1082 1084
1083 def __unicode__(self): 1085 def __unicode__(self):
1084 return str(self.layer) + "(%s,%s)" % (self.get_vcs_reference(), self.build.project if self.build is not None else "None") 1086 return "%d %s (VCS %s, Project %s)" % (self.pk, str(self.layer), self.get_vcs_reference(), self.build.project if self.build is not None else "No project")
1085 1087
1086 class Meta: 1088 class Meta:
1087 unique_together = ("layer_source", "up_id") 1089 unique_together = ("layer_source", "up_id")