Bug 192703 - ports-mgmt/pkg: pkg install uses the wrong repository for some packages
Summary: ports-mgmt/pkg: pkg install uses the wrong repository for some packages
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-pkg (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-16 11:58 UTC by Mike Clarke
Modified: 2017-12-17 07:12 UTC (History)
4 users (show)

See Also:


Attachments
FreeBSD.conf (257 bytes, text/plain)
2014-08-16 11:58 UTC, Mike Clarke
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Clarke 2014-08-16 11:58:34 UTC
Created attachment 145869 [details]
FreeBSD.conf

curlew:/root# uname -a
FreeBSD curlew.lan 10.0-RELEASE-p7 FreeBSD 10.0-RELEASE-p7 #0: Tue Jul  8 06:37:44 UTC 2014     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

curlew:/root# pkg info -E pkg
pkg-1.3.6

curlew:/root# ls /usr/local/etc/pkg/repos/
FreeBSD.conf            FreeBSD_new_xorg.conf

Attempts to install the following packages cause them to be downloaded from the FreeBSD repository 

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
curlew:/root# pkg install -f xf86-input-mouse xf86-video-vesa xf86-video-nv xf86-input-keyboard nepomuk-core nepomuk-widgets  
Updating repository catalogue
FreeBSD repository is up-to-date
FreeBSD_new_xorg repository is up-to-date
All repositories are up-to-date
The following 6 packages will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        xf86-input-mouse-1.9.0_3 [FreeBSD]
        nepomuk-core-4.12.5 [FreeBSD]
        nepomuk-widgets-4.12.5 [FreeBSD]
        xf86-video-vesa-2.3.3_3 [FreeBSD]
        xf86-video-nv-2.1.20_4 [FreeBSD]
        xf86-input-keyboard-1.8.0_2 [FreeBSD]

The process will require 10 KB more space
128 KB to be downloaded

Proceed with this action [y/N]: 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

But they exist in FreeBSD_new_xorg as well as FreeBSD

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
curlew:/root# pkg rquery "%n %v %R" xf86-input-mouse xf86-video-vesa xf86-video-nv xf86-input-keyboard nepomuk-core nepomuk-widgets

xf86-input-mouse 1.9.0_3 FreeBSD
xf86-input-mouse 1.9.0_3 FreeBSD_new_xorg
xf86-video-vesa 2.3.3_3 FreeBSD
xf86-video-vesa 2.3.3_3 FreeBSD_new_xorg
xf86-video-nv 2.1.20_4 FreeBSD
xf86-video-nv 2.1.20_4 FreeBSD_new_xorg
xf86-input-keyboard 1.8.0_2 FreeBSD
xf86-input-keyboard 1.8.0_2 FreeBSD_new_xorg
nepomuk-core 4.12.5 FreeBSD
nepomuk-core 4.12.5 FreeBSD_new_xorg
nepomuk-widgets 4.12.5 FreeBSD
nepomuk-widgets 4.12.5 FreeBSD_new_xorg
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

The correct versions are only installed if I use the -r option.

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
curlew:/root# pkg install -f -r FreeBSD_new_xorg xf86-input-mouse xf86-video-vesa xf86-video-nv xf86-input-keyboard nepomuk-core nepomuk-widgets
Updating "FreeBSD_new_xorg" repository catalogue
FreeBSD_new_xorg repository is up-to-date
All repositories are up-to-date
Checking integrity... done (0 conflicting)
The following 6 packages will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        xf86-input-mouse-1.9.0_3 [FreeBSD_new_xorg]
        nepomuk-core-4.12.5 [FreeBSD_new_xorg]
        nepomuk-widgets-4.12.5 [FreeBSD_new_xorg]
        xf86-video-vesa-2.3.3_3 [FreeBSD_new_xorg]
        xf86-video-nv-2.1.20_4 [FreeBSD_new_xorg]
        xf86-input-keyboard-1.8.0_2 [FreeBSD_new_xorg]

Proceed with this action [y/N]: n          
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

This workaround solved the immediate problem but does require knowledge of which repository must be used for each package.

I can't check to see if pkg upgrade will have the same problem because all my packages are up to date but it will be a more serious problem if it does.
Comment 1 Mike Clarke 2014-08-16 12:02:49 UTC
Not sure how to add  a second attachment so here's my copy of FreeBSD_new_xorg.conf

# /usr/local/etc/pkg/repos/FreeBSD_new_xorg.conf
# It is still required to have /etc/pkg/FreeBSD.conf installed and enabled.
# If that file is missing or if /usr/share/keys/pkg is missing see:
# http://www.freebsd.org/security/advisories/FreeBSD-EN-14:03.pkg.asc

FreeBSD_new_xorg: {
   url: "pkg+http://pkg.FreeBSD.org/${ABI}/new_xorg",
   mirror_type: "srv",
   signature_type: "fingerprints",
   fingerprints: "/usr/share/keys/pkg",
   enabled: yes
}
Comment 2 John Marino freebsd_committer 2014-08-16 12:43:01 UTC
over to maintainer group
Comment 3 elofu17 2014-12-18 15:57:43 UTC
I too have this issue.

My compiled package in my-repo is installed and annotated correctly with "my-repo", but still 'pkg upgrade' wants to fetch the package from the FreeBSD-repo.

The stickyness don't work. :(
Comment 4 Baptiste Daroussin freebsd_committer 2014-12-29 23:43:45 UTC
pkg 1.4.3 brings lots of fixes for multi repository:
CONSERVATIVE_UPGRADE (to put in pkg.conf) to ensure a package has priority from where it was installed from
priority: <number> (to put in repository configuration files) to make a repository having hight priority than others
Comment 5 elofu17 2015-01-13 15:26:39 UTC
Hi Baptiste!

Thanks. The CONSERVATIVE_UPGRADE mode in 1.4.3 works fine.
Ports annotated to myrepo is now upgraded from myrepo while the rest is taken from FreeBSD. Good.



However, I think you need to explain more about Priority, and possibly remove conflicting information, in the manpage for pkg.conf.

I assume that "priority" and "repo order" are the same thing.
The command 'pkg -v -v' show the repo order.
No matter if I set priority: 15 on myrepo and priority: 1 on FreeBSD, or vice versa, 'pkg -v -v' always show FreeBSD first and then myrepo.

If this is *not* an error, this need to be better explained in the manual.

Right now the manual states:
     Repositories are prioritized in the order they are found on the REPOS_DIR
     search path, with individual repository configuration files in the same
     directory processed in alphabetical order.  Earlier files take prece-
     dence, meaning that packages will be downloaded from them preferentially
     where the same package is available from several repositories.  This be-
     haviour may be overridden per-package by adding a repository annotation
     to the installed package.  See pkg-repository(8) for details.
I believe this needs to be updated.


Also, 'pkg -v -v' should be updated to always show the Priority of each listed repo (which it doesn't in v1.4.3), imho.
Comment 6 Baptiste Daroussin freebsd_committer 2015-01-17 18:10:03 UTC
Yes the documentation needs to be updated pull request welcomed :)
Comment 7 vali gholami 2017-12-17 07:12:56 UTC
MARKED AS SPAM