From nobody@FreeBSD.org  Mon Sep  2 04:49:36 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8654437B400
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  2 Sep 2002 04:49:36 -0700 (PDT)
Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 24FCD43E42
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  2 Sep 2002 04:49:36 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g82BnUOT008013
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 2 Sep 2002 04:49:30 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.4/8.12.4/Submit) id g82BnUvN008012;
	Mon, 2 Sep 2002 04:49:30 -0700 (PDT)
Message-Id: <200209021149.g82BnUvN008012@www.freebsd.org>
Date: Mon, 2 Sep 2002 04:49:30 -0700 (PDT)
From: HM Lim <hm@eaglet.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: portupgrade pkgtools.rb OS_PLATFORM error
X-Send-Pr-Version: www-1.0

>Number:         42322
>Category:       ports
>Synopsis:       portupgrade pkgtools.rb OS_PLATFORM error
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    knu
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 02 04:50:01 PDT 2002
>Closed-Date:    Fri Sep 13 13:53:54 JST 2002
>Last-Modified:  Fri Sep 13 13:53:54 JST 2002
>Originator:     HM Lim
>Release:        4.5-20020428-STABLE i386
>Organization:
>Environment:
FreeBSD myhostname 4.5-20020402-STABLE FreeBSD 4.5-20020402-STABLE #0: Wed Jul  3 00:38:04 GMT 2002    root@myhostname:/usr/obj/usr/src/sys/myhostname  i386
>Description:
the the post processing of "uname -rn" function  at lib/pkgtools.rb can't
parse a result like

"4.5-20020428-STABLE i386"


---line 702 pkgtools.rb----
if m = /^(((\d+)(?:\.\d+)+)-(\w+)(-p\d+)?) (\w+)$/.match(uname)
   OS_RELEASE, OS_REVISION, OS_MAJOR,
     OS_BRANCH, os_patchlevel, OS_PLATFORM = m[1..-1]
  OS_PATCHLEVEL = os_patchlevel || ""
  else
    STDERR.puts "uname(1) could be broken - cannot parse the output:
#{uname}"
  end
----END SNIP----
>How-To-Repeat:
install FreeBSD from the STABLE branch via data timestamp
use current portupgrade tools
and the following will appear in the STDERR
---SNIP--
uname(1) could be broken - cannot parse the output: 4.5-20020402-STABLE i386
** Error occured reading /usr/local/etc/pkgtools.conf:
        uninitialized constant OS_PLATFORM at PkgConfig
---SNIP--


>Fix:
revert back to the portupgrade-20020429_1 version of similar regex
as below to get it working. This will break other RELEASE/PATCHLEVEL formats.

----START SNIP---
if m = /^(((\d+)(?:\.\d+)+)-(\w+)(?:\S*)) (\w+)$/.match(uname)
OS_RELEASE, OS_REVISION, OS_MAJOR, OS_BRANCH, OS_PLATFORM = m[1..-1]
else
STDERR.puts "uname(1) could be broken - cannot parse the output: #{uname}"
end
----END SNIP----
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->knu 
Responsible-Changed-By: lioux 
Responsible-Changed-When: Mon Sep 2 05:40:31 PDT 2002 
Responsible-Changed-Why:  
Over to maintainer(s) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42322 
State-Changed-From-To: open->closed 
State-Changed-By: knu 
State-Changed-When: Fri Sep 13 13:53:22 JST 2002 
State-Changed-Why:  
The latest version should be able to parse any uname(1) output. 

Thanks for the report. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42322 
>Unformatted:
