Author Topic: Error in Linux Ubuntu ./update  (Read 4754 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Error in Linux Ubuntu ./update
« on: August 29, 2008, 04:20:45 pm »
When I update the latest svn (5197) on Ubuntu, compile, then execute ./update, I get the following error:

Code
pecan@ubuntu:~/devel/trunk/src$ ./update
Creating output directory tree
Compressing core UI resources
Compressing plugins UI resources
Packing core UI bitmaps
Packing plugins UI bitmaps
Copying files
Stripping debug info from output tree
[: 114: ==: unexpected operator



Shouldn't line 100 be:

Code
if [ "x$MSYSTEM" = "x" ] ; then

*not*
Code
if [ "x$MSYSTEM" == "x" ] ; then
« Last Edit: August 29, 2008, 04:32:46 pm by Pecan »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Error in Linux Ubuntu ./update
« Reply #1 on: August 29, 2008, 04:35:42 pm »
No errors here.

The "update"-script has not been changed since svn r5092.

What do you have in line 114 ?
There should only be a "fi".

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Error in Linux Ubuntu ./update
« Reply #2 on: August 29, 2008, 04:44:56 pm »
Cross-post with your edit.

No line 100 is correct.

The shell-syntax in this case is the same like in c++.

That means "==" tests if left and right value are equal, "=" assigns right value to left value (hope I expressed it right in english).

EDIT:

Just saw that this is only partial right, sorry.
If comparing strings bot "==" and "=" are allowed.

EDIT 2:

At least in bash:

http://tldp.org/LDP/abs/html/comparison-ops.html#SCOMPARISON1
« Last Edit: August 29, 2008, 05:08:18 pm by jens »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Error in Linux Ubuntu ./update
« Reply #3 on: August 29, 2008, 05:16:11 pm »
Line 114 is "fi" but:

http://www.comptechdoc.org/os/linux/usersguide/linux_ugshellpro.html
Shell Programming
shows syntax for Bash as:
Code
# string1 = string2 = True if the strings are equal.
# string1 != string2 = True if the strings are not equal.

not "=="

and when I change it to a single =, the ./update script works.

I recently accepted the Ubuntu update, so that might have done this.

./Update as downloaded


Synaptic  entry:
« Last Edit: August 29, 2008, 05:17:44 pm by Pecan »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Error in Linux Ubuntu ./update
« Reply #4 on: August 29, 2008, 06:05:17 pm »
Which shell is used if "/bin/sh" is called (as the update-script does) ?

Code
jens@debian-inspiron:~$ ll /bin/sh 
lrwxrwxrwx 1 root root 4 13. Mai 09:34 /bin/sh -> bash
jens@debian-inspiron:~$

Nevertheless if it does not work with the "==" I can commit a change that only uses the "=", that should work (hopefully) with all shells.

EDIT:
Should be fixed in svn r5199.
« Last Edit: August 29, 2008, 06:18:06 pm by jens »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Error in Linux Ubuntu ./update
« Reply #5 on: August 29, 2008, 06:19:28 pm »
It looks like my shell got set to something called "dash" during the update. I have no idea what that is.

Should I set my shell back to bash?
Code
pecan@ubuntu:~$ ll /bin/sh
lrwxrwxrwx 1 root root 4 2007-05-06 11:41 /bin/sh -> dash

https://wiki.ubuntu.com/DashAsBinSh
Quote
Dash as /bin/sh

In Ubuntu 6.10, the default system shell, /bin/sh, was changed to dash (the Debian Almquist Shell); previously it had been bash (the GNU Bourne-Again Shell). The same change will affect users of Ubuntu 6.06 LTS upgrading directly to Ubuntu 8.04 LTS. This document explains this change and what you should do if you encounter problems.

The default login shell remains bash.

Actually, I'm using Ubuntu 8.04, and this error only started after I accepted the second round of updates to 8.04
« Last Edit: August 29, 2008, 06:31:58 pm by Pecan »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Error in Linux Ubuntu ./update
« Reply #6 on: August 29, 2008, 06:29:48 pm »
It looks like my shell got set to something called "dash" during the update. I have no idea what that is.

Should I set my shell back to bash?
Code
pecan@ubuntu:~$ ll /bin/sh
lrwxrwxrwx 1 root root 4 2007-05-06 11:41 /bin/sh -> dash

https://wiki.ubuntu.com/DashAsBinSh
Quote
Dash as /bin/sh

In Ubuntu 6.10, the default system shell, /bin/sh, was changed to dash (the Debian Almquist Shell); previously it had been bash (the GNU Bourne-Again Shell). The same change will affect users of Ubuntu 6.06 LTS upgrading directly to Ubuntu 8.04 LTS. This document explains this change and what you should do if you encounter problems.

The default login shell remains bash.

Actually, I using Ubuntu 8.04

Try
Code
dpkg-reconfigure dash
and if debconf asks whether "dash" should be installed as "/bin/sh" answer with no.

If that does not work you can set the link manually with
Code
ln -sf /bin/bash /bin/sh

Both instructions have to be run as root.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Error in Linux Ubuntu ./update
« Reply #7 on: August 29, 2008, 06:40:13 pm »
Edit: I see that the "==" in SVN ./update got changed to a single "=".
Thanks.

After reading the complete blurb:
https://wiki.ubuntu.com/DashAsBinSh
Quote
sudo dpkg-reconfigure dash

Beware that this is a more invasive change, will undo boot speed benefits, and there is even an outside chance that there are a few scripts that now depend on some feature of dash that bash does not provide! (We expect the last problem to be rare, as the feature set of dash is largely a subset of that offered by bash, but we mention it for completeness.)

I think I'd rather just leave Ubuntu alone. I'm not experienced enough in Linux to be playing around in it.

It's safer for me to change (in ./update) the "==" to a single "=" or change the "#!/bin/sh" to "#!/bin/bash" as stated in the Ubuntu page.

Thanks for the help
« Last Edit: August 29, 2008, 06:52:57 pm by Pecan »