Skip to content

[WIP] Add pkg upgradable - #2776

Draft
dag-erling wants to merge 1 commit into
freebsd:mainfrom
dag-erling:des/upgradable
Draft

dag-erling wants to merge 1 commit into
freebsd:mainfrom
dag-erling:des/upgradable

Conversation

@dag-erling

@dag-erling dag-erling commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

This PR adds pkg-upgradable(8), which takes roughly the same command-line syntax as pkg-upgrade(8) and exits zero if and only if at least one package in the selected set has a newer version available. If run without --quiet, it also prints one line for each such package. Note that it (very deliberately) does not attempt to run the solver, so the actual result of pkg-upgrade(8) may differ from what pkg-upgradable(8) thinks will happen, but it is good enough for use in scripts to answer the question “are there any updates available for my installed packages?”

Still to do:

  • Update the repositories if permitted and --no-repo-update was not specified
  • Add mentions in the pkg-upgrade(8) and pkg-version(8) manual pages
  • Add a brief mention in pkg(8)
  • Add cross-references to other relevant manual pages
  • Ignore locked packages (possibly controlled by a cli option?)
  • Add tests
  • Write a proper commit message

This new command provides an easy way for scripts to determine whether
updates are available for any currently installed package, or for a
specific currently installed package or set of packages.  Locked
packages are ignored unless --force / -f is specified.

The command-line syntax is largely the same as for upgrade, and the
output (if --quiet / -q is not specified) is largely the same as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant