summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/sstatesig.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-20 15:50:59 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-23 09:01:39 +0000
commit85cf3ed593e1f095c44717aee745afdba6dad68c (patch)
treea21c7c1431f3ba38c0f285652d9b9cff4c7e2369 /meta/lib/oe/sstatesig.py
parentb454cb73660beadebb174183dbd0a31fcd2006ba (diff)
downloadpoky-85cf3ed593e1f095c44717aee745afdba6dad68c.tar.gz
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. (From OE-Core rev: cb73cf4299a192e6065d567fae700987c3f937aa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/sstatesig.py')
-rw-r--r--meta/lib/oe/sstatesig.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
new file mode 100644
index 0000000000..247f59261b
--- /dev/null
+++ b/meta/lib/oe/sstatesig.py
@@ -0,0 +1,48 @@
1import bb.siggen
2
3def sstate_rundepfilter(fn, recipename, task, dep, depname):
4 # Return True if we should keep the dependency, False to drop it
5 def isNative(x):
6 return x.endswith("-native")
7 def isCross(x):
8 return x.endswith("-cross") or x.endswith("-cross-initial") or x.endswith("-cross-intermediate")
9 def isNativeSDK(x):
10 return x.endswith("-nativesdk")
11
12 # Always include our own inter-task dependencies
13 if recipename == depname:
14 return True
15
16 # Quilt (patch application) changing isn't likely to affect anything
17 if depname == "quilt-native":
18 return False
19 # Don't change native/cross/nativesdk recipe dependencies any further
20 if isNative(recipename) or isCross(recipename) or isNativeSDK(recipename):
21 return True
22
23 # Only target packages beyond here
24
25 # Drop native/cross/nativesdk dependencies from target recipes
26 if isNative(depname) or isCross(depname) or isNativeSDK(depname):
27 return False
28
29 # Default to keep dependencies
30 return True
31
32class SignatureGeneratorOEBasic(bb.siggen.SignatureGeneratorBasic):
33 name = "OEBasic"
34 def init_rundepcheck(self, data):
35 pass
36 def rundep_check(self, fn, recipename, task, dep, depname):
37 return sstate_rundepfilter(fn, recipename, task, dep, depname)
38
39class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
40 name = "OEBasicHash"
41 def init_rundepcheck(self, data):
42 pass
43 def rundep_check(self, fn, recipename, task, dep, depname):
44 return sstate_rundepfilter(fn, recipename, task, dep, depname)
45
46# Insert these classes into siggen's namespace so it can see and select them
47bb.siggen.SignatureGeneratorOEBasic = SignatureGeneratorOEBasic
48bb.siggen.SignatureGeneratorOEBasicHash = SignatureGeneratorOEBasicHash