Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Mar 2025 14:00:41 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 285197] ports-mgmt/pkg - v.2.0.6 - pkg-upgrade and pkg-version fail using multiple repositories
Message-ID:  <bug-285197-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D285197

            Bug ID: 285197
           Summary: ports-mgmt/pkg - v.2.0.6 - pkg-upgrade and pkg-version
                    fail using multiple repositories
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: pkg@FreeBSD.org
          Reporter: erichanskrs@gmail.com
             Flags: maintainer-feedback?(pkg@FreeBSD.org)
          Assignee: pkg@FreeBSD.org

Created attachment 258351
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D258351&action=
=3Dedit
pkg upgrade v. 2.0.6-Command SEQ

On my 14.2-RELEASE, using the 'latest' and 'quarterly' repository, pkg v.
2.0.6:

- pkg-upgrade fails with multiple repositories specified (-r) on the command
line.
- pkg-upgrade fails with multiple enabled repositories--no repositories
specified on the command line.

- pkg-version fails with multiple repositories specified (-r) on the command
line.
- pkg-version fails with multiple enabled repositories--no repositories
specified on the command line.

Tested with:
   net/realtek-re-kmod
   graphics/drm-61-kmod

In my view, this likely is a more general problem.


--- Relevant documentation relating to pkg v. 2.0.X and 2.0.6 in particular:
https://github.com/freebsd/pkg/blob/release-2.0/NEWS#L69-L70
/usr/local/share/doc/pkg/NEWS
mentions:
- pkg: -r command can be used multiple times to only enable
  the specified repositories.

https://github.com/freebsd/freebsd-ports/commit/460f6d861e431f8952debe0ee74=
c40a6a6a583e7
this commit mentions this -r option on the command line:
-r now always enable the repository mentioned

pkg-version(8) man page:
https://man.freebsd.org/cgi/man.cgi?query=3Dpkg-version&manpath=3DFreeBSD+P=
orts+14.2&arch=3Ddefault&format=3Dhtml
-r reponame, --repository reponame
   Compare installed package versions  to  packages  available
   from the named repository only, irrespective of the config-
   ured  "enabled"  status  from repo.conf.  By default, cata-
   logues for all enabled repositories are  used  for  version
   comparisons.  Implies -R.


--- Expected behaviour of pkg-upgrade
I expected A) (one upgrade command) and B) (sequence of two upgrade command=
s)
to have the same result:
A)  pkg upgrade -r FreeBSD -r FreeBSD-kmods drm-61-kmod
B)  pkg upgrade -r FreeBSD drm-61-kmod;
    pkg upgrade -r FreeBSD-kmods drm-61-kmod
C)  pkg upgrade drm-61-kmod

On 'latest':
A) fails and B) succeeds in upgrading drm-61-kmod from:
  drm-61-kmod-6.1.128.1401000_1
to:
  drm-61-kmod-6.1.128.1402000_1

Furthermore, I expected C) to succeed when both the repositories=20
  FreeBSD
  FreeBSD-kmods=20
are enabled, however, C) fails too.

For net/realtek-re-kmod, the upgrade from=20
   realtek-re-kmod-1100.00.1401000_1
to:
   realtek-re-kmod-1100.00.1402000_1
fails in the same manner.

For pkg-version(8) similar behaviour is expected as to indicating upgrades
using:
D)  pkg version -vRL=3D -r FreeBSD -r FreeBSD-kmods -n drm-61-kmod
E)  pkg version -vRL=3D -r FreeBSD -r FreeBSD-kmods -n realtek-re-kmod
F)  pkg version -vRL=3D -n drm-61-kmod
G)  pkg version -vRL=3D -n realtek-re-kmod
H)  pkg version -vRL=3D
all fail to indicate a viable upgrade to a newer version.
F), G) and H), should, according to the man page of pkg-version(8),
be using=20
"catalogues for all enabled repositories are  used  for  version comparison=
s"=20
as quoted above.

Note that the newer version is confirmed as having a higher numbered version
number by:
   pkg version -t

Only using the two-step version, like:
I)  pkg version -vRL=3D -r FreeBSD -n drm-61-kmod;
    pkg version -vRL=3D -r FreeBSD-kmods -n drm-61-kmod
J)  pkg version -vRL=3D -r FreeBSD;
    pkg version -vRL=3D -r FreeBSD-kmods
succeeds in providing a complete list of viable upgrades.

It is noted that where it concerns drm-61-kmod ( I) ), it is unnecessary to
first command
  pkg version -vRL=3D -r FreeBSD -n drm-61-kmod
