build_depends is a list of previous build dependencies (not runtime)
If build_depends is empty, we're dealing with a runtime depends
"""
-
the_data = self.bb_cache.loadDataFull(fn, self.configuration.data)
item = self.status.pkg_fn[fn]
self.cb = None
self.bb_cache = bb.cache.init(self)
fn = self.matchFile(buildfile)
+ if not fn:
+ sys.exit(1)
elif len(pkgs_to_build) == 1:
self.updateCache()
except Exception, e:
bb.msg.fatal(bb.msg.domain.Parsing, "%s" % e)
# emit the metadata which isnt valid shell
- data.expandKeys( envdata )
+ data.expandKeys( envdata )
for e in envdata.keys():
if data.getVarFlag( e, 'python', envdata ):
sys.__stdout__.write("\npython %s () {\n%s}\n" % (e, data.getVar(e, envdata, 1)))
if fnid not in seen_fnids:
seen_fnids.append(fnid)
packages = []
- print >> depends_file, '"%s" [label="%s %s\\n%s"]' % (pn, pn, version, fn)
+ print >> depends_file, '"%s" [label="%s %s\\n%s"]' % (pn, pn, version, fn)
for depend in self.status.deps[fn]:
print >> depends_file, '"%s" -> "%s"' % (pn, depend)
rdepends = self.status.rundeps[fn]
bb.msg.error(bb.msg.domain.Parsing, "Unable to match %s (%s matches found):" % (buildfile, len(matches)))
for f in matches:
bb.msg.error(bb.msg.domain.Parsing, " %s" % f)
- sys.exit(1)
- return matches[0]
+ return False
+ return matches[0]
def buildFile(self, buildfile):
"""
Build the file matching regexp buildfile
"""
- bf = self.matchFile(buildfile)
+ # Make sure our target is a fully qualified filename
+ fn = self.matchFile(buildfile)
+ if not fn:
+ return False
- bbfile_data = bb.parse.handle(bf, self.configuration.data)
+ bbfile_data = bb.parse.handle(fn, self.configuration.data)
# Remove stamp for target if force mode active
if self.configuration.force:
- bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (self.configuration.cmd, bf))
+ bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (self.configuration.cmd, fn))
bb.build.del_stamp('do_%s' % self.configuration.cmd, bbfile_data)
item = bb.data.getVar('PN', bbfile_data, 1)
except bb.build.EventException:
bb.msg.error(bb.msg.domain.Build, "Build of '%s' failed" % item )
- sys.exit(0)
+ return True
def buildTargets(self, targets):
"""
self.interactiveMode()
if self.configuration.buildfile is not None:
- return self.buildFile(self.configuration.buildfile)
+ if not self.buildFile(self.configuration.buildfile):
+ sys.exit(1)
+ sys.exit(0)
# initialise the parsing status now we know we will need deps
self.updateCache()
oldcmd = cooker.configuration.cmd
cooker.configuration.cmd = cmd
- thisdata = data.createCopy(cooker.configuration.data)
- data.update_data(thisdata)
- data.expandKeys(thisdata)
-
try:
- bbfile_data = parse.handle( bf, thisdata )
+ cooker.buildFile(bf)
except parse.ParseError:
print "ERROR: Unable to open or parse '%s'" % bf
- else:
- # Remove stamp for target if force mode active
- if cooker.configuration.force:
- bb.msg.note(2, bb.msg.domain.RunQueue, "Remove stamp %s, %s" % (cmd, bf))
- bb.build.del_stamp('do_%s' % cmd, bbfile_data)
-
- item = data.getVar('PN', bbfile_data, 1)
- data.setVar( "_task_cache", [], bbfile_data ) # force
- try:
- cooker.tryBuildPackage( os.path.abspath( bf ), item, cmd, bbfile_data, True )
- except build.EventException, e:
- print "ERROR: Couldn't build '%s'" % name
- last_exception = e
+ except build.EventException, e:
+ print "ERROR: Couldn't build '%s'" % name
+ last_exception = e
cooker.configuration.cmd = oldcmd
fileBuild.usage = "<bbfile>"
def completeFilePath( bbfile ):
"""Get the complete bbfile path"""
+ if not cooker.status: return bbfile
if not cooker.status.pkg_fn: return bbfile
for key in cooker.status.pkg_fn.keys():
if key.endswith( bbfile ):