summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorKristoffer Ericson <kristoffer_e1@hotmail.com>2006-07-31 15:36:05 +0000
committerKristoffer Ericson <kristoffer_e1@hotmail.com>2006-07-31 15:36:05 +0000
commitcc67256da139ba348bfc5e98138da3d7e84c7f48 (patch)
treea88692987440c7a78c27dfc5ff1aa3cf01223da1 /classes
parent5e5b590002af02b51b7e39ddb3a18357ce1954c6 (diff)
parent09436056f94e7103d436177bdaea7c3bd9493913 (diff)
merge of 158d7fcc3d3ef86d360c775f912e5e314992018d
and bbd3a2811e13a3b99224c1a846af2a244d292c41
Diffstat (limited to 'classes')
-rw-r--r--classes/base.bbclass7
-rw-r--r--classes/insane.bbclass44
-rw-r--r--classes/package.bbclass8
3 files changed, 49 insertions, 10 deletions
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)
diff --git a/classes/insane.bbclass b/classes/insane.bbclass
index 629d0e82b0..395f124572 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
@@ -26,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!")
+}
diff --git a/classes/package.bbclass b/classes/package.bbclass
index eb3a0349cb..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
@@ -723,7 +725,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 () {