[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] echo -n is not portable and used too much

From: Branko Čibej <brane_at_xbc.nu>
Date: 2002-02-12 18:22:04 CET

Kirby C. Bohling wrote:

> Branko Čibej wrote:
>> Blair Zajac wrote:
>>> On Solaris, running make check results in output like this:
>>> make check
>>> -n Running all tests in path-test...
>>> -n Running all tests in random-test...
>>> -n Running all tests in hashdump-test...
>>> .
>>> .
>>> .
>> /bin/echo, -n "\c", tr, .... blech. (Is that a shell built-in? It
>> should be. :-)
>> print "Running all tests in path-test...",
>> is completely portable. Of course, that's Python.
> <devils advocate>
> 1. It's as portable as Bourne Shell was years ago, when there was one
> the one true UNIX shell (that everybody modified into the varients we
> have now, but diversity is good)... and will have just as many
> problems more then likely years from now. A lot of simple problems
> can be solved inside python, but anytime you execute an external
> program your in trouble.

Really? Interesting, I do that at work with no trouble. On Windows.
Maybe it's just me. :-)

> 2. Oh, is that portable in Python 1.4, 1.5, 1.51, or 2.0? There is
> lots of python I can't run, including the subverions tests on my stock
> RH7.2 box. I can't build/run the swig stuff, I have to comment it out
> of the makefile basically because I am too lazy to go figure out what
> is that doesn't work. As a guy who is testing subversion I probably
> should go find it, but Solaris people should find an echo that works
> IMNSHO ;-)
> 3. How many things that don't have trival implementations in python
> will have to be written in python. echo does have a trival
> implementation, does everything needed have one?
> 4. Somebody mentioned older platforms, are there platforms python
> doesn't run on that subversion should run on?
> 5. Can I use python modules that aren't in the standard python
> library? Does that make it less portable? Can I used syntax or
> features that are 2.0 only features. What if python 2.1 breaks old
> features used in the testing scripts (perl 4 5 5.6 broke a number of
> things, I wouldn't be shocked if some python release did it in the
> future).

The simple answer is that we require Pyton 2.0 or better for running the
regression tests, anyway.

> 6. Why not write myEcho in C that works the way you want and build it
> as part of the testing process, I can easily provide that for every
> platform that supports command line arguments, printf and for loops
> and the patch to fix the shell scripts.
> (Of course now I am doing things that 3 implies is a bad but devil's
> advocates don't need to be consistant or rational *grin*)
> </devils advocate>
> Okay, so I think python is cool, and is probably more portable
> then sh. It allows subversion to get portableness pretty lazily, stand
> on the backs of the python's developers and you get it for free :-).
> Don't believe blindly that python is infinitely and completely
> portable, it isn't a silver bullet any more then POSIX, Single UNIX
> specification, LSB, RFC's, ANSI C/C++, or ANSI SQL92.
> While I believe python is probably a better answer, an argument
> based on the fact that some echo binaries do or don't support a "no
> new line at the end of this" option probably isn't big enough to make
> me think the switch is justifable. The cygwin stuff is probably a
> stronger point. Some of the "if ! foo" stuff in the last week is
> piling up to make it sound sane. Just thinking if we use python "it
> will be portable everywhere" might not be quite right.

The whole point is that we want the tests to run on platforms other than
Unix, and if we can manage that with only one non-standard tool (i.e.,
Python), I'll be happy.

Besides, most of the non-C tests are written in Python already. There
are IIRC only 4 shell scripts, apart from the stuff in the makefile.
Consistency is good.

> Thanks,
> Kirby
>> IMNSHO, everone's efforts would be much better spent rewriting all
>> those shell scripts in Python. Then all of a sudden, we'd have tests
>> running on Win32 without cygwin. Oh, joy!
>> (BTW, to run those tests in cygwin, I have to pipe every `pwd`
>> through sed, because cygwin insists that c:/ iw in fact /cygdrive/c/,
>> which svn of course barfs on. Nice.)

Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:06 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.