develooper Front page | perl.perl5.porters | Postings from February 2003

[PATCH: perl@18639] test -e is not portable

Thread Next
From:
PPrymmer
Date:
February 20, 2003 08:08
Subject:
[PATCH: perl@18639] test -e is not portable
Message ID:
OFEA1447CE.839B0652-ON85256CD3.00577D84@factset.com
In the message Jarkko posted about the perl@18639 5.8.1 candidate
at:

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-02/msg00054.html

it appears that change 18638 integrated changes 18624 and 18626
having to do with a Plan 9 avoidance scheme.  Unfortunately it appears
that that scheme now uses the unportable "test -e" file tests
and runs like so on Solaris 8:

% sh Configure -des
Configure: test: unknown operator /dev/cputype
%

With this patch applied I can once again run Configure and build perl
on Solaris (SunOS 2.8):

--- Configure.orig      Thu Feb 20 11:01:23 2003
+++ Configure     Thu Feb 20 11:02:05 2003
@@ -47,7 +47,7 @@
 (exit $?0) || exec sh $0 $argv:q
 rm -f c1$$ c2$$

-if test -e /dev/cputype -a -e /dev/drivers -a -e /dev/osversion -a -e /dev/bintime; then
+if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion -a -f /dev/bintime; then
      cat >&4 <<EOF
 ***
 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
End of Patch.

Unfortunately I have no Plan 9 systems around here on which to test whether
the "test -f" replacement for "test -e" does in fact find the /dev/cputype and
other files hence I cannot tell whether this change is appropriate (although I
note that "test -f" is used in lots of other places in Configure).

Peter Prymmer



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About