Bug 260467

Summary: /usr/sbin/pkg cannot add ports-mgmt/pkg via directory path (breaks nanobsd)
Product: Base System Reporter: 606u
Component: binAssignee: Gleb Smirnoff <glebius>
Status: Closed FIXED    
Severity: Affects Some People CC: grahamperrin, jlduran, markj
Priority: ---    
Version: 12.3-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Fix none

Description 606u 2021-12-16 08:20:38 UTC
Created attachment 230168 [details]
Fix

Basically

    /usr/sbin/pkg add -f -y pkg-1.2.3.pkg

works correctly, whereas

    /usr/sbin/pkg add -f -y /path/to/pkg-1.2.3.pkg

does not, due to the way `pkg_is_pkg_pkg()` tests if package is ports-mgmt/pkg.

This behaviour breaks nanobsd scripts, as well.
Comment 1 Jose Luis Duran 2024-01-25 00:28:43 UTC
I think this was fixed in:

https://cgit.freebsd.org/src/commit/?id=c96b4d87ba3336e6d4bea04c49d6abde158b7aae
Comment 2 Mark Johnston freebsd_committer freebsd_triage 2024-01-25 15:45:51 UTC
(In reply to Jose Luis Duran from comment #1)
I believe you're right.  I've hit this in the past as well.