summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@datenfreihafen.org>2009-08-20 12:27:31 +0200
committerStefan Schmidt <stefan@datenfreihafen.org>2009-08-20 12:27:31 +0200
commita0ac64bb461533e06f99e865f5b2fc315d033b17 (patch)
tree9fa683112d553e0ab76feccac26f11d4be9ec48b /classes
parentf77a615dee76f1c6d560b69ec8c1a245bd46f39c (diff)
parent6d77f938e950a882ab500392d9d7074a3dcd15ba (diff)
Merge branch 'org.openembedded.dev' of git@git.openembedded.org:openembedded into org.openembedded.dev
Diffstat (limited to 'classes')
-rw-r--r--classes/base.bbclass14
-rw-r--r--classes/devshell.bbclass3
-rw-r--r--classes/gconf.bbclass7
-rw-r--r--classes/image.bbclass4
-rw-r--r--classes/kernel.bbclass3
-rw-r--r--classes/package_rpm.bbclass4
-rw-r--r--classes/package_tar.bbclass2
-rw-r--r--classes/sanity.bbclass2
-rw-r--r--classes/src_distribute.bbclass43
-rw-r--r--classes/src_distribute_local.bbclass58
10 files changed, 90 insertions, 50 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass
index ef6c0abf8f..598a7bb77f 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -159,6 +159,12 @@ def base_read_file(filename):
return f.read().strip()
return None
+def base_ifelse(condition, iftrue = True, iffalse = False):
+ if condition:
+ return iftrue
+ else:
+ return iffalse
+
def base_conditional(variable, checkvalue, truevalue, falsevalue, d):
import bb
if bb.data.getVar(variable,d,1) == checkvalue:
@@ -614,6 +620,9 @@ python base_do_fetch() {
except bb.fetch.NoMethodError:
(type, value, traceback) = sys.exc_info()
raise bb.build.FuncFailed("No method: %s" % value)
+ except bb.MalformedUrl:
+ (type, value, traceback) = sys.exc_info()
+ raise bb.build.FuncFailed("Malformed URL: %s" % value)
try:
bb.fetch.go(localdata)
@@ -1279,7 +1288,6 @@ ${DEBIAN_MIRROR} ftp://ftp.es.debian.org/debian/pool
${DEBIAN_MIRROR} ftp://ftp.se.debian.org/debian/pool
${DEBIAN_MIRROR} ftp://ftp.tr.debian.org/debian/pool
${GNU_MIRROR} ftp://mirrors.kernel.org/gnu
-${GNU_MIRROR} ftp://ftp.matrix.com.br/pub/gnu
${GNU_MIRROR} ftp://ftp.cs.ubc.ca/mirror2/gnu
${GNU_MIRROR} ftp://sunsite.ust.hk/pub/gnu
${GNU_MIRROR} ftp://ftp.ayamura.org/pub/gnu
@@ -1313,6 +1321,10 @@ ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://gd.tuwien.ac.at/utils/adm
ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://sunsite.ualberta.ca/pub/Mirror/lsof/
ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://the.wiretapped.net/pub/security/host-security/lsof/
http://www.apache.org/dist http://archive.apache.org/dist
+ftp://.*/.* http://mirrors.openembedded.org/
+https?$://.*/.* http://mirrors.openembedded.org/
+ftp://.*/.* http://sources.openembedded.org/
+https?$://.*/.* http://sources.openembedded.org/
}
diff --git a/classes/devshell.bbclass b/classes/devshell.bbclass
index 2944dbbfc2..9327b55d0a 100644
--- a/classes/devshell.bbclass
+++ b/classes/devshell.bbclass
@@ -4,7 +4,8 @@ do_devshell[dirs] = "${S}"
do_devshell[nostamp] = "1"
export DISPLAY
-export XAUTHORITY
+export DBUS_SESSION_BUS_ADDRESS
+export XAUTHORITY ?= "${HOME}/.Xauthority"
devshell_do_devshell() {
export TERMWINDOWTITLE="Bitbake Developer Shell"
diff --git a/classes/gconf.bbclass b/classes/gconf.bbclass
index 99f33e433a..47df06329b 100644
--- a/classes/gconf.bbclass
+++ b/classes/gconf.bbclass
@@ -45,9 +45,10 @@ python populate_packages_append () {
if schemas != []:
bb.note("adding gconf postinst and prerm scripts to %s" % pkg)
bb.data.setVar('SCHEMA_FILES', " ".join(schemas), d)
- postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1)
- if not postinst:
- postinst = '#!/bin/sh\n'
+ postinst = '#!/bin/sh\n'
+ pkgpostinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1)
+ if pkgpostinst:
+ postinst += pkgpostinst
postinst += bb.data.getVar('gconf_postinst', d, 1)
bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
prerm = bb.data.getVar('pkg_prerm_%s' % pkg, d, 1) or bb.data.getVar('pkg_prerm', d, 1)
diff --git a/classes/image.bbclass b/classes/image.bbclass
index 385043bfc7..f7afbab81e 100644
--- a/classes/image.bbclass
+++ b/classes/image.bbclass
@@ -243,8 +243,10 @@ if [ -e ${IMAGE_ROOTFS}/usr/bin/opkg-cl ] ; then
${OPKG} list_installed | awk '{print $1}' |sort | uniq > /tmp/installed-packages
for i in $(cat /tmp/installed-packages | grep -v locale) ; do
- for translation in ${IMAGE_LINGUAS} $(echo ${IMAGE_LINGUAS} | awk -F_ '{print $1}'); do
+ for translation in ${IMAGE_LINGUAS}; do
+ translation_split=$(echo ${translation} | awk -F '-' '{print $1}')
echo ${i}-locale-${translation}
+ echo ${i}-locale-${translation_split}
done
done | sort | uniq > /tmp/wanted-locale-packages
diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index b4987608ed..3ee7f53a29 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -510,6 +510,7 @@ addtask uboot_mkimage before do_install after do_compile
KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}"
KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
+MODULES_IMAGE_BASE_NAME ?= modules-${PV}-${PR}-${MACHINE}
do_deploy() {
install -d ${DEPLOY_DIR_IMAGE}
@@ -517,7 +518,7 @@ do_deploy() {
package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin
if [ -d "${D}/lib" ]; then
- tar -cvzf ${DEPLOY_DIR_IMAGE}/modules-${PV}-${PR}-${MACHINE}.tgz -C ${D} lib
+ tar -cvzf ${DEPLOY_DIR_IMAGE}/${MODULES_IMAGE_BASE_NAME}.tgz -C ${D} lib
fi
cd ${DEPLOY_DIR_IMAGE}
diff --git a/classes/package_rpm.bbclass b/classes/package_rpm.bbclass
index 9755bf1d2d..13cb8773af 100644
--- a/classes/package_rpm.bbclass
+++ b/classes/package_rpm.bbclass
@@ -210,7 +210,9 @@ python do_package_rpm () {
python () {
import bb
- if bb.data.getVar('PACKAGES', d, True) != '':
+ if bb.data.getVar('PACKAGES', d, True) != '' and \
+ not bb.data.inherits_class('native', d) and \
+ not bb.data.inherits_class('cross', d):
deps = (bb.data.getVarFlag('do_package_write_rpm', 'depends', d) or "").split()
deps.append('rpm-native:do_populate_staging')
deps.append('fakeroot-native:do_populate_staging')
diff --git a/classes/package_tar.bbclass b/classes/package_tar.bbclass
index cb70a5fae8..a0eacf27f5 100644
--- a/classes/package_tar.bbclass
+++ b/classes/package_tar.bbclass
@@ -1,7 +1,5 @@
inherit package
-IMAGE_PKGTYPE ?= "tar"
-
python package_tar_fn () {
import os
from bb import data
diff --git a/classes/sanity.bbclass b/classes/sanity.bbclass
index 29624c3f78..83c03299bf 100644
--- a/classes/sanity.bbclass
+++ b/classes/sanity.bbclass
@@ -185,7 +185,7 @@ def check_sanity(e):
archs = data.getVar('PACKAGE_ARCHS', e.data, True).split()
for arch in archs:
if archs.count(arch) != 1:
- messages = messages + "Error, Your PACKAGE_ARCHS field contains duplicates. Perhaps you set EXTRA_PACKAGE_ARCHS twice accidently through some tune file?\n"
+ messages = messages + "Error, Your PACKAGE_ARCHS field contains duplicates. Perhaps you set PACKAGE_EXTRA_ARCHS twice accidently through some tune file?\n"
break
if messages != "":
diff --git a/classes/src_distribute.bbclass b/classes/src_distribute.bbclass
index 30b2670011..7d75c9e16f 100644
--- a/classes/src_distribute.bbclass
+++ b/classes/src_distribute.bbclass
@@ -1,29 +1,46 @@
+SRC_DISTRIBUTE_DLONLY ?= "0"
SRC_DISTRIBUTECOMMAND[func] = "1"
+
+addtask distribute_sources before do_build after do_fetch
python do_distribute_sources () {
+ import os, re, bb
+
+ bb.build.exec_func("do_fetch", d)
+
l = bb.data.createCopy(d)
bb.data.update_data(l)
- licenses = (bb.data.getVar('LICENSE', d, 1) or "unknown").split()
- sources_dir = bb.data.getVar('SRC_DISTRIBUTEDIR', d, 1)
- import re
+ licenses = (bb.data.getVar('LICENSE', d, 1) or "unknown").split()
for license in licenses:
for entry in license.split("|"):
for url in ((bb.data.getVar('SRC_URI', d, 1) or '').split()):
bb.fetch.init([url], d)
s = bb.fetch.localpath(url, d)
s = re.sub(';.*$', '', s)
+
+ try:
+ dlonly = int(d.getVar("SRC_DISTRIBUTE_DLONLY", 1))
+ except ValueError:
+ raise bb.build.FuncFailed("Invalid value for SRC_DISTRIBUTE_DLONLY: expected integer.")
+ if dlonly:
+ dldir = os.path.realpath(d.getVar("DL_DIR", 1) or "")
+ if dldir and not \
+ os.path.realpath(s).startswith(dldir + os.path.sep):
+ continue
+
cmd = bb.data.getVar('SRC_DISTRIBUTECOMMAND', d, 1)
if not cmd:
- raise bb.build.FuncFailed("Unable to distribute sources, SRC_DISTRIBUTECOMMAND not defined")
- bb.data.setVar('SRC', s, d)
- bb.data.setVar('SRC_DISTRIBUTEDIR', "%s/%s" % (sources_dir, entry), d)
- bb.build.exec_func('SRC_DISTRIBUTECOMMAND', d)
+ raise bb.build.FuncFailed("Unable to distribute sources, SRC_DISTRIBUTECOMMAND not set")
+ bb.debug(2, "srcdist: running %s" % cmd)
+ bb.data.setVar('SRC', os.path.normpath(s), l)
+ bb.data.setVar('LIC', entry, l)
+ bb.build.exec_func('SRC_DISTRIBUTECOMMAND', l)
}
-addtask distribute_sources before do_build after do_fetch
+addtask distribute_sources_all after do_distribute_sources
+do_distribute_sources_all[recrdeptask] = "do_distribute_sources"
+do_distribute_sources_all[nostamp] = "1"
-addtask distsrcall after do_distribute_sources
-do_distsrcall[recrdeptask] = "do_distribute_sources"
-base_do_distsrcall() {
- :
-}
+# compatability wrapper
+addtask distsrcall after do_distribute_sources_all
+do_distsrcall[nostamp] = "1"
diff --git a/classes/src_distribute_local.bbclass b/classes/src_distribute_local.bbclass
index 5f0cef5bec..5cec2880aa 100644
--- a/classes/src_distribute_local.bbclass
+++ b/classes/src_distribute_local.bbclass
@@ -1,31 +1,37 @@
inherit src_distribute
-# SRC_DIST_LOCAL possible values:
-# copy copies the files from ${A} to the distributedir
-# symlink symlinks the files from ${A} to the distributedir
-# move+symlink moves the files into distributedir, and symlinks them back
SRC_DIST_LOCAL ?= "move+symlink"
SRC_DISTRIBUTEDIR ?= "${DEPLOY_DIR}/sources"
-SRC_DISTRIBUTECOMMAND () {
- s="${SRC}"
- if [ ! -L "$s" ] && (echo "$s"|grep "^${DL_DIR}"); then
- :
- else
- exit 0;
- fi
- mkdir -p ${SRC_DISTRIBUTEDIR}
- case "${SRC_DIST_LOCAL}" in
- copy)
- test -e $s.md5 && cp -f $s.md5 ${SRC_DISTRIBUTEDIR}/
- cp -f $s ${SRC_DISTRIBUTEDIR}/
- ;;
- symlink)
- test -e $s.md5 && ln -sf $s.md5 ${SRC_DISTRIBUTEDIR}/
- ln -sf $s ${SRC_DISTRIBUTEDIR}/
- ;;
- move+symlink)
- mv $s ${SRC_DISTRIBUTEDIR}/
- ln -sf ${SRC_DISTRIBUTEDIR}/`basename $s` $s
- ;;
- esac
+SRC_DISTRIBUTECOMMAND[dirs] = "${SRC_DISTRIBUTEDIR}/${LIC}/${PN}"
+
+# symlinks the files to the SRC_DISTRIBUTEDIR
+SRC_DISTRIBUTECOMMAND-symlink () {
+ test -e ${SRC}.md5 && ln -sf ${SRC}.md5 .
+ ln -sf ${SRC} .
+}
+
+# copies the files to the SRC_DISTRIBUTEDIR
+SRC_DISTRIBUTECOMMAND-copy () {
+ test -e ${SRC}.md5 && cp -f ${SRC}.md5 .
+ cp -fr ${SRC} .
+}
+
+# moves the files to the SRC_DISTRIBUTEDIR and symlinks them back
+SRC_DISTRIBUTECOMMAND-move+symlink () {
+ if ! [ -L ${SRC} ]; then
+ mv ${SRC} .
+ ln -sf $PWD/`basename ${SRC}` ${SRC}
+ if [ -e ${SRC}.md5 ]; then
+ mv ${SRC}.md5 .
+ ln -sf $PWD/`basename ${SRC}.md5` ${SRC}.md5
+ fi
+ fi
+}
+
+#SRC_DISTRIBUTECOMMAND = "${@str(d.getVar('SRC_DISTRIBUTECOMMAND-%s' % d.getVar('SRC_DIST_LOCAL', 1), 1))}"
+python () {
+ if d.getVar("SRC_DISTRIBUTECOMMAND", 1) is None:
+ cmd = d.getVar("SRC_DISTRIBUTECOMMAND-%s" % d.getVar("SRC_DIST_LOCAL", 1), 0)
+ if cmd:
+ d.setVar("SRC_DISTRIBUTECOMMAND", cmd)
}