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

Portability issues

From: Louis Guillaume <lguillaume_at_berklee.edu>
Date: 2007-03-19 23:09:10 CET


I just attempted to build subversion from the pkgsrc environment on NetBSD.
Pkgsrc recently gained some portability-checking routines, which are quite

Problems are encountered with the subversion-base package, see below. While
this is easy to get around, these seem like simple fixes that would ensure
the portability of subversion.

Not sure how to fix the $RANDOM issue but the test one seems pretty


=> Checking for portability problems in extracted files
ERROR: [check-portability.awk] => Found test ... == ...:
ERROR: [check-portability.awk] subversion/tests/cmdline/davautocheck.sh:
[ "${REPLY:-$2}" == 'y' ]
WARNING: [check-portability.awk] => Found $RANDOM:
WARNING: [check-portability.awk] subversion/tests/cmdline/davautocheck.sh:
ERROR: [check-portability.awk] => Found test ... == ...:
ERROR: [check-portability.awk] subversion/tests/cmdline/davautocheck.sh: if [
$# == 0 ]; then

The variable $RANDOM is not required for a POSIX-conforming shell, and
many implementations of /bin/sh do not support it. It should therefore
not be used in shell programs that are meant to be portable across a
large number of POSIX-like systems.

The "test" command, as well as the "[" command, are not required to know
the "==" operator. Only a few implementations like bash and some
versions of ksh support it.

When you run "test foo == foo" on a platform that does not support the
"==" operator, the result will be "false" instead of "true". This can
lead to unexpected behavior.

There are two ways to fix this error message. If the file that contains
the "test ==" is needed for building the package, you should create a
patch for it, replacing the "==" operator with "=". If the file is not
needed, add its name to the CHECK_PORTABILITY_SKIP variable in the
package Makefile.

*** Error code 1

make: stopped in /usr/pkgsrc/devel/subversion-base

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Mar 19 23:09:37 2007

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

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