cmds.projects.CmdCreatePkgConfig: Fix Requires lines and add integration test #101

Merged
Jan Lindemann merged 2 commits from jan/fix/20260913-create-pkg-config-requires into master 2026-09-13 23:03:22 +02:00 AGit

This PR fixes the Requires line generation in create-pkg-config (double commas for comma-separated input, missing trailing newline) and adds an integration test that pins the generated pkg-config file against a reference:

cmds.projects.CmdCreatePkgConfig: Fix Requires lines

__cleanup_requires() replaces every run of whitespace with ", " before re-pairing the version constraints, so input that is already comma-separated, e.g. "jw-core >= 1.0, jw-base", comes out with a double comma, "jw-core >= 1.0,, jw-base". And the Requires line is appended without a trailing newline, so a following Requires.private line runs straight into it.

Split the input on commas and whitespace, treating the version constraint operators as delimiters that are re-paired with the preceding name and the following version, so that comma- and space-separated input alike comes out as a clean ", "-joined list. Add the missing newline after the Requires line.

test/integration/projects/create-pkg-config: Add

create-pkg-config's output is not covered by any test, even though the template and the Requires cleanup produce exact text that pkg-config consumes, so regressions in the generated file went unnoticed for a long time.

Add an integration test that runs create-pkg-config with a full option set, with space- and comma-mixed Requires input, and with a Requires.private-only input, and compares the output against a reference file.

This PR fixes the Requires line generation in create-pkg-config (double commas for comma-separated input, missing trailing newline) and adds an integration test that pins the generated pkg-config file against a reference: #### cmds.projects.CmdCreatePkgConfig: Fix Requires lines __cleanup_requires() replaces every run of whitespace with ", " before re-pairing the version constraints, so input that is already comma-separated, e.g. "jw-core >= 1.0, jw-base", comes out with a double comma, "jw-core >= 1.0,, jw-base". And the Requires line is appended without a trailing newline, so a following Requires.private line runs straight into it. Split the input on commas and whitespace, treating the version constraint operators as delimiters that are re-paired with the preceding name and the following version, so that comma- and space-separated input alike comes out as a clean ", "-joined list. Add the missing newline after the Requires line. #### test/integration/projects/create-pkg-config: Add create-pkg-config's output is not covered by any test, even though the template and the Requires cleanup produce exact text that pkg-config consumes, so regressions in the generated file went unnoticed for a long time. Add an integration test that runs create-pkg-config with a full option set, with space- and comma-mixed Requires input, and with a Requires.private-only input, and compares the output against a reference file.
__cleanup_requires() replaces every run of whitespace with ", " before
re-pairing the version constraints, so input that is already
comma-separated, e.g. "jw-core >= 1.0, jw-base", comes out with a double
comma, "jw-core >= 1.0,, jw-base". And the Requires line is appended
without a trailing newline, so a following Requires.private line runs
straight into it.

Split the input on commas and whitespace, treating the version constraint
operators as delimiters that are re-paired with the preceding name and the
following version, so that comma- and space-separated input alike comes out
as a clean ", "-joined list. Add the missing newline after the Requires
line.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
Signed-off-by: Jan Lindemann <jan@janware.com>
test/integration/projects/create-pkg-config: Add
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m16s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m37s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m27s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m24s
CI / Packaging test (push) Successful in 0s
cb07ccdb7a
create-pkg-config's output is not covered by any test, even though the
template and the Requires cleanup produce exact text that pkg-config
consumes, so regressions in the generated file went unnoticed for a long
time.

Add an integration test that runs create-pkg-config with a full option set,
with space- and comma-mixed Requires input, and with a
Requires.private-only input, and compares the output against a reference
file.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-09-13 22:53:14 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!101
No description provided.