Skip to content

libpkg: fix --register-only with empty packages#2630

Merged
bapt merged 1 commit intofreebsd:mainfrom
ifreund:reg-only-empty
Mar 24, 2026
Merged

libpkg: fix --register-only with empty packages#2630
bapt merged 1 commit intofreebsd:mainfrom
ifreund:reg-only-empty

Conversation

@ifreund
Copy link
Copy Markdown
Contributor

@ifreund ifreund commented Mar 24, 2026

Currently we end up calling archive_read_next_header() in populate_config_file_contents() even when there are no files in the package. This results in the following libarchive error:

pkg: archive_read_next_header(): INTERNAL ERROR: Function 'archive_read_next_header' invoked with archive structure in state 'eof', should be in state 'header/data'

This commit fixes the error and adds a test to prevent regression.

Sponsored by: The FreeBSD Foundation

Currently we end up calling archive_read_next_header() in
populate_config_file_contents() even when there are no files in the
package. This results in the following libarchive error:

pkg: archive_read_next_header(): INTERNAL ERROR: Function
'archive_read_next_header' invoked with archive structure in
state 'eof', should be in state 'header/data'

This commit fixes the error and adds a test to prevent regression.

Sponsored by:	The FreeBSD Foundation
@bapt bapt merged commit 1f99b96 into freebsd:main Mar 24, 2026
5 of 8 checks passed
@ifreund ifreund deleted the reg-only-empty branch March 24, 2026 14:07
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