[oe-commits] Chris Larson : utils.bbclass: add wrapper script generator

git version control git at git.openembedded.org
Fri Oct 1 17:15:56 UTC 2010


Module: openembedded.git
Branch: master
Commit: 5e4f37694f376c44f2a92b2e8468a485af157310
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=5e4f37694f376c44f2a92b2e8468a485af157310

Author: Chris Larson <chris_larson at mentor.com>
Date:   Fri Oct  1 09:56:20 2010 -0700

utils.bbclass: add wrapper script generator

Signed-off-by: Chris Larson <chris_larson at mentor.com>

---

 classes/utils.bbclass |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/classes/utils.bbclass b/classes/utils.bbclass
index 1c636be..9a9c7b5 100644
--- a/classes/utils.bbclass
+++ b/classes/utils.bbclass
@@ -177,7 +177,7 @@ def base_chk_file_checksum(localpath, src_uri, expected_md5sum, expected_sha256s
     return True
 
 def base_get_checksums(pn, pv, src_uri, localpath, params, data):
-    # Try checksum from recipe and then parse checksums.ini 
+    # Try checksum from recipe and then parse checksums.ini
     # and try PN-PV-SRC_URI first and then try PN-SRC_URI
     # we rely on the get method to create errors
     try:
@@ -228,7 +228,7 @@ def base_get_checksums(pn, pv, src_uri, localpath, params, data):
             expected_sha256sum = parser.get(src_uri, "sha256")
         else:
             return (None,None)
-        
+
         if name:
             bb.note("This package has no checksums in corresponding recipe '%s', please consider moving its checksums from checksums.ini file \
                 \nSRC_URI[%s.md5sum] = \"%s\"\nSRC_URI[%s.sha256sum] = \"%s\"\n" % (bb.data.getVar("FILE", data, True), name, expected_md5sum, name, expected_sha256sum))
@@ -449,6 +449,25 @@ oe_machinstall() {
 	fi
 }
 
+create_wrapper () {
+   # Create a wrapper script
+   #
+   # These are useful to work around relocation issues, by setting environment
+   # variables which point to paths in the filesystem.
+   #
+   # Usage: create_wrapper FILENAME [[VAR=VALUE]..]
+
+   cmd=$1
+   shift
+   mv $cmd $cmd.real
+   cmdname=`basename $cmd`.real
+   cat <<END >$cmd
+#!/bin/sh
+exec env $@ \`dirname \$0\`/$cmdname
+END
+   chmod +x $cmd
+}
+
 def check_app_exists(app, d):
 	from bb import which, data
 





More information about the Openembedded-commits mailing list