Bug 142105 - The script kexi/examples/build_kexi_file.sh doesn't work on Solaris 8 when building
Summary: The script kexi/examples/build_kexi_file.sh doesn't work on Solaris 8 when bu...
Status: CLOSED LATER
Alias: None
Product: KEXI
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: Jarosław Staniek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-23 14:16 UTC by Steve Evans
Modified: 2016-01-29 19:56 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Evans 2007-02-23 14:16:27 UTC
Version:           1.6.2 (using KDE KDE 3.5.6)
Installed from:    Compiled From Sources
Compiler:          gcc 3.4.6 
OS:                Solaris

I get this error when building on Solaris 8

./build_kexi_file.sh ./Simple_Database.kexi.sql ../../kexi/examples/Simple_Database.kexi
./build_kexi_file.sh: test: unknown operator -ot

This is because the script:

1. Has #!/bin/sh as its first line. On Solaris /bin/sh is the Bourne shell, not bash
2. The script uses the test operator -ot which is not available in the Bourne shell

I have worked around the problem by changing #!/bin/sh to #!/bin/bash
Comment 1 Jarosław Staniek 2007-02-23 16:16:29 UTC
Thanks for reporting. 
I guess I cannot add dependency on bash but instead find a replacement for not portable commands. Before I am able to do this, I need assistance of a sh user. 

Note that all scripts in examples/ and tools/ need to be reviewed.


Comment 2 Bernd Kuhls 2007-03-29 22:22:15 UTC
Same system, problem and solution here.
Comment 3 Jarosław Staniek 2007-08-22 09:54:24 UTC
any assistance from solaris user on how to keep the script portable?
Comment 4 Moinak Ghosh 2008-01-30 08:15:28 UTC
/bin/sh on Solaris does not support the -ot and -nt test operators. /usr/bin/test can be used instead while retaining /bin/sh. Here is a suggested patch:

--- koffice-1.6.3/kexi/examples/build_kexi_file.sh      2008-01-30 12:19:04.582001168 +0530
+++ koffice-1.6.3/kexi/examples/build_kexi_file.sh.new  2008-01-30 12:45:58.466988954 +0530
@@ -22,7 +22,7 @@
        kexi_file=$2
 fi

-if test -f "$kexi_file" -a ! "$kexi_file" -ot "$1" ; then
+if /usr/bin/test -f "$kexi_file" -a "$kexi_file" -nt "$1" ; then
        echo "Local $kexi_file is newer than $1 - skipping it"
        exit 0
 fi