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

[PATCH] for sh portability issue in davautocheck.sh

From: Louis Guillaume <lguillaume_at_berklee.edu>
Date: 2007-03-23 13:00:15 CET

Hi,

The attached patch should fix a portability problem in subversion/tests/cmdline/davautocheck.sh.

Here also is my attempt at a log message that could be used...

* subversion/tests/cmdline/davautocheck.sh
  Fixed some instances of Bourne shell features that are not portable:
  (1) Removed all instances of `==' in `test' or `[' statements.
  (2) Replaced use of `$RANDOM' with `(( $$ % 32768 ))'.

The problem was noticed by the pkgsrc's portability checking routines: please see...

http://subversion.tigris.org/servlets/BrowseList?list=users&by=thread&from=568398

... for the details.

I'm not subscribed to dev@subversion.tigris.org, so please copy me on replies.

Thank You!

Louis

--- subversion/tests/cmdline/davautocheck.sh.orig 2007-03-21 22:01:10.000000000 +0000
+++ subversion/tests/cmdline/davautocheck.sh 2007-03-21 22:24:01.000000000 +0000
@@ -62,7 +62,7 @@
   echo -n "$SCRIPT: $1 (y/n)? [$2] "
   read -n 1 -t 32
   echo
- [ "${REPLY:-$2}" == 'y' ]
+ [ "${REPLY:-$2}" = 'y' ]
 }
 
 function get_loadmodule_config() {
@@ -170,7 +170,7 @@
     || fail "Authz_User module not found."
 }
 
-HTTPD_PORT=$(($RANDOM+1024))
+HTTPD_PORT=$((($$ % 32768 ) +1024))
 HTTPD_ROOT="$ABS_BUILDDIR/subversion/tests/cmdline/httpd-$(date '+%Y%m%d-%H%M%S')"
 HTTPD_CFG="$HTTPD_ROOT/cfg"
 HTTPD_PID="$HTTPD_ROOT/pid"
@@ -268,7 +268,7 @@
 
 say "HTTPD is good, starting the tests..."
 
-if [ $# == 0 ]; then
+if [ $# = 0 ]; then
   time make check "BASE_URL=$BASE_URL"
   r=$?
 else

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 27 00:18:46 2007

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.