Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 May 2006 13:42:09 -0400
From:      Parv <parv@pair.com>
To:        Perttu Laine <plaine@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: 7-CURRENT
Message-ID:  <20060508174209.GB973@holestein.holy.cow>
In-Reply-To: <c6ef380c0605080448x34751450x7399dd2848bfb11e@mail.gmail.com>
References:  <c6ef380c0605080402t2afa3e94ke45d36ec1a13d58f@mail.gmail.com> <571463983.20060508130703@rulez.sk> <c6ef380c0605080425m2a812579g8d3bb3b6aa6808c9@mail.gmail.com> <c6ef380c0605080448x34751450x7399dd2848bfb11e@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
in message <c6ef380c0605080448x34751450x7399dd2848bfb11e@mail.gmail.com>,
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

-- 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060508174209.GB973>