]> code.ossystems Code Review - meta-freescale.git/commitdiff
testfloat: fix dos2unix not found issue during do_unpack2
authorTing Liu <b28495@freescale.com>
Thu, 7 Jun 2012 14:17:37 +0000 (14:17 +0000)
committerKhem Raj <raj.khem@gmail.com>
Wed, 11 Jul 2012 03:11:35 +0000 (20:11 -0700)
On some distros such as Ubuntu 10.04, dos2unix is replaced by
fromdos. Reference:
http://www.virtualhelp.me/linux/164-dos2unix-missing-ubuntu-1004

Fix the following error:
| NOTE: Applying patch 'TestFloat-powerpc-E500v2-SPE-1.patch'
| (../meta-fsl-ppc/recipes-test/testfloat/files/TestFloat-powerpc-E500v2
| -SPE-1.patch)
| ERROR: Error executing a python function in ../meta-fsl-ppc/recipes-test/testfloat/testfloat_2a.bb:
| CmdError: Command Error: exit status: 1  Output:

Signed-off-by: Ting Liu <b28495@freescale.com>
meta-fsl-ppc/recipes-test/testfloat/testfloat_2a.bb

index fd5a5e618a449fc3e005e29061acf564ad5389a8..ece8c1857b582b793cc80a389140b6f43976fa2e 100644 (file)
@@ -20,7 +20,13 @@ S = "${WORKDIR}/TestFloat-2a"
 do_unpack2(){
     mv ${WORKDIR}/SoftFloat-2b ${S}/SoftFloat-2b
     cd ${S}
-    find -type f -exec dos2unix {} \;
+    if [ -n "$(which fromdos)" ];then
+        find -type f -exec fromdos {} \;
+    elif [ -n "$(which dos2unix)" ];then
+        find -type f -exec dos2unix {} \;
+    else
+        echo -e "\nERROR: command dos2unix or fromdos not found\n" && return 1
+    fi
 }
 addtask do_unpack2 after do_unpack before do_patch