Skip to content

Fix early debug#2704

Merged
bapt merged 2 commits into
freebsd:mainfrom
dag-erling:des/early-debug
Jun 21, 2026
Merged

Fix early debug#2704
bapt merged 2 commits into
freebsd:mainfrom
dag-erling:des/early-debug

Conversation

@dag-erling

Copy link
Copy Markdown
Member
  • libpkg: Fix early debug

    • Initialize ctx.debug_flags to all-bits-one so pkg_dbg() can be used
      before pkg_ini() has read the configuration.

    • In pkg_ini(), only set ctx.debug_level if the new value (from the
      configuration or environment) is greater than the current value.

  • main: Don't set debug level twice

    Now that pkg_ini() no longer clears the debug level, it is enough to set
    it once, immediately after the getopt_long() loop.

* Initialize ctx.debug_flags to all-bits-one so pkg_dbg() can be used
  before pkg_ini() read the configuration.

* In pkg_ini(), only set ctx.debug_level if the new value (from the
  configuration or environment) is greater than the current value.
Now that pkg_ini() no longer clears the debug level, it is enough to set
it once, immediately after the getopt_long() loop.
@bapt bapt merged commit 31aa72e into freebsd:main Jun 21, 2026
8 checks passed
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.

2 participants