inject(toimport.split(".", 1)[0], imported)
python oe_import_eh () {
- if isinstance(e, bb.event.ConfigParsed):
- oe_import(e.data)
- e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data))
+ oe_import(e.data)
+ e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data))
}
addhandler oe_import_eh
+oe_import_eh[eventmask] = "bb.event.ConfigParsed"
def lsb_distro_identifier(d):
adjust = d.getVar('LSB_DISTRO_ADJUST', True)
bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
addhandler base_eventhandler
+base_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.BuildStarted"
python base_eventhandler() {
if isinstance(e, bb.event.ConfigParsed):
e.data.setVar('BB_VERSION', bb.__version__)
return False
addhandler bugzilla_eventhandler
+bugzilla_eventhandler[eventmask] = "bb.event.MsgNote bb.build.TaskFailed"
python bugzilla_eventhandler() {
import glob
import xmlrpclib, httplib
}
python buildhistory_eventhandler() {
- if isinstance(e, bb.event.BuildCompleted):
- if e.data.getVar('BUILDHISTORY_FEATURES', True).strip():
- if e.data.getVar("BUILDHISTORY_COMMIT", True) == "1":
- bb.build.exec_func("buildhistory_commit", e.data)
+ if e.data.getVar('BUILDHISTORY_FEATURES', True).strip():
+ if e.data.getVar("BUILDHISTORY_COMMIT", True) == "1":
+ bb.build.exec_func("buildhistory_commit", e.data)
}
addhandler buildhistory_eventhandler
+buildhistory_eventhandler[eventmask] = "bb.event.BuildCompleted"
# FIXME this ought to be moved into the fetcher
}
addhandler run_buildstats
+run_buildstats[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted bb.build.TaskStarted bb.build.TaskSucceeded bb.build.TaskFailed"
do_populate_sysroot[stamp-extra-info] = ""
python cross_virtclass_handler () {
- if not isinstance(e, bb.event.RecipePreFinalise):
- return
-
classextend = e.data.getVar('BBCLASSEXTEND', True) or ""
if "cross" not in classextend:
return
}
addhandler cross_virtclass_handler
+cross_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
do_install () {
oe_runmake 'DESTDIR=${D}' install
include conf/distro/include/package_regex.inc
addhandler distro_eventhandler
+distro_eventhandler[eventmask] = "bb.event.BuildStarted"
python distro_eventhandler() {
-
- if bb.event.getName(e) == "BuildStarted":
- import oe.distro_check as dc
- logfile = dc.create_log_file(e.data, "distrodata.csv")
- lf = bb.utils.lockfile("%s.lock" % logfile)
- f = open(logfile, "a")
- f.write("Package,Description,Owner,License,VerMatch,Version,Upsteam,Reason,Recipe Status,Distro 1,Distro 2,Distro 3\n")
- f.close()
- bb.utils.unlockfile(lf)
+ import oe.distro_check as dc
+ logfile = dc.create_log_file(e.data, "distrodata.csv")
+ lf = bb.utils.lockfile("%s.lock" % logfile)
+ f = open(logfile, "a")
+ f.write("Package,Description,Owner,License,VerMatch,Version,Upsteam,Reason,Recipe Status,Distro 1,Distro 2,Distro 3\n")
+ f.close()
+ bb.utils.unlockfile(lf)
return
}
}
addhandler checkpkg_eventhandler
+ checkpkg_eventhandler[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted"
python checkpkg_eventhandler() {
def parse_csv_file(filename):
package_dict = {}
}
addhandler distro_check_eventhandler
+distro_check_eventhandler bb.event.BuildStarted
python distro_check_eventhandler() {
- if bb.event.getName(e) == "BuildStarted":
- """initialize log files."""
- import oe.distro_check as dc
- result_file = dc.create_log_file(e.data, "distrocheck.csv")
+ """initialize log files."""
+ import oe.distro_check as dc
+ result_file = dc.create_log_file(e.data, "distrocheck.csv")
return
}
#then we can search those recipes which license text isn't exsit in common-licenses directory
#
addhandler checklicense_eventhandler
+checklicense_eventhandler[eventmask] = "bb.event.BuildStarted"
python checklicense_eventhandler() {
- if bb.event.getName(e) == "BuildStarted":
- """initialize log files."""
- import oe.distro_check as dc
- logfile = dc.create_log_file(e.data, "missinglicense.csv")
- lf = bb.utils.lockfile("%s.lock" % logfile)
- f = open(logfile, "a")
- f.write("Package\tLicense\tMissingLicense\n")
- f.close()
- bb.utils.unlockfile(lf)
+ """initialize log files."""
+ import oe.distro_check as dc
+ logfile = dc.create_log_file(e.data, "missinglicense.csv")
+ lf = bb.utils.lockfile("%s.lock" % logfile)
+ f = open(logfile, "a")
+ f.write("Package\tLicense\tMissingLicense\n")
+ f.close()
+ bb.utils.unlockfile(lf)
return
}
if not e.data:
return
- if isinstance(e, bb.event.RecipeParsed):
- pv = e.data.getVar('PV', True)
- if not 'AUTOINC' in pv:
- return
-
- localcounts = bb.persist_data.persist('BB_URI_LOCALCOUNT', e.data)
- pn = e.data.getVar('PN', True)
- revs = localcounts.get_by_pattern('%%-%s_rev' % pn)
- counts = localcounts.get_by_pattern('%%-%s_count' % pn)
- if not revs or not counts:
- return
-
- if len(revs) != len(counts):
- bb.warn("The number of revs and localcounts don't match in %s" % pn)
- return
-
- version = e.data.getVar('PRAUTOINX', True)
- srcrev = bb.fetch2.get_srcrev(e.data)
- base_ver = 'AUTOINC-%s' % version[:version.find(srcrev)]
- pkgarch = e.data.getVar('PACKAGE_ARCH', True)
- value = max(int(count) for count in counts)
-
- if len(revs) == 1:
- if srcrev != ('AUTOINC+%s' % revs[0]):
- value += 1
- else:
- value += 1
+ pv = e.data.getVar('PV', True)
+ if not 'AUTOINC' in pv:
+ return
+
+ localcounts = bb.persist_data.persist('BB_URI_LOCALCOUNT', e.data)
+ pn = e.data.getVar('PN', True)
+ revs = localcounts.get_by_pattern('%%-%s_rev' % pn)
+ counts = localcounts.get_by_pattern('%%-%s_count' % pn)
+ if not revs or not counts:
+ return
- bb.utils.mkdirhier(e.data.getVar('PRSERV_DUMPDIR', True))
- df = e.data.getVar('LOCALCOUNT_DUMPFILE', True)
- flock = bb.utils.lockfile("%s.lock" % df)
- with open(df, 'a') as fd:
- fd.write('PRAUTO$%s$%s$%s = "%s"\n' %
- (base_ver, pkgarch, srcrev, str(value)))
- bb.utils.unlockfile(flock)
+ if len(revs) != len(counts):
+ bb.warn("The number of revs and localcounts don't match in %s" % pn)
+ return
+
+ version = e.data.getVar('PRAUTOINX', True)
+ srcrev = bb.fetch2.get_srcrev(e.data)
+ base_ver = 'AUTOINC-%s' % version[:version.find(srcrev)]
+ pkgarch = e.data.getVar('PACKAGE_ARCH', True)
+ value = max(int(count) for count in counts)
+
+ if len(revs) == 1:
+ if srcrev != ('AUTOINC+%s' % revs[0]):
+ value += 1
+ else:
+ value += 1
+
+ bb.utils.mkdirhier(e.data.getVar('PRSERV_DUMPDIR', True))
+ df = e.data.getVar('LOCALCOUNT_DUMPFILE', True)
+ flock = bb.utils.lockfile("%s.lock" % df)
+ with open(df, 'a') as fd:
+ fd.write('PRAUTO$%s$%s$%s = "%s"\n' %
+ (base_ver, pkgarch, srcrev, str(value)))
+ bb.utils.unlockfile(flock)
}
addhandler migrate_localcount_handler
+migrate_localcount_handler[eventmask] = "bb.event.RecipeParsed"
python multilib_virtclass_handler () {
- if not isinstance(e, bb.event.RecipePreFinalise):
- return
-
cls = e.data.getVar("BBEXTENDCURR", True)
variant = e.data.getVar("BBEXTENDVARIANT", True)
if cls != "multilib" or not variant:
}
addhandler multilib_virtclass_handler
+multilib_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
STAGINGCC_prepend = "${BBEXTENDVARIANT}-"
}
addhandler multilib_virtclass_handler_global
+multilib_virtclass_handler_global[eventmask] = "bb.event.RecipePreFinalise bb.event.RecipeParsed"
PATH_prepend = "${COREBASE}/scripts/native-intercept:"
python native_virtclass_handler () {
- if not isinstance(e, bb.event.RecipePreFinalise):
- return
-
classextend = e.data.getVar('BBCLASSEXTEND', True) or ""
if "native" not in classextend:
return
}
addhandler native_virtclass_handler
+native_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
do_package[noexec] = "1"
do_packagedata[noexec] = "1"
export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
python nativesdk_virtclass_handler () {
- if not isinstance(e, bb.event.RecipePreFinalise):
- return
-
pn = e.data.getVar("PN", True)
if not pn.endswith("-nativesdk") or pn.startswith("nativesdk-"):
return
}
addhandler nativesdk_virtclass_handler
+nativesdk_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
do_populate_sysroot[stamp-extra-info] = ""
python packageinfo_handler () {
- if isinstance(e, bb.event.RequestPackageInfo):
- import oe.packagedata
- pkginfolist = []
- tmpdir = e.data.getVar('TMPDIR', True)
- target_vendor = e.data.getVar('TARGET_VENDOR', True)
- target_os = e.data.getVar('TARGET_OS', True)
- package_archs = e.data.getVar('PACKAGE_ARCHS', True)
- packaging = e.data.getVar('PACKAGE_CLASSES', True).split()[0].split('_')[1]
- deploy_dir = e.data.getVar('DEPLOY_DIR', True) + '/' + packaging
-
- for arch in package_archs.split():
- pkgdata_dir = tmpdir + '/pkgdata/' + arch + target_vendor + '-' + target_os + '/runtime/'
- if os.path.exists(pkgdata_dir):
- for root, dirs, files in os.walk(pkgdata_dir):
- for pkgname in files:
- if pkgname.endswith('.packaged'):
- pkgname = pkgname[:-9]
- pkgdatafile = root + pkgname
- try:
- sdata = oe.packagedata.read_pkgdatafile(pkgdatafile)
- sdata['PKG'] = pkgname
- pkginfolist.append(sdata)
- except Exception as e:
- bb.warn("Failed to read pkgdata file %s: %s: %s" % (pkgdatafile, e.__class__, str(e)))
- bb.event.fire(bb.event.PackageInfo(pkginfolist), e.data)
+ import oe.packagedata
+ pkginfolist = []
+ tmpdir = e.data.getVar('TMPDIR', True)
+ target_vendor = e.data.getVar('TARGET_VENDOR', True)
+ target_os = e.data.getVar('TARGET_OS', True)
+ package_archs = e.data.getVar('PACKAGE_ARCHS', True)
+ packaging = e.data.getVar('PACKAGE_CLASSES', True).split()[0].split('_')[1]
+ deploy_dir = e.data.getVar('DEPLOY_DIR', True) + '/' + packaging
+
+ for arch in package_archs.split():
+ pkgdata_dir = tmpdir + '/pkgdata/' + arch + target_vendor + '-' + target_os + '/runtime/'
+ if os.path.exists(pkgdata_dir):
+ for root, dirs, files in os.walk(pkgdata_dir):
+ for pkgname in files:
+ if pkgname.endswith('.packaged'):
+ pkgname = pkgname[:-9]
+ pkgdatafile = root + pkgname
+ try:
+ sdata = oe.packagedata.read_pkgdatafile(pkgdatafile)
+ sdata['PKG'] = pkgname
+ pkginfolist.append(sdata)
+ except Exception as e:
+ bb.warn("Failed to read pkgdata file %s: %s: %s" % (pkgdatafile, e.__class__, str(e)))
+ bb.event.fire(bb.event.PackageInfo(pkginfolist), e.data)
}
addhandler packageinfo_handler
+packageinfo_handler[eventmask] = "bb.event.RequestPackageInfo"
}
addhandler prexport_handler
+prexport_handler bb.event.RecipeParsed bb.event.ParseStarted bb.event.ParseCompleted"
}
addhandler primport_handler
+primport_handler[eventmask] = "bb.event.ParseCompleted bb.event.ParseStarted"
addtask recipe_sanity_all after do_recipe_sanity
python recipe_sanity_eh () {
- if bb.event.getName(e) != "ConfigParsed":
- return
-
d = e.data
cfgdata = {}
DataSmart.renameVar = myrename
}
addhandler recipe_sanity_eh
+recipe_sanity_eh[eventmask] = "bb.event.ConfigParsed"
return sanity_data
addhandler check_sanity_eventhandler
+check_sanity_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.SanityCheck bb.event.NetworkTest"
python check_sanity_eventhandler() {
if bb.event.getName(e) == "ConfigParsed" and e.data.getVar("BB_WORKERCONTEXT", True) != "1" and e.data.getVar("DISABLE_SANITY_CHECKS", True) != "1":
sanity_data = copy_data(e)
python check_types() {
import oe.types
- if isinstance(e, bb.event.ConfigParsed):
- for key in e.data.keys():
- if e.data.getVarFlag(key, "type"):
- oe.data.typed_value(key, e.data)
+ for key in e.data.keys():
+ if e.data.getVarFlag(key, "type"):
+ oe.data.typed_value(key, e.data)
}
addhandler check_types
+check_types[eventmask] = "bb.event.ConfigParsed"
return first_line.split()[-1]
python csl_version_handler () {
- if not isinstance(e, bb.event.ConfigParsed):
- return
d = e.data
ld = d.createCopy()
ld.finalize()
d.setVar('CSL_VER_GDB', csl_get_gdb_version(ld))
}
addhandler csl_version_handler
+csl_version_handler[eventmask] = "bb.event.ConfigParsed"
# Ensure that any variable which includes the --sysroot (CC, CXX, etc) also
# depends on the toolchain version
# to our staging toolchain bindir.
python toolchain_metadata_setup () {
- if not isinstance(e, bb.event.ConfigParsed):
- return
-
d = e.data
l = d.createCopy()
d.setVar('TOOLCHAIN_PATH_ADD', '')
}
addhandler toolchain_metadata_setup
+toolchain_metadata_setup[eventmask] = "bb.event.ConfigParsed"
python toolchain_setup () {
- if not isinstance(e, bb.event.BuildStarted):
- return
-
d = e.data
if not d.getVar('TOOLCHAIN_PATH_ADD', True):
populate_toolchain_links(d)
}
addhandler toolchain_setup
+toolchain_setup[eventmask] = "bb.event.BuildStarted"
def populate_toolchain_links(d):
import errno