because there happens to be a 14.2 specific version in its related pkg
('latest') repository present.
In the general case however, it seems currently necessary=20
to use the two-step variant to get a listing of all viable upgrades.


--- DEBUG Session
For the DEBUG session 'quarterly' is used; there,=20
A) fails and B) succeeds in upgrading drm-61-kmod from:
  drm-61-kmod-6.1.92.1401000_3
to:
  drm-61-kmod-6.1.128.1402000_1
The DEBUG Session is discussed in the next message of this PR.


--- Command sequence - non-DEBUG session
The commands used for this non-DEBUG session are:
[1-0] # date -u; uname -a; pkg -v
[2-0] # pkg info | egrep  '(realtek-re-kmod|drm-61-kmod)'
[3->1<] # pkg autoremove
[4-0] # pkg -vv | sed -n '/^Repositories:/,$ p'
[5-0] # pkg install realtek-re-kmod drm-61-kmod
[6-0] # sed.ekmods          # enabling the 'kmods' repository
[7-0] # pkg -vv | sed -n '/^Repositories:/,$ p'
[8-0] # pkg version -vRL=3D               #  fails to indicate viable upgra=
des:
[9-0] # pkg version -vRL=3D -n drm-61-kmod                #  fails to indic=
ate
viable upgrade:
[10-0] # pkg version -vRL=3D -r FreeBSD -r FreeBSD-kmods -n drm-61-kmod=20=
=20=20=20=20=20=20=20=20=20
#  fails to indicate viable upgrade:
[11-0] # pkg version -vRL=3D -r FreeBSD -n drm-61-kmod
[12-0] # pkg version -vRL=3D -r FreeBSD-kmods -n drm-61-kmod
[13-0] # pkg version -vRL=3D -n realtek-re-kmod           #  fails to indic=
ate
viable upgrade:
[14-0] # pkg version -vRL=3D -r FreeBSD -r FreeBSD-kmods -n realtek-re-kmod=
=20=20=20=20=20=20
        #  fails to indicate viable upgrade:
[15-0] # pkg version -vRL=3D -r FreeBSD -n realtek-re-kmod
[16-0] # pkg version -vRL=3D -r FreeBSD-kmods -n realtek-re-kmod
[17-0] # pkg rquery -x '%v\t%n' '(^drm-61-kmod|realtek-re-kmod[^0-9])'
[18-0] # pkg version -t 6.1.128.1401000_1 6.1.128.1402000_1
[19-0] # pkg version -t 1100.00.1401000_1 1100.00.1402000_1
[20-0] # pkg upgrade drm-61-kmod                #  upgrade fails:
[21-0] # pkg upgrade -r FreeBSD -r FreeBSD-kmods drm-61-kmod            #=20
upgrade fails:
[22-0] # pkg upgrade -r FreeBSD drm-61-kmod
[23-0] # pkg upgrade -r FreeBSD-kmods drm-61-kmod
[24-0] # pkg upgrade realtek-re-kmod            #  upgrade fails:
[25-0] # pkg upgrade -r FreeBSD -r FreeBSD-kmods realtek-re-kmod=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20
#  upgrade fails:
[26-0] # pkg upgrade -r FreeBSD realtek-re-kmod
[27-0] # pkg upgrade -r FreeBSD-kmods realtek-re-kmod


The attached command sequence details the failure and success of
   pkg-upgrade and pkg-version
Also, output of pkg rquery is used for pkg version comparison.

A selected part of this command sequences, detailing the failures and
successful upgrade:

[20-0] # pkg upgrade drm-61-kmod                #  upgrade fails:
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
Your packages are up to date.
[21-0] # pkg upgrade -r FreeBSD -r FreeBSD-kmods drm-61-kmod            #=20
upgrade fails:
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
FreeBSD, FreeBSD-kmods are up to date.
Checking integrity... done (0 conflicting)
Your packages are up to date.
[22-0] # pkg upgrade -r FreeBSD drm-61-kmod
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
FreeBSD is up to date.
Checking integrity... done (0 conflicting)
Your packages are up to date.
[23-0] # pkg upgrade -r FreeBSD-kmods drm-61-kmod
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
FreeBSD-kmods is up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
        drm-61-kmod: 6.1.128.1401000_1 -> 6.1.128.1402000_1 [FreeBSD-kmods]

Number of packages to be upgraded: 1

Proceed with this action? [y/N]: y
[1/1] Upgrading drm-61-kmod from 6.1.128.1401000_1 to 6.1.128.1402000_1...
[1/1] Extracting drm-61-kmod-6.1.128.1402000_1: 100%
[24-0] # pkg upgrade realtek-re-kmod            #  upgrade fails:
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
Your packages are up to date.
[25-0] #

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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