summaryrefslogtreecommitdiff
path: root/classes/base.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'classes/base.bbclass')
-rw-r--r--classes/base.bbclass57
1 files changed, 36 insertions, 21 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass
index 45a0282265..9998982bd1 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -82,6 +82,9 @@ def base_dep_prepend(d):
if bb.data.getVar('PN', d, True) == "shasum-native":
deps = ""
+ # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not
+ # we need that built is the responsibility of the patch function / class, not
+ # the application.
if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d):
if (bb.data.getVar('HOST_SYS', d, 1) !=
bb.data.getVar('BUILD_SYS', d, 1)):
@@ -272,8 +275,12 @@ oe_libinstall() {
# If such file doesn't exist, try to cut version suffix
if [ ! -f "$lafile" ]; then
- libname=`echo "$libname" | sed 's/-[0-9.]*$//'`
- lafile=$libname.la
+ libname1=`echo "$libname" | sed 's/-[0-9.]*$//'`
+ lafile1=$libname.la
+ if [ -f "$lafile1" ]; then
+ libname=$libname1
+ lafile=$lafile1
+ fi
fi
if [ -f "$lafile" ]; then
@@ -367,18 +374,6 @@ oe_machinstall() {
fi
}
-addtask showdata
-do_showdata[nostamp] = "1"
-python do_showdata() {
- import sys
- # emit variables and shell functions
- bb.data.emit_env(sys.__stdout__, d, True)
- # emit the metadata which isnt valid shell
- for e in d.keys():
- if bb.data.getVarFlag(e, 'python', d):
- sys.__stdout__.write("\npython %s () {\n%s}\n" % (e, bb.data.getVar(e, d, 1)))
-}
-
addtask listtasks
do_listtasks[nostamp] = "1"
python do_listtasks() {
@@ -579,6 +574,8 @@ python base_do_unpack() {
except bb.MalformedUrl, e:
raise FuncFailed('Unable to generate local path for malformed uri: %s' % e)
# dont need any parameters for extraction, strip them off
+ # RP: Insane. localpath shouldn't have parameters
+ # RP: Scehdule for removal with bitbake 1.8.8
local = re.sub(';.*$', '', local)
local = os.path.realpath(local)
ret = oe_unpack_file(local, localdata, url)
@@ -807,6 +804,7 @@ def base_after_parse(d):
pn = bb.data.getVar('PN', d, 1)
+
# OBSOLETE in bitbake 1.7.4
srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1)
if srcdate != None:
@@ -816,9 +814,15 @@ def base_after_parse(d):
if use_nls != None:
bb.data.setVar('USE_NLS', use_nls, d)
- # Make sure MACHINE *isn't* exported
+ # Make sure MACHINE isn't exported
+ # (breaks binutils at least)
bb.data.delVarFlag('MACHINE', 'export', d)
bb.data.setVarFlag('MACHINE', 'unexport', 1, d)
+
+ # Make sure DISTRO isn't exported
+ # (breaks sysvinit at least)
+ bb.data.delVarFlag('DISTRO', 'export', d)
+ bb.data.setVarFlag('DISTRO', 'unexport', 1, d)
# Git packages should DEPEND on git-native
srcuri = bb.data.getVar('SRC_URI', d, 1)
@@ -826,27 +830,38 @@ def base_after_parse(d):
depends = bb.data.getVarFlag('do_fetch', 'depends', d) or ""
depends = depends + " git-native:do_populate_staging"
bb.data.setVarFlag('do_fetch', 'depends', depends, d)
-
mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
old_arch = bb.data.getVar('PACKAGE_ARCH', d, 1)
if (old_arch == mach_arch):
# Nothing to do
return
+
+ #
+ # We always try to scan SRC_URI for urls with machine overrides
+ # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0
+ #
override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1)
-
- if not override or override == '0':
+ if override == '0':
return
paths = []
- for p in [ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ]:
- paths.append(bb.data.expand(os.path.join(p, mach_arch), d))
+ for p in [ "${PF}", "${P}", "${PN}", "files", "" ]:
+ paths.append(bb.data.expand(os.path.join("${FILE_DIRNAME}", p, "${MACHINE}"), d))
+ path = bb.data.expand(os.path.join("${FILE_DIRNAME}", p, "${MACHINE}"), d)
+ if os.path.isdir(path):
+ paths.append(path)
+ if len(paths) == 0:
+ return
+
for s in bb.data.getVar('SRC_URI', d, 1).split():
+ if not s.startswith("file://"):
+ continue
local = bb.data.expand(bb.fetch.localpath(s, d), d)
for mp in paths:
if local.startswith(mp):
#bb.note("overriding PACKAGE_ARCH from %s to %s" % (old_arch, mach_arch))
- bb.data.setVar('PACKAGE_ARCH', mach_arch, d)
+ bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d)
return
#