From owner-freebsd-questions@FreeBSD.ORG Mon May 8 17:41:52 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 095D916A401 for ; Mon, 8 May 2006 17:41:52 +0000 (UTC) (envelope-from parv@pair.com) Received: from mta10.adelphia.net (mta10.adelphia.net [68.168.78.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E24A43D45 for ; Mon, 8 May 2006 17:41:51 +0000 (GMT) (envelope-from parv@pair.com) Received: from default.chvlva.adelphia.net ([69.160.66.115]) by mta10.adelphia.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20060508174150.UVGA14145.mta10.adelphia.net@default.chvlva.adelphia.net>; Mon, 8 May 2006 13:41:50 -0400 Received: by default.chvlva.adelphia.net (Postfix, from userid 1000) id CF65DB76B; Mon, 8 May 2006 13:42:09 -0400 (EDT) Date: Mon, 8 May 2006 13:42:09 -0400 From: Parv To: Perttu Laine Message-ID: <20060508174209.GB973@holestein.holy.cow> Mail-Followup-To: Perttu Laine , freebsd-questions@freebsd.org References: <571463983.20060508130703@rulez.sk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: freebsd-questions@freebsd.org Subject: Re: 7-CURRENT X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2006 17:41:52 -0000 in message , wrote Perttu Laine thusly... > > Thank's. work fine. Now I have another question about 7-CURRENT. > portupgrade and portversion are giving this error: > --- > uname(1) could be broken - cannot parse the output: 7-CURRENT-SNAP009 i386 > ** Error occured reading /usr/local/etc/pkgtools.conf: > uninitialized constant PkgConfig::OS_PLATFORM > --- > > So. How can one make those pkgtools working? :) That seems like a bug in portupgrade (pkgtools.rb is installed as part of portupgrade) due to, most likely, limited set of rules to parse uname(1) output. Please file a problem report via send-pr(1). I can't help myself but look in source; here is the line 982 in pkgtools.rb (portupgrade 2.0.1_1,1) which fails to parse uname(1) output ... 980 uname = `uname -rm`.chomp 981 982 if m = /^(((\d+)(?:\.\d+[^.\-]*?)+)-(\w+)(-\S+)?) (\w+)$/.match(uname) ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ minor ^ version required minor version match 983 OS_RELEASE, OS_REVISION, OS_MAJOR, 984 OS_BRANCH, os_patchlevel, OS_PLATFORM = m[1..-1] 985 OS_PATCHLEVEL = os_patchlevel || "" (I don't know how close Ruby & Perl regular expressions (regexps) are, below analysis is according to Perl rules.) Above regex fails, when there is no minor version since matching of minor version is not optional. To get past that, regex should be ... /^(((\d+)(?:\.\d+[^.\-]*?)?)-(\w+)(-\S+)?) (\w+)$/ ^ ^ optional match - Parv --