Skip to content

Commit

Permalink
freebsd-update: Correctly check if pkg(8) is present
Browse files Browse the repository at this point in the history
On systems without pkg(8) installed, `command -v pkg` will return
success and falsely report that pkg(8) is present. Fix that by checking
via the `pkg -N` form.

This is missing from the final revision of D39695.

Reported by:	delphij
Reviewed by:	fernape, delphij
Fixes:		bc0c6c9 freebsd-update: Add check for kernel modules
Differential Revision:	https://reviews.freebsd.org/D45292
  • Loading branch information
gmshake committed May 23, 2024
1 parent 9fc5e3f commit d76ef58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion usr.sbin/freebsd-update/freebsd-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ upgrade_check_kmod_ports() {
local report
local w

if ! command -v pkg >/dev/null; then
if ! pkg -N 2>/dev/null; then
echo "Skipping kernel modules check. pkg(8) not present."
return
fi
Expand Down

0 comments on commit d76ef58

Please sign in to comment.