Bug 211749

Summary: ports-mgmt/pkg: pkg install -r <disabled-repo> does not work, contrary to pkg-install(8)
Product: Ports & Packages Reporter: VK <vlad-fbsd>
Component: Individual Port(s)Assignee: freebsd-pkg (Nobody) <pkg>
Status: Open ---    
Severity: Affects Some People CC: arrowd, bapt, grahamperrin, kevans
Priority: --- Keywords: needs-qa
Version: LatestFlags: bugzilla: maintainer-feedback? (pkg)
Hardware: Any   
OS: Any   

Description VK freebsd_triage 2016-08-11 08:23:00 UTC
When installing packages from a disabled repo with pkg install -r, the manpage suggests it should not respect the "active" status of the repo ('irrespective of the configured "active" status from repo.conf'), meaning it will install from disabled repos, however that is not the case:

> # grep enabled /usr/local/etc/pkg/repos/FreeBSD.conf 
>   enabled: no
> 
> # pkg install -r FreeBSD openjdk
> No repositories are enabled.

Enabling the repo allows installation from it with -r.
Comment 1 VK freebsd_triage 2016-08-11 08:27:53 UTC
# pkg info pkg
pkg-1.8.7_1
Name           : pkg
Version        : 1.8.7_1
Installed on   : Thu Aug  4 13:55:40 2016 CEST
Origin         : ports-mgmt/pkg
Architecture   : freebsd:11:x86:64
Prefix         : /usr/local
Categories     : ports-mgmt
Licenses       : BSD2CLAUSE
Maintainer     : pkg@FreeBSD.org
WWW            : http://wiki.freebsd.org/pkgng
Comment        : Package manager
Shared Libs provided:
        libpkg.so.3
Annotations    :
        repo_type      : binary
        repository     : Poudriere
Flat size      : 10.9MiB
Description    :
Package management tool

WWW: http://wiki.freebsd.org/pkgng
Comment 2 VK freebsd_triage 2016-11-26 17:01:47 UTC
Looking at the source code, it would appear that the manpage is wrong. For example, given repo is explicitly checked if enabled:

* update:
  https://github.com/freebsd/pkg/blob/master/src/update.c#L69

* install falls through update:
  https://github.com/freebsd/pkg/blob/master/src/install.c#L197

Can we get some feedback here? If this is the intended behavior, then the solution is to correct the manpage.

Thanks.
Comment 3 Gleb Popov freebsd_committer freebsd_triage 2019-08-02 10:43:05 UTC
I'd like to bump this bug. It is pretty annoying in my use-case.
Comment 4 Gleb Popov freebsd_committer freebsd_triage 2020-06-04 16:47:26 UTC
Any progress on this?
Comment 5 Kyle Evans freebsd_committer freebsd_triage 2020-06-04 16:49:10 UTC
CC'ing bapt@ specifically, though I reckon he probably reads -pkg@ as well