diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-01-20 15:50:59 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-01-23 09:00:24 +0000 |
commit | cb73cf4299a192e6065d567fae700987c3f937aa (patch) | |
tree | 6b4c5f1fd011c177b8e269644e22d661b35a4453 /meta | |
parent | 383b1ef37c1c6f6b1be043ac61e338d75488c9a3 (diff) | |
download | openembedded-core-cb73cf4299a192e6065d567fae700987c3f937aa.tar.gz openembedded-core-cb73cf4299a192e6065d567fae700987c3f937aa.tar.bz2 openembedded-core-cb73cf4299a192e6065d567fae700987c3f937aa.tar.xz openembedded-core-cb73cf4299a192e6065d567fae700987c3f937aa.zip |
lib/oe: Add sstatesig, OE specific signature generator classes
This patch adds SignatureGenerator classes specific to OE. For now,
these emulate the previous behaviour with the exception that
dependencies on quilt-native are now ignored for checksum purposes.
The intent is to allow easier experimentation and customisation of
this code in future as a result of these changes.
Note that these changes require pending bitbake patches.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/base.bbclass | 2 | ||||
-rw-r--r-- | meta/lib/oe/sstatesig.py | 48 |
2 files changed, 49 insertions, 1 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 091e965c1..bedb73b16 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -9,7 +9,7 @@ inherit utility-tasks inherit metadata_scm inherit logging -OE_IMPORTS += "os sys time oe.path oe.utils oe.data oe.packagegroup" +OE_IMPORTS += "os sys time oe.path oe.utils oe.data oe.packagegroup oe.sstatesig" OE_IMPORTS[type] = "list" def oe_import(d): diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py new file mode 100644 index 000000000..247f59261 --- /dev/null +++ b/meta/lib/oe/sstatesig.py @@ -0,0 +1,48 @@ +import bb.siggen + +def sstate_rundepfilter(fn, recipename, task, dep, depname): + # Return True if we should keep the dependency, False to drop it + def isNative(x): + return x.endswith("-native") + def isCross(x): + return x.endswith("-cross") or x.endswith("-cross-initial") or x.endswith("-cross-intermediate") + def isNativeSDK(x): + return x.endswith("-nativesdk") + + # Always include our own inter-task dependencies + if recipename == depname: + return True + + # Quilt (patch application) changing isn't likely to affect anything + if depname == "quilt-native": + return False + # Don't change native/cross/nativesdk recipe dependencies any further + if isNative(recipename) or isCross(recipename) or isNativeSDK(recipename): + return True + + # Only target packages beyond here + + # Drop native/cross/nativesdk dependencies from target recipes + if isNative(depname) or isCross(depname) or isNativeSDK(depname): + return False + + # Default to keep dependencies + return True + +class SignatureGeneratorOEBasic(bb.siggen.SignatureGeneratorBasic): + name = "OEBasic" + def init_rundepcheck(self, data): + pass + def rundep_check(self, fn, recipename, task, dep, depname): + return sstate_rundepfilter(fn, recipename, task, dep, depname) + +class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash): + name = "OEBasicHash" + def init_rundepcheck(self, data): + pass + def rundep_check(self, fn, recipename, task, dep, depname): + return sstate_rundepfilter(fn, recipename, task, dep, depname) + +# Insert these classes into siggen's namespace so it can see and select them +bb.siggen.SignatureGeneratorOEBasic = SignatureGeneratorOEBasic +bb.siggen.SignatureGeneratorOEBasicHash = SignatureGeneratorOEBasicHash |