diff options
| author | Sergey Lapin <slapin@ossfans.org> | 2009-06-26 22:32:52 +0400 |
|---|---|---|
| committer | Sergey Lapin <slapin@ossfans.org> | 2009-06-26 22:32:52 +0400 |
| commit | c91a54aef8a39e7cbb2571574f56f2cf12104ff1 (patch) | |
| tree | e68102d093c111affd9208b78df9c18aa837c3b8 /classes | |
| parent | 323edc5ef4c3d8572ee0b4fd185ca6e3166d6b45 (diff) | |
| parent | 84efca2e2ad21d3d7cea68c0327f91aaf773eb67 (diff) | |
Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into org.openembedded.dev
Conflicts:
recipes/musicpd/mpd_0.14.2.bb
Diffstat (limited to 'classes')
| -rw-r--r-- | classes/autotools.bbclass | 1 | ||||
| -rw-r--r-- | classes/base.bbclass | 6 | ||||
| -rw-r--r-- | classes/gnome.bbclass | 5 | ||||
| -rw-r--r-- | classes/image.bbclass | 42 | ||||
| -rw-r--r-- | classes/kernel.bbclass | 15 | ||||
| -rw-r--r-- | classes/lib_package.bbclass | 5 | ||||
| -rw-r--r-- | classes/lockdown.bbclass | 41 | ||||
| -rw-r--r-- | classes/nylon-image.bbclass | 3 | ||||
| -rw-r--r-- | classes/nylon-mirrors.bbclass | 8 | ||||
| -rw-r--r-- | classes/oestats-client.bbclass | 20 | ||||
| -rw-r--r-- | classes/package_ipk.bbclass | 9 | ||||
| -rw-r--r-- | classes/package_rpm.bbclass | 2 | ||||
| -rw-r--r-- | classes/packaged-staging.bbclass | 2 | ||||
| -rw-r--r-- | classes/qt4e.bbclass | 7 | ||||
| -rw-r--r-- | classes/recipe_sanity.bbclass | 188 | ||||
| -rw-r--r-- | classes/rootfs_deb.bbclass | 2 | ||||
| -rw-r--r-- | classes/rootfs_ipk.bbclass | 11 | ||||
| -rw-r--r-- | classes/seppuku.bbclass | 6 | ||||
| -rw-r--r-- | classes/siteinfo.bbclass | 3 | ||||
| -rw-r--r-- | classes/task.bbclass | 1 | ||||
| -rw-r--r-- | classes/tinderclient.bbclass | 24 | ||||
| -rw-r--r-- | classes/update-rc.d.bbclass | 2 | ||||
| -rw-r--r-- | classes/xfce.bbclass | 2 |
23 files changed, 359 insertions, 46 deletions
diff --git a/classes/autotools.bbclass b/classes/autotools.bbclass index e43b289c56..8236a27c76 100644 --- a/classes/autotools.bbclass +++ b/classes/autotools.bbclass @@ -20,6 +20,7 @@ def autotools_dep_prepend(d): deps += 'libtool-native ' if not bb.data.inherits_class('native', d) \ and not bb.data.inherits_class('cross', d) \ + and not bb.data.inherits_class('sdk', d) \ and not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, 1): deps += 'libtool-cross ' diff --git a/classes/base.bbclass b/classes/base.bbclass index e622aeec51..bc50c67d4b 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -885,7 +885,7 @@ def base_get_metadata_svn_revision(path, d): def base_get_metadata_git_branch(path, d): import os - branch = os.popen('cd %s; git symbolic-ref HEAD' % path).read().rstrip() + branch = os.popen('cd %s; PATH=%s git symbolic-ref HEAD 2>/dev/null' % (path, d.getVar("BBPATH", 1))).read().rstrip() if len(branch) != 0: return branch.replace("refs/heads/", "") @@ -893,7 +893,7 @@ def base_get_metadata_git_branch(path, d): def base_get_metadata_git_revision(path, d): import os - rev = os.popen("cd %s; git show-ref HEAD" % path).read().split(" ")[0].rstrip() + rev = os.popen("cd %s; PATH=%s git show-ref HEAD 2>/dev/null" % (path, d.getVar("BBPATH", 1))).read().split(" ")[0].rstrip() if len(rev) != 0: return rev return "<unknown>" @@ -923,7 +923,7 @@ python base_eventhandler() { bb.data.setVar( 'BB_VERSION', bb.__version__, e.data ) statusvars = bb.data.getVar("BUILDCFG_VARS", e.data, 1).split() statuslines = ["%-17s = \"%s\"" % (i, bb.data.getVar(i, e.data, 1) or '') for i in statusvars] - statusmsg = "\nOE Build Configuration:\n%s\n" % '\n'.join(statuslines) + statusmsg = "\n%s\n%s\n" % (bb.data.getVar("BUILDCFG_HEADER", e.data, 1), "\n".join(statuslines)) print statusmsg needed_vars = bb.data.getVar("BUILDCFG_NEEDEDVARS", e.data, 1).split() diff --git a/classes/gnome.bbclass b/classes/gnome.bbclass index 89fb3a19f8..da88884dde 100644 --- a/classes/gnome.bbclass +++ b/classes/gnome.bbclass @@ -20,3 +20,8 @@ AUTOTOOLS_STAGE_PKGCONFIG = "1" gnome_stage_includes() { autotools_stage_includes } + +do_install_append() { + rm -rf ${D}${localstatedir}/lib/scrollkeeper/* +} + diff --git a/classes/image.bbclass b/classes/image.bbclass index 89d27120c1..864230bc91 100644 --- a/classes/image.bbclass +++ b/classes/image.bbclass @@ -17,6 +17,9 @@ IMAGE_INITSCRIPTS ?= "initscripts" # IMAGE_LOGIN_MANAGER ?= "tinylogin" +IMAGE_KEEPROOTFS ?= "" +IMAGE_KEEPROOTFS[doc] = "Set to non-empty to keep ${IMAGE_ROOTFS} around after image creation." + IMAGE_BOOT ?= "${IMAGE_INITSCRIPTS} \ ${IMAGE_DEV_MANAGER} \ ${IMAGE_INIT_MANAGER} \ @@ -133,6 +136,7 @@ fakeroot do_rootfs () { ${IMAGE_POSTPROCESS_COMMAND} ${MACHINE_POSTPROCESS_COMMAND} + ${@['rm -rf ${IMAGE_ROOTFS}', ''][bool(d.getVar("IMAGE_KEEPROOTFS", 1))]} } do_deploy_to[nostamp] = "1" @@ -231,8 +235,44 @@ rootfs_update_timestamp () { date "+%m%d%H%M%Y" >${IMAGE_ROOTFS}/etc/timestamp } +# Install locales into image for every entry in IMAGE_LINGUAS +install_linguas() { +if [ -e ${IMAGE_ROOTFS}/usr/bin/opkg-cl ] ; then + OPKG="opkg-cl ${IPKG_ARGS}" + + ${OPKG} update + ${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 + echo ${i}-locale-${translation} + done + done | sort | uniq > /tmp/wanted-locale-packages + + ${OPKG} list | awk '{print $1}' |grep locale |sort | uniq > /tmp/available-locale-packages + + cat /tmp/wanted-locale-packages /tmp/available-locale-packages | sort | uniq -d > /tmp/pending-locale-packages + + cat /tmp/pending-locale-packages | xargs ${OPKG} -nodeps install + rm -f ${IMAGE_ROOTFS}${libdir}/opkg/lists/* + + for i in ${IMAGE_ROOTFS}${libdir}/opkg/info/*.preinst; do + if [ -f $i ] && ! sh $i; then + opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .preinst` + fi + done + + for i in ${IMAGE_ROOTFS}${libdir}/opkg/info/*.postinst; do + if [ -f $i ] && ! sh $i configure; then + opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .postinst` + fi + done + +fi +} + # export the zap_root_password, create_etc_timestamp and remote_init_link -EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs make_zimage_symlink_relative set_image_autologin rootfs_update_timestamp +EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs make_zimage_symlink_relative set_image_autologin rootfs_update_timestamp install_linguas addtask rootfs after do_compile before do_install addtask deploy_to after do_rootfs diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass index 1323228a74..ef16669c3d 100644 --- a/classes/kernel.bbclass +++ b/classes/kernel.bbclass @@ -20,6 +20,11 @@ python __anonymous () { image = bb.data.getVar('INITRAMFS_IMAGE', d, True) if image != '' and image is not None: bb.data.setVar('INITRAMFS_TASK', '${INITRAMFS_IMAGE}:do_rootfs', d) + + machine_kernel_pr = bb.data.getVar('MACHINE_KERNEL_PR', d, True) + + if machine_kernel_pr: + bb.data.setVar('PR', machine_kernel_pr, d) } INITRAMFS_IMAGE ?= "" @@ -64,10 +69,6 @@ export CMDLINE_CONSOLE = "console=${@bb.data.getVar("KERNEL_CONSOLE",d,1) or "tt KERNEL_VERSION = "${@get_kernelversion('${S}')}" KERNEL_MAJOR_VERSION = "${@get_kernelmajorversion('${KERNEL_VERSION}')}" -# A machine.conf or local.conf can increase MACHINE_KERNEL_PR to force -# rebuilds for kernel and external modules -PR = "${MACHINE_KERNEL_PR}" - KERNEL_LOCALVERSION ?= "" # kernels are generally machine specific @@ -441,10 +442,14 @@ python populate_packages_prepend () { postinst = bb.data.getVar('pkg_postinst_modules', d, 1) postrm = bb.data.getVar('pkg_postrm_modules', d, 1) + + maybe_update_modules = "update-modules " + if bb.data.getVar("ONLINE_PACKAGE_MANAGEMENT", d) == "none": + maybe_update_modules = "" do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.bin$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.fw$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') - do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='update-modules kernel-%s' % bb.data.getVar("KERNEL_VERSION", d, 1)) + do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='%skernel-%s' % (maybe_update_modules, bb.data.getVar("KERNEL_VERSION", d, 1))) import re, os metapkg = "kernel-modules" diff --git a/classes/lib_package.bbclass b/classes/lib_package.bbclass index 788b7bb0c4..82c93707ea 100644 --- a/classes/lib_package.bbclass +++ b/classes/lib_package.bbclass @@ -1,11 +1,8 @@ PACKAGES += "${PN}-bin" -# NB: ${base_libdir}/*${SOLIBSDEV} is included here because the shared libraries -# in ${base_libdir} do not follow the usual *.so.* naming convention, for instance -# libproc-3.2.7.so FILES_${PN} = "${libexecdir} ${libdir}/lib*${SOLIBS} \ ${sysconfdir} ${sharedstatedir} ${localstatedir} \ - ${base_libdir}/*${SOLIBS} ${base_libdir}/*${SOLIBSDEV} \ + ${base_libdir}/*${SOLIBS} \ ${datadir}/${PN} ${libdir}/${PN}" FILES_${PN}-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la \ ${libdir}/*.a ${libdir}/pkgconfig /lib/*.a /lib/*.o \ diff --git a/classes/lockdown.bbclass b/classes/lockdown.bbclass new file mode 100644 index 0000000000..45b9761b9c --- /dev/null +++ b/classes/lockdown.bbclass @@ -0,0 +1,41 @@ +addtask show_versions before do_build +do_show_versions[nostamp] = "1" +python do_show_versions() { + import sys + + localdata = bb.data.createCopy(d) + bb.data.update_data(localdata) + + src_uri = bb.data.getVar('SRC_URI', localdata, 1) + if not src_uri: + return 1 + + try: + bb.fetch.init(src_uri.split(),d) + except bb.fetch.NoMethodError: + (type, value, traceback) = sys.exc_info() + raise bb.build.FuncFailed("No method: %s" % value) + + + src_uri = bb.data.getVar("SRC_URI", d, False) + pn = bb.data.getVar("PN", d, True) + src_revs = open("%s/src_revs.inc" % bb.data.getVar("TMPDIR", d, 1), "a") + src_dates = open("%s/src_dates.inc" % bb.data.getVar("TMPDIR", d, 1), "a") + pref_versions = open("%s/preferred_versions.inc" % bb.data.getVar("TMPDIR", d, 1), "a") + if "SRCREV" in bb.data.getVar("PV", d, False): + print >> src_revs, 'SRCREV_pn-%(pn)s ?= "%(rev)s"' % { 'pn' : pn, 'rev' : bb.data.getVar("SRCREV", d, True) } + elif "cvs://" in src_uri or "svn://" in src_uri or "git://" in src_uri: + print >> src_dates, 'SRCDATE_pn-%(pn)s ?= "%(date)s"' % { 'pn' : pn, 'date' : bb.data.getVar("SRCDATE", d, True) } + + print >> pref_versions, 'PREFERRED_VERSION_%(pn)s = "%(version)s"' % { "pn" : pn, 'version' : bb.data.getVar("PV", d, True) } + src_revs.close() + src_dates.close() + pref_versions.close() +} + +addtask lockdown +do_lockdown[nostamp] = "1" +do_lockdown[recrdeptask] = "do_show_versions" +python do_lockdown() { +} + diff --git a/classes/nylon-image.bbclass b/classes/nylon-image.bbclass index 6d867eab48..e973bf7cf5 100644 --- a/classes/nylon-image.bbclass +++ b/classes/nylon-image.bbclass @@ -9,11 +9,10 @@ nylon_create_imgz() { # copy the kernel (for mips on flash) into tmp FLASH_BIN=${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_NAME}.flash.bin - test -f ${FLASH_BIN} && \ cp ${FLASH_BIN} ${DEPLOY_DIR_IMAGE}/tmp/zImage.flash # copy rootfs.jffs (or so) into tmp - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.${type} ${DEPLOY_DIR_IMAGE}/tmp/rootfs.${type} + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 ${DEPLOY_DIR_IMAGE}/tmp/rootfs.jffs2 # make an imgz out of tmp ( cd ${DEPLOY_DIR_IMAGE}/tmp; tar cvzf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.imgz * ) diff --git a/classes/nylon-mirrors.bbclass b/classes/nylon-mirrors.bbclass index 02fddc01ba..11cc45ca0c 100644 --- a/classes/nylon-mirrors.bbclass +++ b/classes/nylon-mirrors.bbclass @@ -1,6 +1,6 @@ MIRRORS_append () { -ftp://.*/.* http://meshcube.org/nylon/stable/sources/ -https?://.*/.* http://meshcube.org/nylon/stable/sources/ -ftp://.*/.* http://meshcube.org/nylon/unstable/sources/ -https?://.*/.* http://meshcube.org/nylon/unstable/sources/ +ftp://.*/.*/ http://download.berlin.freifunk.net/meshcube.org/nylon/stable/sources/ +http://.*/.*/ http://download.berlin.freifunk.net/meshcube.org/nylon/stable/sources/ +ftp://.*/.*/ http://download.berlin.freifunk.net/meshcube.org/nylon/unstable/sources/ +http://.*/.*/ http://download.berlin.freifunk.net/meshcube.org/nylon/unstable/sources/ }
\ No newline at end of file diff --git a/classes/oestats-client.bbclass b/classes/oestats-client.bbclass index 6d348d3ded..8922496242 100644 --- a/classes/oestats-client.bbclass +++ b/classes/oestats-client.bbclass @@ -18,8 +18,9 @@ def oestats_getid(d): f = file(bb.data.getVar('TMPDIR', d, True) + '/oestats.id', 'r') return f.read() -def oestats_send(server, action, vars = {}, files = {}): +def oestats_send(d, server, action, vars = {}, files = {}): import httplib + import bb # build body output = [] @@ -49,7 +50,16 @@ def oestats_send(server, action, vars = {}, files = {}): "Content-length": str(len(body))} # send request - conn = httplib.HTTPConnection(server) + proxy = bb.data.getVar('HTTP_PROXY', d, True ) + if (proxy): + if (proxy.endswith('/')): + proxy = proxy[:-1] + if (proxy.startswith('http://')): + proxy = proxy[7:] + conn = httplib.HTTPConnection(proxy) + action = "http://%s%s" %(server, action) + else: + conn = httplib.HTTPConnection(server) conn.request("POST", action, body, headers) response = conn.getresponse() data = response.read() @@ -64,7 +74,7 @@ def oestats_start(server, builder, d): # send report id = "" try: - data = oestats_send(server, "/builds/", { + data = oestats_send(d, server, "/builds/", { 'builder': builder, 'build_arch': bb.data.getVar('BUILD_ARCH', d, True), 'metadata_branch': bb.data.getVar('METADATA_BRANCH', d, True), @@ -97,7 +107,7 @@ def oestats_stop(server, d, failures): status = "Succeeded" try: - response = oestats_send(server, "/builds/%s/" % id, { + response = oestats_send(d, server, "/builds/%s/" % id, { 'status': status, }) if status == 'Failed': @@ -157,7 +167,7 @@ def oestats_task(server, d, task, status): # send report try: - response = oestats_send(server, "/tasks/", vars, files) + response = oestats_send(d, server, "/tasks/", vars, files) if status == 'Failed': bb.note("oestats: task failed, see http://%s%s" % (server, response)) except: diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass index d4cb3b62e2..1f1b5c9a79 100644 --- a/classes/package_ipk.bbclass +++ b/classes/package_ipk.bbclass @@ -67,10 +67,16 @@ python package_ipk_install () { raise bb.build.FuncFailed } +do_package_update_index_ipk[lockfiles] = "${DEPLOY_DIR_IPK}.lock" +do_package_update_index_ipk[nostamp] = "1" +do_package_update_index_ipk[recrdeptask] += "do_package_write_ipk" +do_package_update_index_ipk[recrdeptask] += "do_package_write_ipk" +do_package_update_index_ipk[depends] += "ipkg-utils-native:do_populate_staging" + # # Update the Packages index files in ${DEPLOY_DIR_IPK} # -package_update_index_ipk () { +do_package_update_index_ipk () { set -x ipkgarchs="${PACKAGE_ARCHS}" @@ -322,3 +328,4 @@ python do_package_write_ipk () { } do_package_write_ipk[dirs] = "${D}" addtask package_write_ipk before do_package_write after do_package +addtask package_update_index_ipk before do_rootfs diff --git a/classes/package_rpm.bbclass b/classes/package_rpm.bbclass index 71fa76010f..0cebdea244 100644 --- a/classes/package_rpm.bbclass +++ b/classes/package_rpm.bbclass @@ -136,7 +136,7 @@ python write_specfile() { bb.build.exec_func('BUILDSPEC', d) # move the rpm into the pkgoutdir - rpm = bb.data.expand('${RPMBUILDPATH}/RPMS/${TARGET_ARCH}/${PKG}-${RPMPV}-${PR}.${TARGET_ARCH}.rpm', d) + rpm = bb.data.expand('${RPMBUILDPATH}/RPMS/${TARGET_ARCH}/${PKG}-${RPMPV}-${PR}${DISTRO_PR}.${TARGET_ARCH}.rpm', d) outrpm = bb.data.expand('${DEPLOY_DIR_RPM}/${PACKAGE_ARCH}/${PKG}-${RPMPV}-${PR}.${TARGET_ARCH}.rpm', d) bb.movefile(rpm, outrpm) } diff --git a/classes/packaged-staging.bbclass b/classes/packaged-staging.bbclass index bd7b9ea398..33acb90a2b 100644 --- a/classes/packaged-staging.bbclass +++ b/classes/packaged-staging.bbclass @@ -17,7 +17,7 @@ PSTAGE_EXTRAPATH ?= "/${OELAYOUT_ABI}/${DISTRO_PR}/" PSTAGE_PKGPATH = "${DISTRO}${PSTAGE_EXTRAPATH}" PSTAGE_PKGPN = "${@bb.data.expand('staging-${PN}-${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}', d).replace('_', '-')}" PSTAGE_PKGNAME = "${PSTAGE_PKGPN}_${PSTAGE_PKGVERSION}_${PSTAGE_PKGARCH}.ipk" -PSTAGE_PKG = "${DEPLOY_DIR_PSTAGE}/${PSTAGE_PKGPATH}/${PSTAGE_PKGNAME}" +PSTAGE_PKG ?= "${DEPLOY_DIR_PSTAGE}/${PSTAGE_PKGPATH}/${PSTAGE_PKGNAME}" PSTAGE_NATIVEDEPENDS = "\ shasum-native \ diff --git a/classes/qt4e.bbclass b/classes/qt4e.bbclass index 445ecbaa6a..f72e06b6eb 100644 --- a/classes/qt4e.bbclass +++ b/classes/qt4e.bbclass @@ -2,15 +2,16 @@ DEPENDS_prepend = "${@["qt4-embedded ", ""][(bb.data.getVar('PN', d, 1) == 'qt4- inherit qmake2 QT_DIR_NAME = "qtopia" +QT_LIBINFIX = "E" # override variables set by qmake-base to compile Qt/Embedded apps # -export QMAKESPEC = "${STAGING_DATADIR}/qtopia/mkspecs/${TARGET_OS}-oe-g++" -export OE_QMAKE_INCDIR_QT = "${STAGING_INCDIR}/qtopia" +export QMAKESPEC = "${STAGING_DATADIR}/${QT_DIR_NAME}/mkspecs/${TARGET_OS}-oe-g++" +export OE_QMAKE_INCDIR_QT = "${STAGING_INCDIR}/${QT_DIR_NAME}" export OE_QMAKE_LIBDIR_QT = "${STAGING_LIBDIR}" export OE_QMAKE_LIBS_QT = "qt" export OE_QMAKE_LIBS_X11 = "" export OE_QMAKE_EXTRA_MODULES = "network" -EXTRA_QMAKEVARS_PRE += " QT_LIBINFIX=E " +EXTRA_QMAKEVARS_PRE += " QT_LIBINFIX=${QT_LIBINFIX} " # Qt4 uses atomic instructions not supported in thumb mode ARM_INSTRUCTION_SET = "arm" diff --git a/classes/recipe_sanity.bbclass b/classes/recipe_sanity.bbclass new file mode 100644 index 0000000000..29f4a8fada --- /dev/null +++ b/classes/recipe_sanity.bbclass @@ -0,0 +1,188 @@ +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 + + for var in d.getVar("__recipe_sanity_badtargetvars", 1).split(): + val = d.getVar(var, 0) + if val and val != cfgdata.get(var): + __note("%s should not be set, but is set to '%s'" % (var, val), d) + +__recipe_sanity_reqvars = "DESCRIPTION" +__recipe_sanity_reqdiffvars = "LICENSE" +def req_vars(cfgdata, d): + for var in d.getVar("__recipe_sanity_reqvars", 1).split(): + if not d.getVar(var, 0): + __note("%s should be set" % var, d) + + for var in d.getVar("__recipe_sanity_reqdiffvars", 1).split(): + val = d.getVar(var, 0) + cfgval = cfgdata.get(var) + + # Hardcoding is bad, but I'm lazy. We don't care about license being + # unset if the recipe has no sources! + if var == "LICENSE" and d.getVar("SRC_URI", 1) == cfgdata.get("SRC_URI"): + continue + + if not val: + __note("%s should be set" % var, d) + elif val == cfgval: + __note("%s should be defined to something other than default (%s)" % (var, cfgval), d) + +def var_renames_overwrite(cfgdata, d): + renames = d.getVar("__recipe_sanity_renames", 0) + if renames: + for (key, newkey, oldvalue, newvalue) in renames: + if oldvalue != newvalue and oldvalue != cfgdata.get(newkey): + __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 + + for i in ["autoreconf"] + ["%s_do_configure" % cls for cls in ["gnome", "e", "autotools", "autotools_stage", "efl", "gpephone", "openmoko", "openmoko2", "xfce", "xlibs"]]: + if cfg.find(i) != -1: + return False + + import os + for clsfile in d.getVar("__inherit_cache", 0): + (base, _) = os.path.splitext(os.path.basename(clsfile)) + if cfg.find("%s_do_configure" % base) != -1: + __note("autotools_base usage needs verification, spotted %s_do_configure" % base, 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) + unexpanded = d.getVar("FILESPATH", 0) + filespath = d.getVar("FILESPATH", 1).split(":") + filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)] + for fp in filespath: + if not fp in expectedpaths: + # __note("Path %s in FILESPATH not in the expected paths %s" % + # (fp, expectedpaths), d) + return False + 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) + if unexpanded is None: + return False + + expanded = os.path.normpath(d.getVar("FILESDIR", 1)) + filespath = d.getVar("FILESPATH", 1).split(":") + filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)] + + return unexpanded != expected and \ + os.path.exists(expanded) and \ + (expanded in filespath or + 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: + unexpanded = d.getVar(k, 0) + cfgunexpanded = cfgdata.get(k) + if not cfgunexpanded: + continue + + try: + expanded = d.getVar(k, 1) + cfgexpanded = bb.data.expand(cfgunexpanded, d) + except bb.fetch.ParameterError: + continue + + if unexpanded != cfgunexpanded and \ + cfgexpanded == expanded: + __note("candidate for removal of %s" % k, d) + bb.debug(1, "%s: recipe_sanity: cfg's '%s' and d's '%s' both expand to %s" % + (p, cfgunexpanded, unexpanded, expanded)) + +python do_recipe_sanity () { + p = d.getVar("P", 1) + p = "%s %s %s" % (d.getVar("PN", 1), d.getVar("PV", 1), d.getVar("PR", 1)) + + sanitychecks = [ + (can_remove_FILESDIR, "candidate for removal of FILESDIR"), + (can_remove_FILESPATH, "candidate for removal of FILESPATH"), + #(can_use_autotools_base, "candidate for use of autotools_base"), + (incorrect_nonempty_PACKAGES, "native or cross recipe with non-empty PACKAGES"), + ] + cfgdata = d.getVar("__recipe_sanity_cfgdata", 0) + + for (func, msg) in sanitychecks: + if func(cfgdata, d): + __note(msg, d) + + can_remove_others(p, cfgdata, d) + var_renames_overwrite(cfgdata, d) + req_vars(cfgdata, d) + bad_target_vars(cfgdata, d) +} +do_recipe_sanity[nostamp] = "1" +#do_recipe_sanity[recrdeptask] = "do_recipe_sanity" +addtask recipe_sanity + +do_recipe_sanity_all[nostamp] = "1" +do_recipe_sanity_all[recrdeptask] = "do_recipe_sanity" +do_recipe_sanity_all () { + : +} +addtask recipe_sanity_all after do_recipe_sanity + +python recipe_sanity_eh () { + from bb.event import getName + + if getName(e) != "ConfigParsed": + return NotHandled + + d = e.data + + cfgdata = {} + for k in d.keys(): + #for k in ["S", "PR", "PV", "PN", "DESCRIPTION", "LICENSE", "DEPENDS", + # "SECTION"]: + cfgdata[k] = d.getVar(k, 0) + + d.setVar("__recipe_sanity_cfgdata", cfgdata) + #d.setVar("__recipe_sanity_cfgdata", d) + + # Sick, very sick.. + from bb.data_smart import DataSmart + old = DataSmart.renameVar + def myrename(self, key, newkey): + oldvalue = self.getVar(newkey, 0) + old(self, key, newkey) + newvalue = self.getVar(newkey, 0) + if oldvalue: + renames = self.getVar("__recipe_sanity_renames", 0) or set() + renames.add((key, newkey, oldvalue, newvalue)) + self.setVar("__recipe_sanity_renames", renames) + DataSmart.renameVar = myrename +} +addhandler recipe_sanity_eh diff --git a/classes/rootfs_deb.bbclass b/classes/rootfs_deb.bbclass index 82220661f3..dc2b2cb02c 100644 --- a/classes/rootfs_deb.bbclass +++ b/classes/rootfs_deb.bbclass @@ -44,6 +44,8 @@ fakeroot rootfs_deb_do_rootfs () { cat "${STAGING_ETCDIR_NATIVE}/apt/apt.conf.sample" \ | sed -e 's#Architecture ".*";#Architecture "${DPKG_ARCH}";#' \ + | sed -e 's#status ".*";#status "${IMAGE_ROOTFS}/var/dpkg/status";#' \ + | sed -e 's#DPkg::Options {".*"};#DPkg::Options {"--root=${IMAGE_ROOTFS}";"--admindir=${IMAGE_ROOTFS}/var/dpkg";"--force-all";"--no-debsig"};#' \ > "${STAGING_ETCDIR_NATIVE}/apt/apt-rootfs.conf" export APT_CONFIG="${STAGING_ETCDIR_NATIVE}/apt/apt-rootfs.conf" diff --git a/classes/rootfs_ipk.bbclass b/classes/rootfs_ipk.bbclass index f5714bd1a3..16dd511fcb 100644 --- a/classes/rootfs_ipk.bbclass +++ b/classes/rootfs_ipk.bbclass @@ -5,8 +5,7 @@ # See image.bbclass for a usage of this. # -do_rootfs[depends] += "opkg-native:do_populate_staging ipkg-utils-native:do_populate_staging" -do_rootfs[recrdeptask] += "do_package_write_ipk" +do_rootfs[depends] += "opkg-native:do_populate_staging" IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} ${@base_conditional("PACKAGE_INSTALL_NO_DEPS", "1", "-nodeps", "", d)}" @@ -29,7 +28,6 @@ PACKAGE_INSTALL_append = " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "non fakeroot rootfs_ipk_do_rootfs () { set -x - package_update_index_ipk package_generate_ipkg_conf mkdir -p ${T} @@ -64,9 +62,8 @@ fakeroot rootfs_ipk_do_rootfs () { export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} export OPKG_OFFLINE_ROOT=${IPKG_OFFLINE_ROOT} - mkdir -p ${IMAGE_ROOTFS}${sysconfdir}/opkg/ - if [ "${ONLINE_PACKAGE_MANAGEMENT}" != "none" ]; then + mkdir -p ${IMAGE_ROOTFS}${sysconfdir}/opkg/ grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}${sysconfdir}/opkg/arch.conf fi @@ -97,6 +94,7 @@ fakeroot rootfs_ipk_do_rootfs () { ln -s opkg ${IMAGE_ROOTFS}${libdir}/ipkg else rm -rf ${IMAGE_ROOTFS}${libdir}/opkg + rm -rf ${IMAGE_ROOTFS}/usr/lib/opkg fi ${ROOTFS_POSTPROCESS_COMMAND} @@ -109,7 +107,8 @@ rootfs_ipk_log_check() { lf_path="$2" lf_txt="`cat $lf_path`" - for keyword_die in "Cannot find package" "exit 1" ERR Fail + for keyword_die in "Cannot find package" "Cannot satisfy the following dependencies" \ + "exit 1" ERR Fail do if (echo "$lf_txt" | grep -v log_check | grep -w "$keyword_die") >/dev/null 2>&1 then diff --git a/classes/seppuku.bbclass b/classes/seppuku.bbclass index ab8096eb45..546738dde8 100644 --- a/classes/seppuku.bbclass +++ b/classes/seppuku.bbclass @@ -319,6 +319,12 @@ python seppuku_eventhandler() { passw = bb.data.getVar("SEPPUKU_PASS", data, True) product = bb.data.getVar("SEPPUKU_PRODUCT", data, True) component = bb.data.getVar("SEPPUKU_COMPONENT", data, True) + proxy = bb.data.getVar('HTTP_PROXY', data, True ) + if (proxy): + phl = urllib2.ProxyHandler({'http' : proxy}) + poster.add_handler(phl) + opener.add_handler(phl) + # evil hack to figure out what is going on debug_file = open(os.path.join(bb.data.getVar("TMPDIR", data, True),"..","seppuku-log"),"a") diff --git a/classes/siteinfo.bbclass b/classes/siteinfo.bbclass index 0221b123f1..e51d7ab8a6 100644 --- a/classes/siteinfo.bbclass +++ b/classes/siteinfo.bbclass @@ -32,7 +32,7 @@ def get_siteinfo_list(d): "arm-linux-uclibc": "endian-little bit-32 common-linux common-uclibc arm-common",\ "arm-linux-uclibcgnueabi": "endian-little bit-32 common-linux common-uclibc arm-common arm-linux-uclibc",\ "avr32-linux-uclibc": "endian-big bit-32 common-linux common-uclibc avr32-common",\ - "bfin-uclinux-uclibc": "endian-little bit-32 common-uclibc bfin-common",\ + "bfin-uclinux-uclibc": "endian-little bit-32 common-uclibc bfin-common",\ "i386-linux": "endian-little bit-32 common-linux common-glibc ix86-common",\ "i486-linux": "endian-little bit-32 common-linux common-glibc ix86-common",\ "i586-linux": "endian-little bit-32 common-linux common-glibc ix86-common",\ @@ -64,6 +64,7 @@ def get_siteinfo_list(d): "sh4-linux": "endian-little bit-32 common-linux common-glibc sh-common",\ "sh4-linux-uclibc": "endian-little bit-32 common-linux common-uclibc sh-common",\ "sparc-linux": "endian-big bit-32 common-linux common-glibc",\ + "viac3-linux": "endian-little bit-32 common-linux common-glibc ix86-common",\ "x86_64-linux": "endian-little bit-64 common-linux common-glibc",\ "x86_64-linux-uclibc": "endian-little bit-64 common-linux common-uclibc"} if target in targetinfo: diff --git a/classes/task.bbclass b/classes/task.bbclass index 4edd704829..f3287ebf73 100644 --- a/classes/task.bbclass +++ b/classes/task.bbclass @@ -17,6 +17,7 @@ PACKAGE_ARCH = "all" # to the list. Their dependencies (RRECOMMENDS) are handled as usual # by package_depchains in a following step. python () { + import bb packages = bb.data.getVar('PACKAGES', d, 1).split() genpackages = [] for pkg in packages: diff --git a/classes/tinderclient.bbclass b/classes/tinderclient.bbclass index 0b7fc1d843..d2b2b33898 100644 --- a/classes/tinderclient.bbclass +++ b/classes/tinderclient.bbclass @@ -1,10 +1,20 @@ -def tinder_http_post(server, selector, content_type, body): +def tinder_http_post(d, server, selector, content_type, body): import httplib + from bb import data # now post it for i in range(0,5): try: - h = httplib.HTTP(server) - h.putrequest('POST', selector) + proxy = data.getVar('HTTP_PROXY', d, True ) + if (proxy): + if (proxy.endswith('/')): + proxy = proxy[:-1] + if (proxy.startswit |
