After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 613580 - Build failure: LANGDIRS relies on non-portable behavior of 'echo -n'
Build failure: LANGDIRS relies on non-portable behavior of 'echo -n'
Status: RESOLVED FIXED
Product: gok
Classification: Deprecated
Component: build
2.28.x
Other Mac OS
: Normal normal
: ---
Assigned To: gok-maint
gok-maint
Depends on:
Blocks:
 
 
Reported: 2010-03-22 12:26 UTC by Daniel Macks
Modified: 2010-03-22 19:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Avoid echo -n (438 bytes, patch)
2010-03-22 13:32 UTC, Gerd Kohlberger
none Details | Review

Description Daniel Macks 2010-03-22 12:26:18 UTC
A tester of gok-2.28.1 on OS X 10.5/32bit reported to me:

>make
>Makefile:190: *** missing separator.  Stop.
>
> The corresponding lines are :
>
>189  LANGDIRS = -n am/
>190  -n ang/

Apparently 'echo -n' isn't behaving the way you expect in configure.in:

LANGDIRS="`$GREP -v "^\#" po/LINGUAS | while read line; do echo -n "$line/ "; done `"

Autoconf has a whole series of tests to figure out if/how to get the desired behavior...sets $ECHO_N for you. But there may not be *any* determined value available. Can the intended effect be gotten with sed? That seems simpler than a while-read-do loop anyway. Or else, can you skip the LANGDIRS setting by a maintainer-mode or other autoconf flag? Or can it be done directly as part of the makefile recipes rather than passed from autoconf (still not portable, but only affects git developers not source-release builders).
Comment 1 Gerd Kohlberger 2010-03-22 13:32:27 UTC
Created attachment 156738 [details] [review]
Avoid echo -n

Hi Daniel,

here's a patch that uses sed. Can you check if it works on OS X. Thanks.
Comment 2 Daniel Macks 2010-03-22 17:15:19 UTC
To get result like previous, want slash after each?

  ':a;N;$!ba;s/\n/\/ /g'

Not sure how to get one after the last (I don't know enough sed regex to match "\n or end-of-line").
Comment 3 Peter O'Gorman 2010-03-22 18:03:48 UTC
A solution might be to just use awk as in

LANGDIRS=`awk '/^[^#]/ {printf "%s/ ",$0}' po/LINGUAS`
Comment 4 Gerd Kohlberger 2010-03-22 19:49:37 UTC
Thanks Peter, your solution looks much cleaner.

Committed to master.
http://git.gnome.org/browse/gok/commit/?id=ed9481f3d52b099afe7dbb5b51d4ff9424bfb3ac