nut-driver-enumerator: preserve and decode ups.conf values once - #3635
Open
user01010111 wants to merge 2 commits into
Open
nut-driver-enumerator: preserve and decode ups.conf values once#3635user01010111 wants to merge 2 commits into
user01010111 wants to merge 2 commits into
Conversation
Preserve quotes and backslashes during ups.conf normalization, then decode the first value token when queried. Keep full and section caches consistent for values, media classification and checksums, including quoted multiline values. Document possible one-time reconciliation after upgrading. Extend existing self-tests and fixtures. Validated across macOS/Linux shells and awk implementations, corrected-C comparisons, generated/staged packages, documentation checks and distcheck-light. Related: networkupstools#3629 AI assistance: OpenAI Codex with gpt-6-astra (high reasoning) and gpt-daybreak-blue-latest (high reasoning). The human contributor remains responsible for reviewing and submitting the change. Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
8 tasks
|
A ZIP file with standard source tarball and another tarball with pre-built docs for commit cb02364 is temporarily available: NUT-tarballs-PR-3635.zip. |
|
✅ Build nut 2.8.5.5261-master completed (commit 22a26b9bba by @user01010111)
|
|
✅ Build nut 2.8.5.5261-master completed (commit 22a26b9bba by @user01010111) |
Use the explicit six C whitespace bytes in the value lexer because Trusty's mawk 1.3.3 does not implement the named whitespace class. Preserve the existing C locale, token rules and test expectations. The existing Trusty runtime tests improve from 133 pass/3 fail to 136/0 under each of sh, bash and dash. A 256-byte oracle, modern shell/awk checks, build, make check, staged package checks, spelling/style and complete-manual distcheck-light pass. These runtime checks do not reconstruct the exact Jenkins image; authenticated Jenkins failure logs remain unavailable, so this does not claim every CI error is resolved. Related: networkupstools#3635 AI assistance: OpenAI Codex with gpt-6-astra (high reasoning). The human contributor remains responsible for reviewing and submitting the change. Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
|
✅ Build nut 2.8.5.5264-master completed (commit 387998b592 by @user01010111)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
nutdrv_qx,port = "auto" # commentcurrently leaves the mediaunclassified. NDE returns the comment as part of the value; its normalization,
section reads and
echocalls also strip or reinterpret quotes andbackslashes. Escaped paths can therefore produce different values and
checksums under different shells.
Preserve syntax in normalized configuration text and decode the first value
token once in
upsconf_getValue, using POSIX awk (already a dependency).Double quotes group a token, unquoted hashes start comments, backslash
escapes the next character, and single quotes remain literal. Quoted tokens
can span physical lines; newlines are omitted as in C. Full and
section/driver/port caches now agree on the covered values and media.
Keep existing flag, missing-key and multiple-key output contracts and the
normalized-text checksum format with its final newline. Extend the existing
test script and distributed fixture, correct their known wrong expectations,
and document changed output and possible one-time reconciliation on upgrade.
This is the NDE follow-up to the parsing discussion in #3629. The C parser's
quoted-hash correction is a separate contribution.
Validation:
2caa3c87501a1aba25a3070ad66757470bd1bf03reproduces unclassified quoted
autoand corrupted backslash paths.The expanded harness records 66 failed checks across four macOS shells;
the patched harness has no failures.
ksh93 and BusyBox ash pass, including quotes, hashes, backslashes,
apostrophes, equals, empty/space values, continuations, flags, missing
and repeated keys, full/SDP agreement, media and stable checksums.
All 26 direct comparisons match the separately corrected C parser,
including the three quoted-hash cases rejected by unmodified C and
two quoted-multiline cases. The previous NDE patch fails five checks
against the added multiline regressions; the final patch passes.
distcheck-light pass. Real manual pages and HTML release/upgrade notes
are generated. The distribution check builds, tests, installs,
uninstalls and cleans the extracted archive.
NDE and a staged systemd-package installation both pass the five-shell
Linux harness. macOS build and all eight Automake tests pass after
allowing the existing test to bind its localhost socket.
No physical UPS hardware was available for testing. Validation covered
NDE self-tests, deterministic parsing and checksum comparisons, direct
C-parser comparisons, and generated/staged software package checks.
Physical UPS models, firmware versions, and hardware combinations were
not tested.
Live systemd/SMF registration was not exercised; all NDE runs used
SERVICE_FRAMEWORK=selftest, temporary configuration andAUTO_START=no.Legacy Solaris/illumos and other BSD platforms were not executed.
Relevant checklist:
AI assistance: OpenAI Codex with gpt-6-astra (high reasoning)
and gpt-daybreak-blue-latest (high reasoning).
The human contributor remains responsible for reviewing and submitting
the change.