Skip to contentSkip to conversation

utils.bbclass: Remove trailing whitespace

PATCH In review Henry Bruce 3 participants 5 messages Sep 6, 2016 – Sep 7, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 utils.bbclass: Remove trailing whitespace

---
 meta/classes/utils.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/utils.bbclass +2 -2
index 59ace44..d56f51e 100644
@@ -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)
 
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 utils.bbclass: Added error checking for oe_soinstall

Fixes [YOCTO #10146]

---
 meta/classes/utils.bbclass | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
meta/classes/utils.bbclass +7 -6
index d56f51e..aa033d5 100644
@@ -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
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 2/2] utils.bbclass: Added error checking for oe_soinstall

Quoted 2 lines · Henry Bruce

+ 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

#3 lore raw

Re: [PATCH 2/2] utils.bbclass: Added error checking for oe_soinstall

Quoted 5 lines · Ross
Quoted 2 lines · Henry Bruce

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

Quoted 7 lines

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

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
#4 lore raw

PATCH v2 2/2 utils.bbclass: Added error checking for oe_soinstall

In reply to Henry Bruce

Fixes [YOCTO #10146]

---
 meta/classes/utils.bbclass | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
meta/classes/utils.bbclass +9 -6
index d56f51e..3c2a14f 100644
@@ -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
Signature · 1 line
2.7.4