Bug 267657 - ports-mgmt/pkg upgrade prompts to install if package is missing
Summary: ports-mgmt/pkg upgrade prompts to install if package is missing
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Baptiste Daroussin
URL:
Keywords: needs-qa, regression
Depends on:
Blocks:
 
Reported: 2022-11-09 02:43 UTC by Ryan
Modified: 2022-11-11 05:57 UTC (History)
3 users (show)

See Also:
koobs: maintainer-feedback+
koobs: maintainer-feedback? (bapt)
koobs: merge-quarterly?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan 2022-11-09 02:43:40 UTC
This behavior is not what is outlined in the manpage. This has changed in the last few months (or longer, not sure exactly) as I used to be able to invoke this via Ansible and the pkg upgrade process would skip hosts where the package was not installed. Now, if adding "-y" all hosts will receive the new package even if it previously did not exist.

pkg-upgrade(8)"... Moreover, pkg upgrade will not install new packages, except as required to fulfil dependencies of the packages listed on the command line..."
Comment 1 Ryan 2022-11-09 02:59:16 UTC
This becomes a problem when calling the following command from Ansible:
`pkg upgrade -y [pkg name]`
As this will now install the missing package(s) instead of only upgrading existing packages.

Example command invocation directly on a test server (FreeBSD 13.1-RELEASE-p3 GENERIC amd64):

(pts/4)[root@server1:~]# pkg info nginx
pkg: No package(s) matching nginx

(pts/4)[root@server1:~]# pkg upgrade nginx
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	nginx: 1.22.1_1,3

Installed packages to be UPGRADED:
	pcre: 8.45_1 -> 8.45_3

Number of packages to be installed: 1
Number of packages to be upgraded: 1

The process will require 1 MiB more space.
2 MiB to be downloaded.

Proceed with this action? [y/N]:
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2022-11-10 05:45:46 UTC
not sure when this was introduced and what is the right behaviour we should have, I will dig into it, thanks.
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2022-11-10 22:46:28 UTC
^Triage: Assign to committer investigating & pending feedback