View Issue Details

IDProjectCategoryView StatusLast Update
0000230OpenFOAMBugpublic2011-06-28 11:45
Reporterwyldckat Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Summary0000230: The script foamInstallationTest has some ilegal "sh" tests in some "if"s
DescriptionI've seen this a few times already and only now remembered to report it.
Basically the traditional "sh" does not allow "==" in if/test statements.

Attached is a fix for this issue.
Steps To ReproduceRun "foamInstallationTest" with a fledged "sh" (such as dash), not linked to bash.
It will result in something like this:

Third party software
-------------------------------------------------------------------------------
Software Version Location
-------------------------------------------------------------------------------
flex 2.5.35 /usr/bin/flex
[: 460: unexpected operator
[: 460: unexpected operator
gcc 4.4.5 /usr/bin/gcc
gzip 1.3.12 /bin/gzip
tar 1.23 /bin/tar
icoFoam 2.0.x ...M/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/bin/icoFoam
Additional InformationWorst case scenario I've seen so far (source: http://www.cfd-online.com/Forums/openfoam-installation/89657-openfoam-2-0-0-installation.html#post313691):

Third party software
-------------------------------------------------------------------------------
Software Version Location
-------------------------------------------------------------------------------
flex 2.5.31 /usr/bin/flex
/home/user/OpenFOAM/OpenFOAM-2.0.0/bin/foamInstallationTest: line 267: [: -lt: unary operator expected
/home/user/OpenFOAM/OpenFOAM-2.0.0/bin/foamInstallationTest: line 269: [: -gt: unary operator expected
/home/user/OpenFOAM/OpenFOAM-2.0.0/bin/foamInstallationTest: line 274: [: -lt: unary operator expected
/home/user/OpenFOAM/OpenFOAM-2.0.0/bin/foamInstallationTest: line 276: [: -gt: unary operator expected
/home/user/OpenFOAM/OpenFOAM-2.0.0/bin/foamInstallationTest: line 281: [: !=: unary operator expected
gcc ...M/ThirdParty-2.0.0/platforms/linux64/gcc-4.4.4/bin/gcc
gzip 1.3.5 /bin/gzip
tar 1.15.1 /bin/tar
icoFoam ...M/OpenFOAM-2.0.0/platforms/linux64GccDPOpt/bin/icoFoam
-------------------------------------------------------------------------------
TagsNo tags attached.

Activities

wyldckat

2011-06-27 19:48

updater  

of20x-foamInstallationTest-patch (957 bytes)   
diff --git a/bin/foamInstallationTest b/bin/foamInstallationTest
index 67a7edf..17e1035 100755
--- a/bin/foamInstallationTest
+++ b/bin/foamInstallationTest
@@ -270,7 +270,7 @@ reportExecutable()
             pass="yes"
         fi
 
-        if [ "$pass" == "" ] && [ "$gccOk" == "" ]; then
+        if [ "$pass" = "" ] && [ "$gccOk" = "" ]; then
             if [ $V2 -lt $MINV2 ]; then
                 gccOk="ERROR"
             elif [ $V2 -gt $MINV2 ]; then
@@ -278,7 +278,7 @@ reportExecutable()
             fi
         fi
 
-        if [ "$pass" == "" ] && [ "$gccOk" == "" ] && [ $V3 != "" ] && [ $MINV3 != "" ]; then
+        if [ "$pass" = "" ] && [ "$gccOk" = "" ] && [ $V3 != "" ] && [ $MINV3 != "" ]; then
             if [ $V3 -lt $MINV3 ]; then
                 gccOk="ERROR"
             fi
@@ -291,7 +291,7 @@ reportExecutable()
             echo ""
             fatalError=`expr $fatalError + 1`
         fi
- 
+
 
         ;;
     gtar)

wyldckat

2011-06-27 19:52

updater   ~0000493

After reviewing the thread link I posted in "Additional Information", the attached patch will not fix those errors :(
It will only fix the error in "Steps To Reproduce".

henry

2011-06-28 11:45

manager   ~0000494

Thanks for the bug-report and patch.
Resolved by commit 20e19730c173c4dc1512ed1f1301aad0786e3472

Issue History

Date Modified Username Field Change
2011-06-27 19:48 wyldckat New Issue
2011-06-27 19:48 wyldckat File Added: of20x-foamInstallationTest-patch
2011-06-27 19:52 wyldckat Note Added: 0000493
2011-06-28 11:45 henry Note Added: 0000494
2011-06-28 11:45 henry Status new => resolved
2011-06-28 11:45 henry Resolution open => fixed
2011-06-28 11:45 henry Assigned To => henry