Issue 46873 - FreeBSD, MacOS X's sed doesn't support -r
Summary: FreeBSD, MacOS X's sed doesn't support -r
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: current
Hardware: All All
: P5 (lowest) Trivial (vote)
Target Milestone: OOo 2.0
Assignee: rene
QA Contact: issues@porting
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-06 21:36 UTC by pavel
Modified: 2005-08-19 06:35 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch to work around sed -r (898 bytes, patch)
2005-04-08 00:31 UTC, quetschke
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description pavel 2005-04-06 21:36:37 UTC
Hi,

configure.in contains:

        dnl Kaffe specific tests
        KAFFE_VER=`$JAVAINTERPRETER -version 2>&1 | $EGREP "  Version:" | $SED
-r "s/.*  Version: ([[0-9\.]]*).*/\1/"`

and:

pavel@leda:~> uname -a
FreeBSD leda.fi.muni.cz 4.11-STABLE FreeBSD 4.11-STABLE #0: Wed Jan 12 11:24:02
CET 2005     xbezdek@leda.fi.muni.cz:/usr/obj/usr/src/sys/LEDA  i386
pavel@leda:~> sed -r
sed: illegal option -- r
Comment 1 maho.nakata 2005-04-07 03:11:22 UTC
yes FreeBSD's sed doesn't support -r
(also 5.3-RELEASE)
Comment 2 pavel 2005-04-07 21:27:00 UTC
also MacOS X's sed doesn't support it -> JAVA_HOME in configure9 is not set at all.
Comment 3 rene 2005-04-07 22:39:34 UTC
vq: can you look. the stuff athe kaffe check is not important because kaffe
doesn not really work anyhow but the $SED -n -r's in the java stuff are
important abnd will break FreeBSD/MacOS X? Can that be rewritten to not require
-r? This looks like it tries to subsitute exe in all possible lower/uppercase
combinations so we can do three SEDs, can't we?
Comment 4 quetschke 2005-04-07 23:40:18 UTC
I'll have a look ...
Comment 5 quetschke 2005-04-08 00:31:12 UTC
Created attachment 24818 [details]
Patch to work around sed -r
Comment 6 quetschke 2005-04-08 00:36:41 UTC
The previous patch works around that problem, but are we sure that
  $SED -n "s,//*bin//*java,,p"
really does what it is designed to do?

If I'm not mistaken that matches /opt//////////bin/////////////javasomething
or /usr/bin/java .
Comment 7 rene 2005-04-08 10:16:05 UTC
This is only one of the two places where you added -r..  
  
Anyway; If it accepts that path you mentioned, it's suboptimal but IMHO  
shouldn't be that big problem since no one will get this path on sane systems 
anyway...  
Comment 8 quetschke 2005-04-08 16:00:19 UTC
> This is only one of the two places where you added -r..

Oeh, but my patch (issue 46572) only added one -r.

The other one is in the KAFFE_VER part:

KAFFE_VER=`$JAVAINTERPRETER -version 2>&1 | $EGREP "  Version:" | $SED -r "s/.*
 Version: ([[0-9\.]]*).*/\1/"`
          
I don't know what kaffe outputs, but can you try (replace the $SED part with):

$AWK '/.*Version: [[0-9.]]*/ {print gensub (".*Version: ([[0-9.]]+).*","\\1",g);}'

(One line)
Comment 9 rene 2005-04-08 16:44:05 UTC
yeah, error. it's two (including the kaffe check, which can be ignored for now)

-> fixed in configure9
Comment 10 Martin Hollmichel 2005-08-19 06:35:32 UTC
close issue.