pkgtools chokes on the new version name :-/

walt wa1ter at myrealbox.com
Thu Jul 15 11:48:07 PDT 2004


When I run pkgdb -F the program halts with this message:
uname(1) could be broken - cannot parse the output: 1.0A-RELEASE i386
** Error occured reading /usr/local/etc/pkgtools.conf:
        uninitialized constant PkgConfig::OS_PLATFORM
This is the code from /usr/local/lib/ruby/site_ruby/1.8/pkgtools.rb
Anyone know enough ruby to decipher this?
  uname = `uname -rm`.chomp
  if m = /^(((\d+)(?:\.\d+)+)-(\w+)(-\S+)?) (\w+)$/.match(uname)
    OS_RELEASE, OS_REVISION, OS_MAJOR,
      OS_BRANCH, os_patchlevel, OS_PLATFORM = m[1..-1]
    OS_PATCHLEVEL = os_patchlevel || ""
    case OS_BRANCH
    when /^CURRENT$/    # <n>-current
      OS_PKGBRANCH = sprintf('%s-%s', OS_MAJOR, OS_BRANCH.downcase)
    when /^RELEASE$/    # <n>.<m>-release
      OS_PKGBRANCH = sprintf('%s-%s', OS_REVISION, OS_BRANCH.downcase)
    else                # <n>-stable
      # when /^(PRERELEASE|RC\d*|ALPHA|BETA)$/
      OS_PKGBRANCH = sprintf('%s-%s', OS_MAJOR, 'stable')
    end
  else
    STDERR.puts "uname(1) could be broken - cannot parse the output: #{uname}"
  end




More information about the Bugs mailing list