Subject: bin/36941: pkg_add fails to pick newest package version
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Andreas Gustafsson <gson@gson.org>
List: netbsd-bugs
Date: 09/07/2007 07:50:00
>Number:         36941
>Category:       bin
>Synopsis:       pkg_add fails to pick newest package version
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 07 07:50:00 +0000 2007
>Originator:     Andreas Gustafsson
>Release:        NetBSD 4.99.26
>Organization:
>Environment:
System: NetBSD guam.gson.org 4.99.26 NetBSD 4.99.26 (GUAM) #0: Wed Aug 22 17:56:11 EEST 2007 gson@guru.araneus.fi:/usr/src/sys/arch/i386/compile/GUAM i386
Architecture: i386
Machine: i386
>Description:

I just tried to upgrade the Opera web browser from a binary package
using the command

  pkg_add -v -u -u opera

with PKG_PATH pointing at a private repository of -current binary
packages accessed over HTTP.  Even though the pkg_add man page says
that "If you omit the version number, pkg_add will install the latest
version available", pkg_add picked the obsolete version 9.0:

   # pkg_add -v -u -u opera
   parsing: http://pkg.araneus.fi/All
   path: http://pkg.araneus.fi/All
   increasing RLIMIT_NOFILE to max. 256 open files
   trying PKG_PATH http://pkg.araneus.fi/All
   pkg_add: nothing appropriate found
   pkg_add: nothing appropriate found
   pkg_add: nothing appropriate found
   best match: 'http://pkg.araneus.fi/All/opera-9.0.tgz'
   'http://pkg.araneus.fi/All/opera-[0-9]*.t[bg]z' expanded to 'http://pkg.araneus.fi/All/opera-9.0.tgz'
   Trying to fetch http://pkg.araneus.fi/All/opera-9.0.tgz.
   best match: 'http://pkg.araneus.fi/All/opera-9.0.tgz'

When I explicity specified the version number with

  pkg_add -v -u -u opera-9.23

pkg_add did the right thing and installed version 9.23.

This is using pkg_add version 20070802:

  # pkg_add -V
  20070802

Here is a listing of the complete set of Opera packages pkg_add had to
choose from:

  -rw-r--r--  2 root  wheel  7179147 Jul 25  2006 opera-9.0.tgz
  -rw-r--r--  1 root  wheel  7181818 Sep 21  2006 opera-9.01.tgz
  -rw-r--r--  1 root  wheel  7257487 Dec  9  2006 opera-9.02.tgz
  -rw-r--r--  1 root  wheel  7211082 Mar  2  2007 opera-9.10.tgz
  -rw-r--r--  1 root  wheel  7296097 Apr 22 02:45 opera-9.20.tgz
  -rw-r--r--  1 root  wheel  7296291 Jul 14 23:30 opera-9.21.tgz
  -rw-r--r--  1 root  wheel  7300907 Jul 31 11:44 opera-9.22.tgz
  -rw-r--r--  1 root  wheel  7301442 Aug 24 23:47 opera-9.22nb1.tgz
  -rw-r--r--  1 root  wheel  7301058 Aug 31 05:12 opera-9.23.tgz

>How-To-Repeat:

Should be fairly obvious from the above.

>Fix:

Please.