summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/base.bbclass65
-rw-r--r--classes/binconfig.bbclass1
-rw-r--r--classes/cpan-base.bbclass6
-rw-r--r--classes/cpan.bbclass2
-rw-r--r--classes/cpan_build.bbclass2
-rw-r--r--classes/kernel.bbclass6
-rw-r--r--classes/manifest.bbclass2
-rw-r--r--classes/native.bbclass7
-rw-r--r--classes/packaged-staging.bbclass1
-rw-r--r--classes/patch.bbclass4
-rw-r--r--classes/recipe_sanity.bbclass9
11 files changed, 72 insertions, 33 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass
index aa1037e472..3602801f50 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -56,6 +56,50 @@ def base_chk_load_parser(config_paths):
return parser
+def base_chk_file_vars(parser, localpath, params, data):
+ try:
+ name = params["name"]
+ except KeyError:
+ return False
+ flagName = "%s.md5sum" % name
+ want_md5sum = bb.data.getVarFlag("SRC_URI", flagName, data)
+ flagName = "%s.sha256sum" % name
+ want_sha256sum = bb.data.getVarFlag("SRC_URI", flagName, data)
+
+ if (want_sha256sum == None and want_md5sum == None):
+ # no checksums to check, nothing to do
+ return False
+
+ if not os.path.exists(localpath):
+ localpath = base_path_out(localpath, data)
+ bb.note("The localpath does not exist '%s'" % localpath)
+ raise Exception("The path does not exist '%s'" % localpath)
+
+ if want_md5sum:
+ try:
+ md5pipe = os.popen('PATH=%s md5sum %s' % (bb.data.getVar('PATH', data, True), localpath))
+ md5data = (md5pipe.readline().split() or [ "" ])[0]
+ md5pipe.close()
+ except OSError, e:
+ raise Exception("Executing md5sum failed")
+ if want_md5sum != md5data:
+ bb.note("The MD5Sums did not match. Wanted: '%s' and Got: '%s'" % (want_md5sum, md5data))
+ raise Exception("MD5 Sums do not match. Wanted: '%s' Got: '%s'" % (want_md5sum, md5data))
+
+ if want_sha256sum:
+ try:
+ shapipe = os.popen('PATH=%s oe_sha256sum %s' % (bb.data.getVar('PATH', data, True), localpath))
+ sha256data = (shapipe.readline().split() or [ "" ])[0]
+ shapipe.close()
+ except OSError, e:
+ raise Exception("Executing shasum failed")
+ if want_sha256sum != sha256data:
+ bb.note("The SHA256Sums did not match. Wanted: '%s' and Got: '%s'" % (want_sha256sum, sha256data))
+ raise Exception("SHA256 Sums do not match. Wanted: '%s' Got: '%s'" % (want_sha256sum, sha256data))
+
+ return True
+
+
def base_chk_file(parser, pn, pv, src_uri, localpath, data):
no_checksum = False
# Try PN-PV-SRC_URI first and then try PN-SRC_URI
@@ -639,15 +683,15 @@ python base_do_fetch() {
# Check each URI
for url in src_uri.split():
localpath = bb.data.expand(bb.fetch.localpath(url, localdata), localdata)
- (type,host,path,_,_,_) = bb.decodeurl(url)
+ (type,host,path,_,_,params) = bb.decodeurl(url)
uri = "%s://%s%s" % (type,host,path)
try:
- if type == "http" or type == "https" or type == "ftp" or type == "ftps":
- if not base_chk_file(parser, pn, pv,uri, localpath, d):
- if not bb.data.getVar("OE_ALLOW_INSECURE_DOWNLOADS",d, True):
- bb.fatal("%s-%s: %s has no entry in conf/checksums.ini, not checking URI" % (pn,pv,uri))
+ if type in [ "http", "https", "ftp", "ftps" ]:
+ if not (base_chk_file_vars(parser, localpath, params, d) or base_chk_file(parser, pn, pv,uri, localpath, d)):
+ if not bb.data.getVar("OE_ALLOW_INSECURE_DOWNLOADS", d, True):
+ bb.fatal("%s-%s: %s has no checksum defined, cannot check archive integrity" % (pn,pv,uri))
else:
- bb.note("%s-%s: %s has no entry in conf/checksums.ini, not checking URI" % (pn,pv,uri))
+ bb.note("%s-%s: %s has no checksum defined, archive integrity not checked" % (pn,pv,uri))
except Exception:
raise bb.build.FuncFailed("Checksum of '%s' failed" % uri)
}
@@ -1041,6 +1085,8 @@ def is_legacy_staging(d):
legacy = False
if bb.data.getVar('PSTAGE_BROKEN_DESTDIR', d, 1) == "1":
legacy = True
+ if bb.data.getVar('FORCE_LEGACY_STAGING', d, 1) == "1":
+ legacy = True
return legacy
do_populate_staging[dirs] = "${STAGING_DIR_TARGET}/${bindir} ${STAGING_DIR_TARGET}/${libdir} \
@@ -1085,9 +1131,11 @@ python do_populate_staging () {
if legacy:
bb.data.setVar("SYSROOT_DESTDIR", "", d)
bb.note("Legacy staging mode for %s" % bb.data.getVar("FILE", d, True))
+ if bb.data.getVarFlags('do_stage', d) is None:
+ bb.fatal("This recipe (%s) has a do_stage_prepend or do_stage_append and do_stage now doesn't exist. Please rename this to do_stage()" % bb.data.getVar("FILE", d, True))
lock = bb.utils.lockfile(lockfile)
- bb.build.exec_func('do_stage', d)
bb.build.exec_func('populate_staging_prehook', d)
+ bb.build.exec_func('do_stage', d)
for f in (bb.data.getVar('SYSROOT_PREPROCESS_FUNCS', d, True) or '').split():
bb.build.exec_func(f, d)
bb.build.exec_func('populate_staging_posthook', d)
@@ -1248,6 +1296,9 @@ python () {
base_after_parse(d)
if is_legacy_staging(d):
bb.debug(1, "Legacy staging mode for %s" % bb.data.getVar("FILE", d, True))
+ if bb.data.getVarFlags('do_stage', d) is None:
+ bb.error("This recipe (%s) has a do_stage_prepend or do_stage_append and do_stage now doesn't exist. Please rename this to do_stage()" % bb.data.getVar("FILE", d, True))
+
}
def check_app_exists(app, d):
diff --git a/classes/binconfig.bbclass b/classes/binconfig.bbclass
index dad54a5f56..b3b2236709 100644
--- a/classes/binconfig.bbclass
+++ b/classes/binconfig.bbclass
@@ -2,7 +2,6 @@ FILES_${PN}-dev += "${bindir}/*-config"
# The namespaces can clash here hence the two step replace
def get_binconfig_mangle(d):
- import bb.data
s = "-e ''"
if not bb.data.inherits_class('native', d):
optional_quote = r"\(\"\?\)"
diff --git a/classes/cpan-base.bbclass b/classes/cpan-base.bbclass
index cc0d11e515..82fd5b459a 100644
--- a/classes/cpan-base.bbclass
+++ b/classes/cpan-base.bbclass
@@ -9,8 +9,8 @@ RDEPENDS += "${@["perl", ""][(bb.data.inherits_class('native', d))]}"
# Determine the staged version of perl from the perl configuration file
def get_perl_version(d):
- import os, bb, re
- cfg = bb.data.expand('${STAGING_DIR}/${HOST_SYS}/perl/config.sh', d)
+ import re
+ cfg = bb.data.expand('${STAGING_LIBDIR}/perl/config.sh', d)
try:
f = open(cfg, 'r')
except IOError:
@@ -33,7 +33,6 @@ def is_new_perl(d):
# Determine where the library directories are
def perl_get_libdirs(d):
- import bb
libdir = bb.data.getVar('libdir', d, 1)
if is_new_perl(d) == "yes":
libdirs = libdir + '/perl5'
@@ -42,7 +41,6 @@ def perl_get_libdirs(d):
return libdirs
def is_target(d):
- import bb
if not bb.data.inherits_class('native', d):
return "yes"
return "no"
diff --git a/classes/cpan.bbclass b/classes/cpan.bbclass
index 7b3faa2561..66054bc755 100644
--- a/classes/cpan.bbclass
+++ b/classes/cpan.bbclass
@@ -16,7 +16,7 @@ export PERL_ARCHLIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}"
cpan_do_configure () {
yes '' | perl Makefile.PL ${EXTRA_CPANFLAGS}
if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
- . ${STAGING_DIR_TARGET}/perl/config.sh
+ . ${STAGING_LIBDIR}/perl/config.sh
if [ "${IS_NEW_PERL}" = "yes" ]; then
sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \
-e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \
diff --git a/classes/cpan_build.bbclass b/classes/cpan_build.bbclass
index c3804ff4cc..2ca01996a9 100644
--- a/classes/cpan_build.bbclass
+++ b/classes/cpan_build.bbclass
@@ -25,7 +25,7 @@ DEPENDS_prepend = "${@cpan_build_dep_prepend(d)}"
cpan_build_do_configure () {
if [ ${@is_target(d)} == "yes" ]; then
# build for target
- . ${STAGING_DIR_TARGET}/perl/config.sh
+ . ${STAGING_LIBDIR}/perl/config.sh
if [ "${IS_NEW_PERL}" = "yes" ]; then
perl Build.PL --installdirs vendor \
--destdir ${D} \
diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index 9c1f637a66..0dde2d33ca 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -333,7 +333,7 @@ python populate_packages_prepend () {
def parse_depmod():
import os, re
- dvar = bb.data.getVar('D', d, 1)
+ dvar = bb.data.getVar('PKGD', d, 1)
if not dvar:
bb.error("D not defined")
return
@@ -382,7 +382,7 @@ python populate_packages_prepend () {
return deps
def get_dependencies(file, pattern, format):
- file = file.replace(bb.data.getVar('D', d, 1) or '', '', 1)
+ file = file.replace(bb.data.getVar('PKGD', d, 1) or '', '', 1)
if module_deps.has_key(file):
import os.path, re
@@ -401,7 +401,7 @@ python populate_packages_prepend () {
import re
vals = extract_modinfo(file)
- dvar = bb.data.getVar('D', d, 1)
+ dvar = bb.data.getVar('PKGD', d, 1)
# If autoloading is requested, output /etc/modutils/<name> and append
# appropriate modprobe commands to the postinst
diff --git a/classes/manifest.bbclass b/classes/manifest.bbclass
index 687f4b756e..8d714d3bbc 100644
--- a/classes/manifest.bbclass
+++ b/classes/manifest.bbclass
@@ -1,6 +1,6 @@
python read_manifest () {
- import sys, bb.manifest
+ import sys
mfn = bb.data.getVar("MANIFEST", d, 1)
if os.access(mfn, os.R_OK):
# we have a manifest, so emit do_stage and do_populate_pkgs,
diff --git a/classes/native.bbclass b/classes/native.bbclass
index 6292e4b121..96f9cf1a96 100644
--- a/classes/native.bbclass
+++ b/classes/native.bbclass
@@ -87,7 +87,12 @@ DEPENDS_virtclass-native ?= "${ORIG_DEPENDS}"
python __anonymous () {
# If we've a legacy native do_stage, we need to neuter do_install
stagefunc = bb.data.getVar('do_stage', d, True)
- if (stagefunc.strip() != "do_stage_native" and stagefunc.strip() != "autotools_stage_all") and bb.data.getVar('AUTOTOOLS_NATIVE_STAGE_INSTALL', d, 1) == "1":
+
+ # For now, force legacy mode for native packages using autotools_stage_all
+ if (stagefunc.strip() == "autotools_stage_all"):
+ bb.debug(1, "Forcing legacy staging mode for %s" % bb.data.getVar('FILE', d, 1))
+ bb.data.setVar('FORCE_LEGACY_STAGING', "1", d)
+ elif (stagefunc.strip() != "do_stage_native" and stagefunc.strip() != "autotools_stage_all") and bb.data.getVar('AUTOTOOLS_NATIVE_STAGE_INSTALL', d, 1) == "1":
bb.data.setVar("do_install", " :", d)
if "native" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""):
diff --git a/classes/packaged-staging.bbclass b/classes/packaged-staging.bbclass
index c65efd8b12..013f22dead 100644
--- a/classes/packaged-staging.bbclass
+++ b/classes/packaged-staging.bbclass
@@ -27,7 +27,6 @@ PSTAGE_NATIVEDEPENDS = "\
BB_STAMP_WHITELIST = "${PSTAGE_NATIVEDEPENDS}"
python () {
- import bb
pstage_allowed = True
# These classes encode staging paths into the binary data so can only be
diff --git a/classes/patch.bbclass b/classes/patch.bbclass
index dfb8ec960f..bb49fed7a1 100644
--- a/classes/patch.bbclass
+++ b/classes/patch.bbclass
@@ -76,8 +76,6 @@ def patch_init(d):
def __str__(self):
return "Patch Error: %s" % self.msg
- import bb, bb.data, bb.fetch
-
class PatchSet(object):
defaults = {
"strippath": 1
@@ -457,8 +455,6 @@ do_patch[depends] = "${PATCHDEPENDENCY}"
python patch_do_patch() {
import re
- import bb.fetch
-
patch_init(d)
src_uri = (bb.data.getVar('SRC_URI', d, 1) or '').split()
diff --git a/classes/recipe_sanity.bbclass b/classes/recipe_sanity.bbclass
index 29f4a8fada..d929da6319 100644
--- a/classes/recipe_sanity.bbclass
+++ b/classes/recipe_sanity.bbclass
@@ -1,10 +1,8 @@
def __note(msg, d):
- import bb
bb.note("%s: recipe_sanity: %s" % (d.getVar("P", 1), msg))
__recipe_sanity_badtargetvars = "RDEPENDS RPROVIDES"
def bad_target_vars(cfgdata, d):
- import bb.data
if bb.data.inherits_class("native", d) or \
bb.data.inherits_class("cross", d):
return
@@ -43,14 +41,12 @@ def var_renames_overwrite(cfgdata, d):
__note("rename of variable '%s' to '%s' overwrote existing value '%s' with '%s'." % (key, newkey, oldvalue, newvalue), d)
def incorrect_nonempty_PACKAGES(cfgdata, d):
- import bb.data
if bb.data.inherits_class("native", d) or \
bb.data.inherits_class("cross", d):
if d.getVar("PACKAGES", 1):
return True
def can_use_autotools_base(cfgdata, d):
- import bb
cfg = d.getVar("do_configure", 1)
if not bb.data.inherits_class("autotools", d):
return False
@@ -68,8 +64,6 @@ def can_use_autotools_base(cfgdata, d):
return True
def can_remove_FILESPATH(cfgdata, d):
- import os
- import bb
expected = cfgdata.get("FILESPATH")
#expected = "${@':'.join([os.path.normpath(os.path.join(fp, p, o)) for fp in d.getVar('FILESPATHBASE', 1).split(':') for p in d.getVar('FILESPATHPKG', 1).split(':') for o in (d.getVar('OVERRIDES', 1) + ':').split(':') if os.path.exists(os.path.join(fp, p, o))])}:${FILESDIR}"
expectedpaths = bb.data.expand(expected, d)
@@ -84,8 +78,6 @@ def can_remove_FILESPATH(cfgdata, d):
return expected != unexpanded
def can_remove_FILESDIR(cfgdata, d):
- import os
- import bb
expected = cfgdata.get("FILESDIR")
#expected = "${@bb.which(d.getVar('FILESPATH', 1), '.')}"
unexpanded = d.getVar("FILESDIR", 0)
@@ -102,7 +94,6 @@ def can_remove_FILESDIR(cfgdata, d):
expanded == bb.data.expand(expected, d))
def can_remove_others(p, cfgdata, d):
- import bb
for k in ["S", "PV", "PN", "DESCRIPTION", "LICENSE", "DEPENDS",
"SECTION", "PACKAGES", "EXTRA_OECONF", "EXTRA_OEMAKE"]:
#for k in cfgdata: