Bug 260467 - /usr/sbin/pkg cannot add ports-mgmt/pkg via directory path (breaks nanobsd)
Summary: /usr/sbin/pkg cannot add ports-mgmt/pkg via directory path (breaks nanobsd)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.3-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Gleb Smirnoff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-16 08:20 UTC by 606u
Modified: 2024-01-25 15:45 UTC (History)
3 users (show)

See Also:


Attachments
Fix (557 bytes, text/plain)
2021-12-16 08:20 UTC, 606u
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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 freebsd_committer freebsd_triage 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.