Bug 142335 - configure.ac contains a Bashism that produces an error when /bin/sh is not Bash
Summary: configure.ac contains a Bashism that produces an error when /bin/sh is not Bash
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.1.0.2 rc
Hardware: All All
: medium minor
Assignee: Julien Nabet
URL:
Whiteboard: target:7.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-17 16:16 UTC by Matt Whitlock
Modified: 2021-05-18 07:00 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
patch to remove the Bashism (514 bytes, patch)
2021-05-17 16:19 UTC, Matt Whitlock
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Whitlock 2021-05-17 16:16:55 UTC
Description:
configure.ac (in the "core" repo) contains a Bashism (use of '==' operator in a 'test' command) that produces an error when /bin/sh is a POSIX shell such as Dash.

if test -z "$enable_community_flavor" -o "$enable_community_flavor" == "yes"; then

Steps to Reproduce:
1. Run autogen.sh to produce configure.
2. Run configure with /bin/sh -> dash.

Actual Results:
checking whether to build a Community flavor... ./configure: 10592: test: unexpected operator
no

Expected Results:
checking whether to build a Community flavor... no


Reproducible: Always


User Profile Reset: No



Additional Info:
Also reported downstream at https://bugs.gentoo.org/780432.
Comment 1 Matt Whitlock 2021-05-17 16:19:44 UTC
Created attachment 172098 [details]
patch to remove the Bashism
Comment 2 Julien Nabet 2021-05-17 16:25:39 UTC
Matt: since you find the bug, analyze it and have a solution would you be interested in submitting a patch?
If yes, you can take a look here:
https://wiki.documentfoundation.org/Development/GetInvolved

I suppose you've already downloaded source code so you just need to create an account + send a license statement to submit your patch.


Heiko: noticing https://cgit.freedesktop.org/libreoffice/core/commit/?id=2d69acfde50cb0e06a9a057939078fd102d371a3

author	Heiko Tietze <tietze.heiko@gmail.com>	2021-01-08 15:10:42 +0100
committer	Miklos Vajna <vmiklos@collabora.com>	2021-01-14 09:25:07 +0100
commit 2d69acfde50cb0e06a9a057939078fd102d371a3 (patch)
tree fa6e06401d482d225b2e9f14a37a0a943de2ba45
parent 06322b0922972fec4b9e5f57e8dbab18ca9bd676 (diff)
Resolves tdf#139343 and tdf#139335 - Community/Enterprise flavor

Thought you might be interested in this one.
Comment 3 Matt Whitlock 2021-05-17 16:31:08 UTC
(In reply to Julien Nabet from comment #2)
> would you be interested in submitting a patch?

As far as I'm concerned, that's what I just did.

> you just need to create an account + send a license statement to submit your patch.

Respectfully, that's more effort than I'm willing to go to just to delete one stray character from a build script.
Comment 4 Julien Nabet 2021-05-17 16:46:43 UTC
(In reply to Matt Whitlock from comment #3)
> (In reply to Julien Nabet from comment #2)
> > would you be interested in submitting a patch?
> 
> As far as I'm concerned, that's what I just did.
Sorry I meant in gerrit

> 
> > you just need to create an account + send a license statement to submit your patch.
> 
> Respectfully, that's more effort than I'm willing to go to just to delete
> one stray character from a build script.
Ok no problem. Thought it would be a first bug to tackle for you but would be interested in tackling more bugs.

Anyway I submitted the patch here:
https://gerrit.libreoffice.org/c/core/+/115716

(Hope there won't be license issue for a one line patch).
Comment 5 Heiko Tietze 2021-05-17 17:49:43 UTC
Thank for the patch. It's pretty easy to hack directly in Gerrit, see https://gerrit-review.googlesource.com/Documentation/user-inline-edit.html
Comment 6 Commit Notification 2021-05-18 07:00:31 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2c4dd73c4c9f471fa2083f9f99dd27a7148f3175

tdf#142335: fix bashism in configure.ac

It will be available in 7.2.0.

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

Affected users are encouraged to test the fix and report feedback.