File opa-fm-Fallback-to-custom-vendor-if-os_vendor-fails.patch of Package opa-fm

commit 73c5be8b293eba4460b59e2dfac571e4c3363637
Author: Nicolas Morey-Chaisemartin <NMoreyChaisemartin@suse.com>
Date:   Mon Aug 28 14:07:34 2017 +0200

    opa-fm Fallback to custom vendor if os_vendor fails
    
    Signed-off-by: Nicolas Morey-Chaisemartin <NMoreyChaisemartin@suse.com>

diff --git MakeTools/funcs-ext.sh MakeTools/funcs-ext.sh
index 0d9f1d5..3d283d3 100755
--- MakeTools/funcs-ext.sh
+++ MakeTools/funcs-ext.sh
@@ -711,30 +711,35 @@ function os_vendor()
         rval=apple
     else
         filelist=($('ls' /etc/*-release | egrep -v lsb | egrep -v os))
-        rval=""
-        if [ ${#filelist[@]} -eq 0 ] && [ -f /etc/lsb-release ]; then
-            rval=$(cat /etc/lsb-release | egrep DISTRIB_ID | cut -d'=' -f2)
-        fi
-        for file in $filelist
-        do
-	    if [ -f $file ]
-	    then
-		    rval=$(basename $file -release)
-		    if [ $rval = 'SuSE' ]
-		    then
-			    if [ -f /etc/UnitedLinux-release ]
-			    then
-				    rval=UnitedLinux
-			    fi
-			elif [ $rval = 'centos' ]
-			then
-				rval=redhat
-			elif [ $rval != 'os' ]
-			then
-				break
-		    fi
-	    fi
-        done
+        if [ $? == 1 ]
+        then
+            rval="custom"
+        else
+			rval=""
+			if [ ${#filelist[@]} -eq 0 ] && [ -f /etc/lsb-release ]; then
+				rval=$(cat /etc/lsb-release | egrep DISTRIB_ID | cut -d'=' -f2)
+			fi
+			for file in $filelist
+			do
+				if [ -f $file ]
+				then
+					rval=$(basename $file -release)
+					if [ $rval = 'SuSE' ]
+					then
+						if [ -f /etc/UnitedLinux-release ]
+						then
+							rval=UnitedLinux
+						fi
+					elif [ $rval = 'centos' ]
+					then
+						rval=redhat
+					elif [ $rval != 'os' ]
+					then
+						break
+					fi
+				fi
+			done
+		fi
     fi
     echo $rval
 }
openSUSE Build Service is sponsored by