summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-07 12:06:53 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-07 12:41:38 +0000
commit73265d10da4be35cf4f8e5f5f7f040c5d7e6eda4 (patch)
tree9b3cbecdd70f2cdce33b47a13608398384ae9987 /meta
parent4feb00df18c4fdd05f3f0499aef8055641200d4c (diff)
downloadpoky-73265d10da4be35cf4f8e5f5f7f040c5d7e6eda4.tar.gz
uninative: Refactor common code
Move duplicate code into a common function (From OE-Core rev: 1a6b39ccd55e6b26f9eb4e05089b8b97396d53d5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/uninative.bbclass8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass
index 0a27ec41a7..01fcbc10ca 100644
--- a/meta/classes/uninative.bbclass
+++ b/meta/classes/uninative.bbclass
@@ -63,9 +63,7 @@ python uninative_event_fetchloader() {
63 cmd = d.expand("mkdir -p ${STAGING_DIR}-uninative; cd ${STAGING_DIR}-uninative; tar -xjf ${UNINATIVE_DLDIR}/${UNINATIVE_TARBALL}; ${STAGING_DIR}-uninative/relocate_sdk.py ${STAGING_DIR}-uninative/${BUILD_ARCH}-linux ${UNINATIVE_LOADER} ${UNINATIVE_LOADER} ${STAGING_DIR}-uninative/${BUILD_ARCH}-linux/${bindir_native}/patchelf-uninative") 63 cmd = d.expand("mkdir -p ${STAGING_DIR}-uninative; cd ${STAGING_DIR}-uninative; tar -xjf ${UNINATIVE_DLDIR}/${UNINATIVE_TARBALL}; ${STAGING_DIR}-uninative/relocate_sdk.py ${STAGING_DIR}-uninative/${BUILD_ARCH}-linux ${UNINATIVE_LOADER} ${UNINATIVE_LOADER} ${STAGING_DIR}-uninative/${BUILD_ARCH}-linux/${bindir_native}/patchelf-uninative")
64 subprocess.check_call(cmd, shell=True) 64 subprocess.check_call(cmd, shell=True)
65 65
66 d.setVar("NATIVELSBSTRING", "universal") 66 enable_uninative(d)
67 d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp")
68 d.prependVar("PATH", "${STAGING_DIR}-uninative/${BUILD_ARCH}-linux${bindir_native}:")
69 67
70 except bb.fetch2.BBFetchException as exc: 68 except bb.fetch2.BBFetchException as exc:
71 bb.warn("Disabling uninative as unable to fetch uninative tarball: %s" % str(exc)) 69 bb.warn("Disabling uninative as unable to fetch uninative tarball: %s" % str(exc))
@@ -82,14 +80,16 @@ python uninative_event_enable() {
82 This event handler is called in the workers and is responsible for setting 80 This event handler is called in the workers and is responsible for setting
83 up uninative if a loader is found. 81 up uninative if a loader is found.
84 """ 82 """
83 enable_uninative(d)
84}
85 85
86def enable_uninative(d):
86 loader = d.getVar("UNINATIVE_LOADER", True) 87 loader = d.getVar("UNINATIVE_LOADER", True)
87 if os.path.exists(loader): 88 if os.path.exists(loader):
88 bb.debug(2, "Enabling uninative") 89 bb.debug(2, "Enabling uninative")
89 d.setVar("NATIVELSBSTRING", "universal") 90 d.setVar("NATIVELSBSTRING", "universal")
90 d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp") 91 d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp")
91 d.prependVar("PATH", "${STAGING_DIR}-uninative/${BUILD_ARCH}-linux${bindir_native}:") 92 d.prependVar("PATH", "${STAGING_DIR}-uninative/${BUILD_ARCH}-linux${bindir_native}:")
92}
93 93
94python uninative_changeinterp () { 94python uninative_changeinterp () {
95 import subprocess 95 import subprocess