Bug 115283 - Non-POSIX instruction in ./configure (and configure.ac)
Summary: Non-POSIX instruction in ./configure (and configure.ac)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Installation (show other bugs)
Version:
(earliest affected)
5.4.4.2 release
Hardware: All Linux (All)
: medium normal
Assignee: How can I remove my account?
URL:
Whiteboard: target:6.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-28 17:09 UTC by Stéphane Goujet
Modified: 2018-11-27 17:41 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Goujet 2018-01-28 17:09:37 UTC
Hello,

  configure cannot run when /bin/sh is dash, because it uses one bashism: pattern substitution "${parameter/pattern/string}", which does not belong to POSIX shell.

  It happens at line 5062 of the "configure" script provided with LibreOffice-5.4.4.2, when it tries to remove spaces from $PRODUCTNAME to make PRODUCTNAME_WITHOUT_SPACES.

  The POSIX way to suppress spaces is to use "tr", or "sed" as 10 lines earlier in the "configure" file.

  This fixes the "configure" file. Replace:

PRODUCTNAME_WITHOUT_SPACES=${PRODUCTNAME// /}

  by:

PRODUCTNAME_WITHOUT_SPACES=`echo "$PRODUCTNAME" | sed 's/ //g'`

  But of course the real fix should be in "configure.ac". Probably just the same line but I do not know autotools, I do not know if there is an autoconf macro that suits better, so I let you confirm.

  The problem was introduced in <https://cgit.freedesktop.org/libreoffice/core/commit/configure.ac?id=b640a1343bb73f0c36a316f42847de5d61c156e3>
Comment 1 Buovjaga 2018-02-17 15:13:39 UTC
(In reply to Stéphane Goujet from comment #0)
>   The problem was introduced in
> <https://cgit.freedesktop.org/libreoffice/core/commit/configure.
> ac?id=b640a1343bb73f0c36a316f42847de5d61c156e3>

Pinging Tor.
Comment 2 How can I remove my account? 2018-02-17 15:20:03 UTC
What is your Linux distro? Debian uses dash as /bin/dash as far as I know, and we have lots of people that build LibreOffice on Debian without problems. What is different in your case? (But sure, that change can be done, no problem. Just don't expect to be able to build LibreOffice without /bin/bash even if the configure script perhaps can be run with dash as well.)
Comment 3 How can I remove my account? 2018-02-17 15:25:47 UTC
I mean, Debian uses dash as /bin/sh .
Comment 4 Commit Notification 2018-02-17 15:26:23 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c902cbc7dc5294ab721a9aef3a152aa243d00011

tdf#115283: Avoid bashism

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Stéphane Goujet 2018-02-17 17:39:48 UTC
(In reply to Tor Lillqvist from comment #2)
> What is your Linux distro?

  No distro really. The starting point was a Crux however.


> Debian uses dash as /bin/dash as far as I know,
> and we have lots of people that build LibreOffice on Debian without
> problems.

  So, I just tested a piece of the configure file on a Debian I have. In fact, on Debian, the configure script re-executes itself several times, the 1st time under /bin/sh (==dash), but afterwards under /bin/bash. For my sanity, I'd rather not try to understand what goes on. Some autotools magical mess :-)


> What is different in your case? (But sure, that change can be
> done, no problem. Just don't expect to be able to build LibreOffice without
> /bin/bash even if the configure script perhaps can be run with dash as well.)

  Oh, it's not 'perhaps': you have been actively removing bashisms to keep the configure script as POSIX as possible along the years :-) So it would have been a pity to abandon this compatibility effort for just 1 line.
Comment 6 Xisco Faulí 2018-11-27 14:58:43 UTC
A polite ping to Tor Lillqvist:
Is this bug fixed? if so, could you please close it as RESOLVED FIXED ? Otherwise, Could you please explain what's missing?
Thanks