develooper Front page | perl.perl5.porters | Postings from May 2002

[PATCH perl@16923] archname glitch on HP-UX/IA64

Thread Next
Colin Watson
May 31, 2002 09:48
[PATCH perl@16923] archname glitch on HP-UX/IA64
Message ID:

On an HP-UX B.11.20 IA64 box, 'perl -V:archname' prints the following:

  archname='IA64.ARCHREV_0	';

(That's a tab.)

hints/ uses \t inside a sed bracket expression, which doesn't
appear to be portable. This is the line from <sys/unistd.h> that it's
looking at.

#  define CPU_IA64_ARCHREV_0	0x300 /* IA-64 archrev 0 */

This patch against bleadperl alters hints/ to use [[:space:]]
instead, which works on all the HP-UX 10 and 11 machines to which I have

--- hints/	Mon May 27 18:41:50 2002
+++ hints/	Fri May 31 16:39:32 2002
@@ -18,8 +18,8 @@
     # up to date with new CPU/OS releases.
     xxcpu=`getconf CPU_VERSION`; # Get the number.
     xxcpu=`printf '0x%x' $xxcpu`; # convert to hex
-    archname=`sed -n -e "s/^#[ \t]*define[ \t]*CPU_//p" /usr/include/sys/unistd.h |
-	sed -n -e "s/[ \t]*$xxcpu[ \t].*//p" |
+    archname=`sed -n -e "s/^#[[:space:]]*define[[:space:]]*CPU_//p" /usr/include/sys/unistd.h |
+	sed -n -e "s/[[:space:]]*$xxcpu[[:space:]].*//p" |
 	sed -e s/_RISC/-RISC/ -e s/HP_// -e s/_/./ -e "s/[[:space:]]*//g"`;
     # This system is running <= 9.x


Colin Watson, <>                      Zeus Technology Ltd
Software Engineer                            Universally Serving the Net
Tel:+44(0)1223 525000  Fax:+44(0)1223 525100
Zeus House, Cowley Road, Cambridge, CB4 0ZT, ENGLAND

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About