Opened 5 years ago

Closed 5 years ago

#10846 closed defect (fixed)

Make sed commands compatible with OS X (no -r option)

Reported by: dcf Owned by: dcf
Priority: Low Milestone:
Component: Archived/Flashproxy Version:
Severity: Keywords:
Cc: infinity0, rl1987@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

The sed command on OS X doesn't have the -r option (man page). It causes various problems because many sed commands are run implicitly by Makefile. It looks like it may be a problem in

  • mkman.sh
  • version.sh
  • proxy/modules/nodejs/Makefile

Child Tickets

Change History (9)

comment:1 Changed 5 years ago by dcf

Here is sample output for make dist and make test.

~/flashproxy$ make dist
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
rm -rf dist/flashproxy-client- dist/flashproxy-client-.zip
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
mkdir -p dist/flashproxy-client-
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.client PYTHON="python" DESTDIR=dist/flashproxy-client- bindir=/ docdir=/ man1dir=/doc/ \
          REBUILD_MAN="0" install
mkdir -p dist/flashproxy-client-/
for i in flashproxy-client flashproxy-reg-appspot flashproxy-reg-email flashproxy-reg-http flashproxy-reg-url; do install "$i" dist/flashproxy-client-/; done
mkdir -p dist/flashproxy-client-/
for i in README LICENSE ChangeLog torrc; do install -m 644 "$i" dist/flashproxy-client-/; done
mkdir -p dist/flashproxy-client-/doc/
for i in doc/flashproxy-client.1 doc/flashproxy-reg-appspot.1 doc/flashproxy-reg-email.1 doc/flashproxy-reg-http.1 doc/flashproxy-reg-url.1; do install -m 644 "$i" dist/flashproxy-client-/doc/; done
python setup-common.py build_py -d dist/flashproxy-client-
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
Traceback (most recent call last):
  File "setup-common.py", line 30, in <module>
    assert p.poll() == 0
AssertionError
make: *** [dist/flashproxy-client-] Error 1
~/flashproxy$ make test
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.client PYTHON="python" check
for i in flashproxy-client-test.py; do python "$i"; done
..........................
----------------------------------------------------------------------
Ran 26 tests in 0.006s

OK
python setup-common.py test
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
Traceback (most recent call last):
  File "setup-common.py", line 30, in <module>
    assert p.poll() == 0
AssertionError
make: *** [check] Error 1

comment:2 Changed 5 years ago by infinity0

I'll fix this today, and perhaps install a FreeBSD VM somewhere so I can test this stuff in the future.

comment:3 Changed 5 years ago by rl1987

Cc: rl1987@… added

comment:4 Changed 5 years ago by infinity0

Fix pushed to main git repo, please confirm and close.

comment:5 Changed 5 years ago by rl1987

I tried your changes. On Mac OS X 10.9.1 make dist fails with the following output:

sed: 2: "s/^Changes .* version \ ...": undefined label 'x;b;:x p;q'
sed: 2: "s/^Changes .* version \ ...": undefined label 'x;b;:x p;q'
sed: 2: "s/^Changes .* version \ ...": undefined label 'x;b;:x p;q'
sed: 2: "s/^Changes .* version \ ...": undefined label 'x;b;:x p;q'
sed: 2: "s/^Changes .* version \ ...": undefined label 'x;b;:x p;q'
sed: 2: "s/^Changes .* version \ ...": undefined label 'x;b;:x p;q'
sed: 2: "s/^Changes .* version \ ...": undefined label 'x;b;:x p;q'
sed: 2: "s/^Changes .* version \ ...": undefined label 'x;b;:x p;q'
rm -rf dist/flashproxy-client- dist/flashproxy-client-.zip
sed: 2: "s/^Changes .* version \ ...": undefined label 'x;b;:x p;q'
sed: 2: "s/^Changes .* version \ ...": undefined label 'x;b;:x p;q'
sed: 2: "s/^Changes .* version \ ...": undefined label 'x;b;:x p;q'
mkdir -p dist/flashproxy-client-
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.client PYTHON="python" DESTDIR=dist/flashproxy-client- bindir=/ docdir=/ man1dir=/doc/ \
	  REBUILD_MAN="0" install
mkdir -p dist/flashproxy-client-/
for i in flashproxy-client flashproxy-reg-appspot flashproxy-reg-email flashproxy-reg-http flashproxy-reg-url; do install "$i" dist/flashproxy-client-/; done
mkdir -p dist/flashproxy-client-/
for i in README LICENSE ChangeLog torrc; do install -m 644 "$i" dist/flashproxy-client-/; done
mkdir -p dist/flashproxy-client-/doc/
for i in doc/flashproxy-client.1 doc/flashproxy-reg-appspot.1 doc/flashproxy-reg-email.1 doc/flashproxy-reg-http.1 doc/flashproxy-reg-url.1; do install -m 644 "$i" dist/flashproxy-client-/doc/; done
python setup-common.py build_py -d dist/flashproxy-client-
sed: 2: "s/^Changes .* version \ ...": undefined label 'x;b;:x p;q'
Traceback (most recent call last):
  File "setup-common.py", line 30, in <module>
    assert p.poll() == 0
AssertionError
make: *** [dist/flashproxy-client-] Error 1

comment:6 Changed 5 years ago by infinity0

I pushed some more fixes which I tested on FreeBSD - try it now?

BTW, make sure that you're using GNU make and not FreeBSD make. On FreeBSD it is called gmake, but I don't know if Mac OS X has retained that name.

comment:7 in reply to:  6 Changed 5 years ago by dcf

Replying to infinity0:

I pushed some more fixes which I tested on FreeBSD - try it now?

I'm still getting errors with 14dadf0f on OS X 10.9.1. The errors appear to be not about -r, but about some sed label syntax.

I can't find a version number for sed. The date in the man page is May 10, 2005 and the author is Diomidis D. Spinellis <dds@…>. make is GNU Make:

~/flashproxy$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

Here is the error, same as in comment:5:

~/flashproxy$ ./version.sh 
sed: 2: "s/^Changes .* version \ ...": undefined label 'x;b;:x p;q'

Maybe this?

grep '^Changes in version ' ChangeLog | head -n 1 | sed -e 's/.* \(..*\)$/\1/'

comment:8 Changed 5 years ago by infinity0

Argh, I just pushed to the wrong repo before I made my previous comment. Try this one: 1432fd2c

Last edited 5 years ago by infinity0 (previous) (diff)

comment:9 in reply to:  8 Changed 5 years ago by dcf

Resolution: fixed
Status: newclosed

Replying to infinity0:

Argh, I just pushed to the wrong repo before I made my previous comment. Try this one: 1432fd2c

Great, works for me.

Note: See TracTickets for help on using tickets.