From 5f4deee606d344af8e8aa7f0b3e07f64e7574b6c Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 26 Feb 2008 17:53:29 +0000 Subject: seppuku.bbclass/tinderclient.bbclass: Use exec_func, not exec_task for clean function --- classes/seppuku.bbclass | 2 +- classes/tinderclient.bbclass | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/seppuku.bbclass b/classes/seppuku.bbclass index 834bee34b4..2e097a812e 100644 --- a/classes/seppuku.bbclass +++ b/classes/seppuku.bbclass @@ -303,7 +303,7 @@ python seppuku_eventhandler() { if name == "PkgFailed": if not bb.data.getVar('SEPPUKU_AUTOBUILD', data, True) == "0": - build.exec_task('do_clean', data) + build.exec_func('do_clean', data) elif name == "TaskFailed": cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) diff --git a/classes/tinderclient.bbclass b/classes/tinderclient.bbclass index bc004efb26..0b7fc1d843 100644 --- a/classes/tinderclient.bbclass +++ b/classes/tinderclient.bbclass @@ -328,7 +328,7 @@ def tinder_do_tinder_report(event): log += "<--- TINDERBOX Package %s done (SUCCESS)\n" % data.getVar('PF', event.data, True) elif name == "PkgFailed": if not data.getVar('TINDER_AUTOBUILD', event.data, True) == "0": - build.exec_task('do_clean', event.data) + build.exec_func('do_clean', event.data) log += "<--- TINDERBOX Package %s failed (FAILURE)\n" % data.getVar('PF', event.data, True) status = 200 # remember the failure for the -k case -- cgit v1.2.3 From b9c6764ba5a7f2d439088f42d7d2b82403f2e2b0 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 26 Feb 2008 17:54:55 +0000 Subject: rm_work.bbclass: Add event handler to take care of removing stamps when trying to rebuild packages after sources have been removed. Needs bitbake 1.8 svn to have any effect. --- classes/rm_work.bbclass | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'classes') diff --git a/classes/rm_work.bbclass b/classes/rm_work.bbclass index 4efd39c557..97de5e2774 100644 --- a/classes/rm_work.bbclass +++ b/classes/rm_work.bbclass @@ -25,3 +25,23 @@ do_rm_work_all () { } do_rm_work_all[recrdeptask] = "do_rm_work" addtask rm_work_all after do_rm_work + + +addhandler rmwork_stampfixing_eventhandler +python rmwork_stampfixing_eventhandler() { + from bb.event import getName + import os + + if getName(e) == "StampUpdate": + for (fn, task) in e.targets: + if task == 'rm_work_all': + continue + stamp = "%s.do_rm_work" % e.stampPrefix[fn] + if os.path.exists(stamp): + dir = "%s.*" % e.stampPrefix[fn] + bb.note("Removing stamps: " + dir) + os.system('rm -f '+ dir) + + return NotHandled +} + -- cgit v1.2.3 From 600a590fb7459be81ee6bdb21fbb57dedd44af24 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 26 Feb 2008 17:57:51 +0000 Subject: base.bbclass: Add code to make 'rebuild' continue to work after changes in bitbake. Bitbake 1.8.10 users should be unaffected, bitbake 1.8.11 users will need the latest svn stable branch bitbake. Only the rebuild task is affected by the changes --- classes/base.bbclass | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 2f74104185..089cd5acd3 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -424,13 +424,21 @@ python base_do_clean() { os.system('rm -f '+ dir) } +#Uncomment this for bitbake 1.8.12 +#addtask rebuild after do_${BB_DEFAULT_TASK} addtask rebuild do_rebuild[dirs] = "${TOPDIR}" do_rebuild[nostamp] = "1" python base_do_rebuild() { """rebuild a package""" - bb.build.exec_task('do_clean', d) - bb.build.exec_task('do_' + bb.data.getVar('BB_DEFAULT_TASK', d, 1), d) + from bb import __version__ + try: + from distutils.version import LooseVersion + except ImportError: + def LooseVersion(v): print "WARNING: sanity.bbclass can't compare versions without python-distutils"; return 1 + if (LooseVersion(__version__) < LooseVersion('1.8.11')): + bb.build.exec_func('do_clean', d) + bb.build.exec_task('do_' + bb.data.getVar('BB_DEFAULT_TASK', d, 1), d) } addtask mrproper @@ -442,7 +450,7 @@ python base_do_mrproper() { if dir == '/': bb.build.FuncFailed("wrong DATADIR") bb.debug(2, "removing " + dir) os.system('rm -rf ' + dir) - bb.build.exec_task('do_clean', d) + bb.build.exec_func('do_clean', d) } addtask fetch @@ -663,6 +671,17 @@ python base_eventhandler() { if pesteruser: 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)) + # + # Handle removing stamps for 'rebuild' task + # + if name.startswith("StampUpdate"): + for (fn, task) in e.targets: + #print "%s %s" % (task, fn) + if task == "do_rebuild": + dir = "%s.*" % e.stampPrefix[fn] + bb.note("Removing stamps: " + dir) + os.system('rm -f '+ dir) + if not data in e.__dict__: return NotHandled @@ -900,7 +919,19 @@ def base_after_parse(d): return python () { + import bb + from bb import __version__ base_after_parse(d) + + # Remove this for bitbake 1.8.12 + try: + from distutils.version import LooseVersion + except ImportError: + def LooseVersion(v): print "WARNING: sanity.bbclass can't compare versions without python-distutils"; return 1 + if (LooseVersion(__version__) >= LooseVersion('1.8.11')): + deps = bb.data.getVarFlag('do_rebuild', 'deps', d) or [] + deps.append('do_' + bb.data.getVar('BB_DEFAULT_TASK', d, 1)) + bb.data.setVarFlag('do_rebuild', 'deps', deps, d) } def check_app_exists(app, d): -- cgit v1.2.3 From cce74cd0f9a4c0cfd1ffd8170e58d645d635bc7e Mon Sep 17 00:00:00 2001 From: Michael Lauer Date: Thu, 28 Feb 2008 11:33:09 +0000 Subject: distutils-base.bbclass: package ${PN}-dev first, so that pkgconfig gets a chance to land there --- classes/distutils-base.bbclass | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'classes') diff --git a/classes/distutils-base.bbclass b/classes/distutils-base.bbclass index 5150be76b9..c4551ace83 100644 --- a/classes/distutils-base.bbclass +++ b/classes/distutils-base.bbclass @@ -11,8 +11,17 @@ def python_dir(d): raise "No Python in STAGING_INCDIR. Forgot to build python-native ?" PYTHON_DIR = "${@python_dir(d)}" + +PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc ${PN}" + FILES_${PN} = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*" -FILES_${PN}-dbg = "${libdir}/${PYTHON_DIR}/site-packages/.debug \ - ${libdir}/${PYTHON_DIR}/site-packages/*/.debug \ - ${libdir}/${PYTHON_DIR}/site-packages/*/*/.debug" +FILES_${PN}-dev += "\ + ${libdir}/pkgconfig \ + ${libdir}/${PYTHON_DIR}/site-packages/*.la \ +" +FILES_${PN}-dbg = "\ + ${libdir}/${PYTHON_DIR}/site-packages/.debug \ + ${libdir}/${PYTHON_DIR}/site-packages/*/.debug \ + ${libdir}/${PYTHON_DIR}/site-packages/*/*/.debug \ +" -- cgit v1.2.3 From acf313c21359e68fcba042d80ea0e0353aae7b92 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 28 Feb 2008 11:45:52 +0000 Subject: sip(3).bbclass: Fix do_generate task dependencies (#3765) --- classes/sip.bbclass | 2 ++ classes/sip3.bbclass | 2 ++ 2 files changed, 4 insertions(+) (limited to 'classes') diff --git a/classes/sip.bbclass b/classes/sip.bbclass index ae186bd04a..30c08b1ed9 100644 --- a/classes/sip.bbclass +++ b/classes/sip.bbclass @@ -55,6 +55,8 @@ sip_do_generate() { done } +do_generate[deptask] = "do_populate_staging" + EXPORT_FUNCTIONS do_generate addtask generate after do_unpack do_patch before do_configure diff --git a/classes/sip3.bbclass b/classes/sip3.bbclass index 1dd42ba86b..7ecc63bf02 100644 --- a/classes/sip3.bbclass +++ b/classes/sip3.bbclass @@ -53,6 +53,8 @@ sip3_do_generate() { done } +do_generate[deptask] = "do_populate_staging" + EXPORT_FUNCTIONS do_generate addtask generate after do_unpack do_patch before do_configure -- cgit v1.2.3 From 70d0879a2267b4f02025ff0f323c3659fa81d68d Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 28 Feb 2008 11:54:41 +0000 Subject: mono.bclass: Fix the location used for mono clilibs information to be host specific otherwise this will break when multiple arch builds are made. shlibs was fixed in a similar way. Note that mono apps will need to be rebuilt after this change --- classes/mono.bbclass | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'classes') diff --git a/classes/mono.bbclass b/classes/mono.bbclass index ccb16d9acc..cf8dd15bdf 100644 --- a/classes/mono.bbclass +++ b/classes/mono.bbclass @@ -52,6 +52,8 @@ def mono_find_provides_and_requires(files, d): requires = [e for e in requires if not e in provides] return provides, requires +CLILIBSDIR = "${STAGING_DIR_HOST}/clilibs" + python mono_do_clilibs() { import bb, os, re, os.path @@ -70,14 +72,9 @@ python mono_do_clilibs() { bb.error("WORKDIR not defined") return - staging = bb.data.getVar('STAGING_DIR', d, 1) - if not staging: - bb.error("STAGING_DIR not defined") - return - pkgdest = bb.data.getVar('PKGDEST', d, 1) - clilibs_dir = os.path.join(staging, "clilibs") + clilibs_dir = bb.data.getVar('CLILIBSDIR', d, 1) bb.mkdirhier(clilibs_dir) provides, requires = {}, {} -- cgit v1.2.3 From 410a115fbb75f0b715399d927f1d67b5c512fdf8 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 28 Feb 2008 12:03:50 +0000 Subject: classes: Improve various staging variable references --- classes/package.bbclass | 2 +- classes/package_ipk.bbclass | 4 ++++ classes/qt3e.bbclass | 4 ++-- classes/qt3x11.bbclass | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'classes') diff --git a/classes/package.bbclass b/classes/package.bbclass index cb4417fc7f..325c0b52f5 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -519,7 +519,7 @@ if [ x"$D" = "x" ]; then fi } -SHLIBSDIR = "${STAGING_DIR}/${HOST_SYS}/shlibs" +SHLIBSDIR = "${STAGING_DIR_HOST}/shlibs" python package_do_shlibs() { import os, re, os.path diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass index de7f0fe0c4..2feaeba3b3 100644 --- a/classes/package_ipk.bbclass +++ b/classes/package_ipk.bbclass @@ -12,6 +12,10 @@ python package_ipk_fn () { } python package_ipk_install () { + # + # Warning - this function is not multimachine safe (see stagingdir reference)! + # + import os, sys pkg = bb.data.getVar('PKG', d, 1) pkgfn = bb.data.getVar('PKGFN', d, 1) diff --git a/classes/qt3e.bbclass b/classes/qt3e.bbclass index 98c47adb90..35958b34ab 100644 --- a/classes/qt3e.bbclass +++ b/classes/qt3e.bbclass @@ -1,8 +1,8 @@ # # override variables set by qmake_base to compile Qt/X11 apps # -export QTDIR="${STAGING_DIR}/${HOST_SYS}/qte3" -export QTEDIR="${STAGING_DIR}/${HOST_SYS}/qte3" +export QTDIR="${STAGING_DIR_HOST}/qte3" +export QTEDIR="${STAGING_DIR_HOST}/qte3" export OE_QMAKE_UIC="${STAGING_BINDIR_NATIVE}/uic3" export OE_QMAKE_MOC="${STAGING_BINDIR_NATIVE}/moc3" export OE_QMAKE_CXXFLAGS="${CXXFLAGS} " diff --git a/classes/qt3x11.bbclass b/classes/qt3x11.bbclass index 67f2cf7348..5408b7f342 100644 --- a/classes/qt3x11.bbclass +++ b/classes/qt3x11.bbclass @@ -3,7 +3,7 @@ EXTRA_QMAKEVARS_POST += "CONFIG+=thread" # # override variables set by qmake_base to compile Qt/X11 apps # -export QTDIR = "${STAGING_DIR}/${HOST_SYS}/qt3" +export QTDIR = "${STAGING_DIR_HOST}/qt3" export OE_QMAKE_UIC = "${STAGING_BINDIR_NATIVE}/uic3" export OE_QMAKE_MOC = "${STAGING_BINDIR_NATIVE}/moc3" export OE_QMAKE_CXXFLAGS = "${CXXFLAGS} -DQT_NO_XIM" -- cgit v1.2.3 From 6d4e75963cac25b5b936c3c72f5734634d6fd06a Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 28 Feb 2008 13:21:07 +0000 Subject: distutils.bbclass: Tweak staging variables --- classes/distutils.bbclass | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'classes') diff --git a/classes/distutils.bbclass b/classes/distutils.bbclass index 18aee09a26..fa34565eaf 100644 --- a/classes/distutils.bbclass +++ b/classes/distutils.bbclass @@ -13,16 +13,15 @@ distutils_do_compile() { } distutils_stage_headers() { - install -d ${STAGING_DIR_HOST}${layout_prefix}/lib/${PYTHON_DIR}/site-packages + install -d ${STAGING_DIR_HOST}${layout_libdir}/${PYTHON_DIR}/site-packages BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ ${STAGING_BINDIR_NATIVE}/python setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \ oefatal "python setup.py install_headers execution failed." } distutils_stage_all() { - install -d ${STAGING_DIR_HOST}${layout_prefix}/lib/${PYTHON_DIR}/site-packages - # is this missing a lib below? - PYTHONPATH=${STAGING_DIR_HOST}${layout_prefix}/${PYTHON_DIR}/site-packages \ + install -d ${STAGING_DIR_HOST}${layout_libdir}/${PYTHON_DIR}/site-packages + PYTHONPATH=${STAGING_DIR_HOST}${layout_libdir}/${PYTHON_DIR}/site-packages \ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ ${STAGING_BINDIR_NATIVE}/python setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \ oefatal "python setup.py install (stage) execution failed." -- cgit v1.2.3 From def428fe2497719bd7dd6405df2fe8c5f1f63bca Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 28 Feb 2008 13:29:47 +0000 Subject: rootfs_deb.bbclass: Fix apt.conf handling (from poky) --- classes/rootfs_deb.bbclass | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'classes') diff --git a/classes/rootfs_deb.bbclass b/classes/rootfs_deb.bbclass index c2c4a764e4..5237285e4c 100644 --- a/classes/rootfs_deb.bbclass +++ b/classes/rootfs_deb.bbclass @@ -10,12 +10,8 @@ fakeroot rootfs_deb_do_rootfs () { mkdir -p ${IMAGE_ROOTFS}/var/dpkg/info mkdir -p ${IMAGE_ROOTFS}/var/dpkg/updates - mkdir -p ${STAGING_ETCDIR_NATIVE}/apt/ - rm -f ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev rm -f ${STAGING_ETCDIR_NATIVE}/apt/preferences - > ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev - > ${STAGING_ETCDIR_NATIVE}/apt/preferences > ${IMAGE_ROOTFS}/var/dpkg/status > ${IMAGE_ROOTFS}/var/dpkg/available # > ${STAGING_DIR}/var/dpkg/status @@ -40,9 +36,9 @@ fakeroot rootfs_deb_do_rootfs () { priority=$(expr $priority + 5) done - tac ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev > ${STAGING_DIR}/etc/apt/sources.list + tac ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev > ${STAGING_ETCDIR_NATIVE}/apt/sources.list - cat "${STAGING_DIR}/etc/apt/apt.conf.sample" \ + cat "${STAGING_ETCDIR_NATIVE}/apt/apt.conf.sample" \ | sed -e 's#Architecture ".*";#Architecture "${TARGET_ARCH}";#' \ > "${STAGING_ETCDIR_NATIVE}/apt/apt-rootfs.conf" -- cgit v1.2.3 From ae34dd31f15536b14493dcb91eba0209f3e18bd0 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 28 Feb 2008 13:30:58 +0000 Subject: package_deb.bbclass: Update apt.conf location (from poky) --- classes/package_deb.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/package_deb.bbclass b/classes/package_deb.bbclass index 1a3622c3bb..22b6166685 100644 --- a/classes/package_deb.bbclass +++ b/classes/package_deb.bbclass @@ -28,7 +28,7 @@ python do_package_deb_install () { pkgfn = bb.data.getVar('PKGFN', d, 1) rootfs = bb.data.getVar('IMAGE_ROOTFS', d, 1) debdir = bb.data.getVar('DEPLOY_DIR_DEB', d, 1) - stagingdir = bb.data.getVar('STAGING_DIR', d, 1) + apt_config = bb.data.expand('${STAGING_ETCDIR_NATIVE}/apt/apt.conf', d) stagingbindir = bb.data.getVar('STAGING_BINDIR_NATIVE', d, 1) tmpdir = bb.data.getVar('TMPDIR', d, 1) @@ -55,7 +55,7 @@ python do_package_deb_install () { # Set up environment apt_config_backup = os.getenv('APT_CONFIG') - os.putenv('APT_CONFIG', os.path.join(stagingdir, 'etc', 'apt', 'apt.conf')) + os.putenv('APT_CONFIG', apt_config) path = os.getenv('PATH') os.putenv('PATH', '%s:%s' % (stagingbindir, os.getenv('PATH'))) -- cgit v1.2.3 From 5c76b08ead147c85ee0efb790a5cd87a223d9dd3 Mon Sep 17 00:00:00 2001 From: Leon Woestenberg Date: Sat, 1 Mar 2008 12:07:07 +0000 Subject: base.bbclass: Add .tbz2 besides .tbz and .tar.bz2 --- classes/base.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 089cd5acd3..7609c05851 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -544,7 +544,7 @@ def oe_unpack_file(file, data, url = None): cmd = 'tar x --no-same-owner -f %s' % file elif file.endswith('.tgz') or file.endswith('.tar.gz') or file.endswith('.tar.Z'): cmd = 'tar xz --no-same-owner -f %s' % file - elif file.endswith('.tbz') or file.endswith('.tar.bz2'): + elif file.endswith('.tbz') or file.endswith('.tbz2') or file.endswith('.tar.bz2'): cmd = 'bzip2 -dc %s | tar x --no-same-owner -f -' % file elif file.endswith('.gz') or file.endswith('.Z') or file.endswith('.z'): cmd = 'gzip -dc %s > %s' % (file, efile) -- cgit v1.2.3