From 0301a8d727c9764c2e9a2480d3c8da7807803913 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Fri, 28 Jul 2006 08:07:58 +0000 Subject: base.bbclass: bugfix in oe_unpack_file * Fix an issue with file:// urls in SRC_URI which reside in WORKDIR. With this issue fixed, patches within tarballs can be successfully applied to ${S}. --- classes/base.bbclass | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 49d6260090..85756edacd 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -398,8 +398,15 @@ def oe_unpack_file(file, data, url = None): destdir = "." bb.mkdirhier("%s/%s" % (os.getcwd(), destdir)) cmd = 'cp %s %s/%s/' % (file, os.getcwd(), destdir) + if not cmd: return True + + dest = os.path.join(os.getcwd(), os.path.basename(file)) + if os.path.exists(dest): + if os.path.samefile(file, dest): + return True + cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, 1), cmd) bb.note("Unpacking %s to %s/" % (file, os.getcwd())) ret = os.system(cmd) -- cgit v1.2.3 From 15daef232f7177d22b0abe6b3652f0b2f62fd368 Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Fri, 28 Jul 2006 11:41:28 +0000 Subject: classes/insane.bbclass: Remove GPL text, add more planned checks The initial idea was to use the shell magic from ebuild, but I do not plan this anymore and will do it using python. This is why I'm removing the GPL license. Add some more planned checks and assume they are already implemented. --- classes/insane.bbclass | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'classes') diff --git a/classes/insane.bbclass b/classes/insane.bbclass index 629d0e82b0..863741aee3 100644 --- a/classes/insane.bbclass +++ b/classes/insane.bbclass @@ -1,24 +1,21 @@ # # BB Class inspired by ebuild.sh # -# As I will be copying code from from ebuild.sh this is -# Copyright Gentoo Foundation 1999-2006 -# GPLv2 -# # This class will test files after installation for certain # security issues and other kind of issues. # # Checks we do: # -Check the ownership and permissions # -Check the RUNTIME path for the $TMPDIR +# -Check if .la files wrongly point to workdir +# -Check if .pc files wrongly point to workdir +# -Check if packages contains .dbg or .so files where they should be in -dev or -dbg # -# Checks that are planned: -# -Check installed and stages .la files # # We need to have the scanelf utility as soon as -# possible. +# possible and this is contained within the pax-utils-native # # We play a special package function -- cgit v1.2.3 From 728ab18f8aed809dbf0652feacc9d9540038c79f Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Fri, 28 Jul 2006 13:50:43 +0000 Subject: classes/package.bbclass: Only set PACKAGEFUNCS once! Set PACKAGEFUNCS only once. Now if more than one bbclass inherits package both additional functions will be executed. The new packagefuncs will be appended to the list and the old ones will not be lost --- classes/package.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/package.bbclass b/classes/package.bbclass index eb3a0349cb..39e6a06b41 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -723,7 +723,7 @@ python package_do_split_locales() { bb.data.setVar('RDEPENDS_%s' % mainpkg, ' '.join(rdep), d) } -PACKAGEFUNCS = "do_install package_do_split_locales \ +PACKAGEFUNCS ?= " do_install package_do_split_locales \ populate_packages package_do_shlibs \ package_do_pkgconfig read_shlibdeps" python package_do_package () { -- cgit v1.2.3 From 3b822750043671741665751ff3f28ba2f98a136e Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Fri, 28 Jul 2006 13:52:44 +0000 Subject: classes/insane.bbclass: Add skeleton for the tests Run each test from within the PACKAGEFUNC, add a special task for checking .la and .pc files from within staging. --- classes/insane.bbclass | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'classes') diff --git a/classes/insane.bbclass b/classes/insane.bbclass index 863741aee3..395f124572 100644 --- a/classes/insane.bbclass +++ b/classes/insane.bbclass @@ -23,7 +23,40 @@ inherit package PACKAGE_DEPENDS += "pax-utils-native" PACKAGEFUNCS += " do_package_qa " +def package_qa_check_rpath(path): + pass + +def package_qa_check_devdbg(path, name): + pass + +def package_qa_check_perm(path): + pass + +def package_qa_check_staged(path): + pass + + +# The PACKAGE FUNC to scan each package python do_package_qa () { + bb.note("DO PACKAGE QA") + workdir = bb.data.getVar('WORKDIR', d, True) + packages = bb.data.getVar('PACKAGES',d, True) + + # no packages should be scanned + if not packages: + return + + for package in packages.split(): + bb.note("Package: %s" % package) + path = "%s/install/%s" % (workdir, package) + package_qa_check_rpath(path) + package_qa_check_devdbg(path,package) + package_qa_check_perm(path) } +# The Staging Func, to check all staging +addtask qa_staging after do_populate_staging before do_build +python do_qa_staging() { + bb.note("Staged!") +} -- cgit v1.2.3 From ab200f3815379c7d4f7e790e5b60c02d6fdf866f Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 31 Jul 2006 09:57:55 +0000 Subject: Change -dbg objects to use .debug directory. Fixes various FILES issues. --- classes/package.bbclass | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/package.bbclass b/classes/package.bbclass index 39e6a06b41..2791e4bcfa 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -177,10 +177,12 @@ runstrip() { ro=1 chmod +w "$1" } - '${OBJCOPY}' --only-keep-debug "$1" "$1.dbg" + mkdir $(dirname "$1")/.debug + debugfile="$(dirname "$1")/.debug/$(basename "$1")" + '${OBJCOPY}' --only-keep-debug "$1" "$debugfile" '${STRIP}' "$1" st=$? - '${OBJCOPY}' --add-gnu-debuglink="$1.dbg" "$1" + '${OBJCOPY}' --add-gnu-debuglink="$debugfile" "$1" test -n "$ro" && chmod -w "$1" if test $st -ne 0 then -- cgit v1.2.3