pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/47493: perl5 Configure is confused by '=' in output from uname -a



>Number:         47493
>Category:       pkg
>Synopsis:       perl5 Configure is confused by '=' in output from uname -a
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 23 10:50:00 +0000 2013
>Originator:     Alan Barrett
>Release:        NetBSD 6.99.16
>Organization:
Not much
>Environment:
System: NetBSD 6.99.16 i386
>Description:
The Configure script in the lang/perl5 package attempts to parse
the output from "uname -a" to get the operating system name and
version.

Everything before the first '=' in the output from "uname -a"
is ignored.  I assume that there is some system where this is
useful, but in my case it causes incorrect results, because
I have several keyword=value pairs near the end of the
output from "uname -a":

        NetBSD hostname.domainname 6.99.16 NetBSD 6.99.16 (MYKERNEL) #1: Sun 
Jan 20 21:29:01 UTC 2013  
username@hostname.domainname:/dirname/sys/arch/i386/compile/MYKERNEL cvs 
root=username@hostname:/dirname module=src branch=HEAD

Ignoring everything up to the first '=' leaves this:

        username@hostname:/dirname module=src branch=HEAD

There's no operating system name or version there, so
the Configure script to fail to detect that it's running on
NetBSD, and this causes it to fail to apply the settings from
the hints/netbsd.sh file.  This was responsible for the build
failure described in PR pkg/47489.

>How-To-Repeat:
Inspect the Configure script for perl-5.16.2:

   3098 myuname=`$uname -a 2>/dev/null`
   3099 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
   3100 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
   3101 # because the A-Z/a-z are not consecutive.
   3102 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
   3103         ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`

>Fix:
I don't why it tries to parse the OS name and version from
"uname -a" instead of using "uname -s" and "uname -r", and I
don't know what systems have a "uname -a" such that ignoring
everything up to the first '=' sign is useful.

If I change the sed command in line 3102 to use 's/^[^= ]*=//'
instead of 's/^[^=]*=//' then it work for me.  This will still
delete eveything up to and including the first '=' (in case
this is needed on some other system), but it will do so only
if there is no space between the beginning of the line and the
'=' (so it does not get confused on my system).



Home | Main Index | Thread Index | Old Index