public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH 1/2] utils.bbclass: Remove trailing whitespace
@ 2016-09-06 22:11 Henry Bruce
  2016-09-06 22:11 ` [PATCH 2/2] utils.bbclass: Added error checking for oe_soinstall Henry Bruce
  0 siblings, 1 reply; 5+ messages in thread
From: Henry Bruce @ 2016-09-06 22:11 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
---
 meta/classes/utils.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index 59ace44..d56f51e 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -249,7 +249,7 @@ oe_machinstall() {
 create_cmdline_wrapper () {
 	# Create a wrapper script where commandline options are needed
 	#
-	# These are useful to work around relocation issues, by passing extra options 
+	# These are useful to work around relocation issues, by passing extra options
 	# to a program
 	#
 	# Usage: create_cmdline_wrapper FILENAME <extra-options>
@@ -323,7 +323,7 @@ def base_set_filespath(path, d):
     overrides.reverse()
     for o in overrides:
         for p in path:
-            if p != "": 
+            if p != "":
                 filespath.append(os.path.join(p, o))
     return ":".join(filespath)
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] utils.bbclass: Added error checking for oe_soinstall
  2016-09-06 22:11 [PATCH 1/2] utils.bbclass: Remove trailing whitespace Henry Bruce
@ 2016-09-06 22:11 ` Henry Bruce
  2016-09-07 16:27   ` Burton, Ross
  2016-09-07 21:09   ` [PATCH 2/2 v2] " Henry Bruce
  0 siblings, 2 replies; 5+ messages in thread
From: Henry Bruce @ 2016-09-06 22:11 UTC (permalink / raw)
  To: openembedded-core

Fixes [YOCTO #10146]

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
---
 meta/classes/utils.bbclass | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index d56f51e..aa033d5 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -62,15 +62,16 @@ def is_machine_specific(d):
 oe_soinstall() {
 	# Purpose: Install shared library file and
 	#          create the necessary links
-	# Example:
-	#
-	# oe_
-	#
-	#bbnote installing shared library $1 to $2
-	#
+	# Example: oe_soinstall libfoo.so.1.2.3 ${D}${libdir}
 	libname=`basename $1`
+	if [[ "$libname" == *.so ]]; then
+		bbfatal "oe_soinstall: Shared library must haved versioned filename (e.g. libfoo.so.1.2.3)"
+	fi
 	install -m 755 $1 $2/$libname
 	sonamelink=`${HOST_PREFIX}readelf -d $1 |grep 'Library soname:' |sed -e 's/.*\[\(.*\)\].*/\1/'`
+	if [ -z $sonamelink ]; then
+		bbfatal "oe_soinstall: $libname is missing ELF tag 'SONAME'."
+	fi
 	solink=`echo $libname | sed -e 's/\.so\..*/.so/'`
 	ln -sf $libname $2/$sonamelink
 	ln -sf $libname $2/$solink
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] utils.bbclass: Added error checking for oe_soinstall
  2016-09-06 22:11 ` [PATCH 2/2] utils.bbclass: Added error checking for oe_soinstall Henry Bruce
@ 2016-09-07 16:27   ` Burton, Ross
  2016-09-07 16:44     ` Christopher Larson
  2016-09-07 21:09   ` [PATCH 2/2 v2] " Henry Bruce
  1 sibling, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2016-09-07 16:27 UTC (permalink / raw)
  To: Henry Bruce; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 276 bytes --]

On 6 September 2016 at 23:11, Henry Bruce <henry.bruce@intel.com> wrote:

> +       if [[ "$libname" == *.so ]]; then
>

That's a lot of bashisms in one place ;)

[ not [[
= not ==
*.so will need to be escaped in case it matches anything in cwd and expands.

Ross

[-- Attachment #2: Type: text/html, Size: 822 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] utils.bbclass: Added error checking for oe_soinstall
  2016-09-07 16:27   ` Burton, Ross
@ 2016-09-07 16:44     ` Christopher Larson
  0 siblings, 0 replies; 5+ messages in thread
From: Christopher Larson @ 2016-09-07 16:44 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 742 bytes --]

On Wed, Sep 7, 2016 at 9:27 AM, Burton, Ross <ross.burton@intel.com> wrote:

> On 6 September 2016 at 23:11, Henry Bruce <henry.bruce@intel.com> wrote:
>
>> +       if [[ "$libname" == *.so ]]; then
>>
>
> That's a lot of bashisms in one place ;)
>
> [ not [[
> = not ==
> *.so will need to be escaped in case it matches anything in cwd and
> expands.
>

Good catch, I expect what he really needs is a case statement, since he
doesn’t want an exact match, but to check if the wildcard matches.

case “$libname” in
    *.so)
        …
        ;;
esac
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 1715 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2 v2] utils.bbclass: Added error checking for oe_soinstall
  2016-09-06 22:11 ` [PATCH 2/2] utils.bbclass: Added error checking for oe_soinstall Henry Bruce
  2016-09-07 16:27   ` Burton, Ross
@ 2016-09-07 21:09   ` Henry Bruce
  1 sibling, 0 replies; 5+ messages in thread
From: Henry Bruce @ 2016-09-07 21:09 UTC (permalink / raw)
  To: openembedded-core

Fixes [YOCTO #10146]

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
---
 meta/classes/utils.bbclass | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index d56f51e..3c2a14f 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -62,15 +62,18 @@ def is_machine_specific(d):
 oe_soinstall() {
 	# Purpose: Install shared library file and
 	#          create the necessary links
-	# Example:
-	#
-	# oe_
-	#
-	#bbnote installing shared library $1 to $2
-	#
+	# Example: oe_soinstall libfoo.so.1.2.3 ${D}${libdir}
 	libname=`basename $1`
+	case "$libname" in
+	    *.so)
+	        bbfatal "oe_soinstall: Shared library must haved versioned filename (e.g. libfoo.so.1.2.3)"
+	        ;;
+	esac
 	install -m 755 $1 $2/$libname
 	sonamelink=`${HOST_PREFIX}readelf -d $1 |grep 'Library soname:' |sed -e 's/.*\[\(.*\)\].*/\1/'`
+	if [ -z $sonamelink ]; then
+		bbfatal "oe_soinstall: $libname is missing ELF tag 'SONAME'."
+	fi
 	solink=`echo $libname | sed -e 's/\.so\..*/.so/'`
 	ln -sf $libname $2/$sonamelink
 	ln -sf $libname $2/$solink
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-07 21:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-06 22:11 [PATCH 1/2] utils.bbclass: Remove trailing whitespace Henry Bruce
2016-09-06 22:11 ` [PATCH 2/2] utils.bbclass: Added error checking for oe_soinstall Henry Bruce
2016-09-07 16:27   ` Burton, Ross
2016-09-07 16:44     ` Christopher Larson
2016-09-07 21:09   ` [PATCH 2/2 v2] " Henry Bruce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox