Repository navigation
audit W8: cpio + ncurses remainder + specials vs oracle (#1462) - #1472
Merged
Merged
Conversation
…quested entry The builtin terminfo table moves verbatim out of tput.cpp into src/commands/terminfo_table.h so the ncurses family answers from one oracle-verified subset. infocmp is rebuilt on it: it used to ignore operands and $TERM entirely and always print one hardcoded entry with exit code 0. It now dumps the requested terminal (operand, else $TERM) in GNU infocmp source format (canonical capability order, _nc_tic_expand escaping, -1 one-per-line), keeps the shipped windows-ansi entry, and errors on unknown names exactly like GNU (strict lookup, unlike tput's xterm fallback). Multiple operands report the unimplemented comparison modes instead of silently answering for the first. Refs #1462
tic: a source-file operand now fails on stderr with exit 1 (nothing is compiled) instead of printing the notice on stdout with exit 0. reset: -q prints the resolved type on stdout and changes nothing (tset noset); -r always reports 'Terminal type is %s.' on stderr; -s uses the resolved type (operand, else $TERM) with the csh setenv form when $SHELL ends in csh; the reset byte stream moves to stderr, matching reset_start(stderr, ...) in tset -- stdout stays clean for eval $(reset -s). clear: -x omits the scrollback (E3) sequence; -V added. Refs #1462
print_one ignored the long-names flag; only directory children got the long form. Pass cfg.long_names through like the children path does. Refs #1462
Create: stat-driven member walk -- empty files and directories are archived (they were silently dropped), missing names are per-file errors and fail the run, modes/mtimes come from the filesystem, -v names go to stderr so the archive stream stays clean, -H crc writes real 070702 checksums. Extract: every member kind is processed -- empty files written, directory members created, symlink members attempted, unsupported types warned; the GNU age rule applies without -u (existing file newer or same age is not replaced, 'not created' message) and -u/--unconditional overrides it; 070702 checksums are verified with GNU's message. List: plain -t prints member names only; -v prints GNU long_format columns built from the header (mode string, nlink, uid/gid, size, ls-style date, ' -> target' for links). All modes: the 'N block(s)' stderr report (512-byte units) with --quiet to suppress; -H validated against the GNU format name set (unknown = usage error; known-but-unimplemented = explicit refusal instead of silently writing newc under another label); a stream with a bad leading magic is an error, not a silent empty success; the '--format only with --create' restriction is gone. Refs #1462
caomengxuan666
marked this pull request as ready for review
October 31, 2026 18:43
caomengxuan666
added a commit
that referenced
this pull request
Oct 31, 2026
Conflicts in cpio.cpp, man.cpp, time.cpp and the cpio unit tests, resolved semantically rather than by side: cpio.cpp: main's #1472 (W8) rewrite is the base and keeps all of its contract fixes (run_create/run_extract/run_list split over the Member/parse_member walk, CRC checksum verification, the -u age rule, --quiet + blocks report, -H format validation, per-file error exit codes, empty-file/directory members). Ported onto it from this branch: -A/--append (trailer splice, GNU main.c:664-666 wording), --block-size and -B (io_block_size units, main.c:321/324-330, with archive padding to whole blocks), -D/--directory (relative member names joined against the directory operand on both the read and write sides; the process working directory is never mutated, so -F keeps resolving against the original directory as in GNU, where the archive descriptor opens before change_dir), -V/--dot (dots to stderr plus the terminating newline, copyout.c:831/copyin.c:1585), --device-independent/--reproducible (inode numbers assigned from 1), --absolute-filenames (POSIX-absolute member names taken literally), -L/--dereference and -a/--reset-access-time (accepted), and the -p copy-pass implementation this branch wrote (destination = the sole positional operand; a missing destination is a usage error). Flagged divergence resolved for the oracle: GNU prints copy-out AND copy-in -v names to stderr (copyout.c:830, copyin.c:1584) and copy-pass -v prints the OUTPUT name to stderr (copypass.c:319). main's create path already used stderr; its extract path printed to stdout and this branch printed all three to stdout - all paths now use stderr. The branch's old '- 0 empty.txt' list-format expectation was dropped with its test: main's plain table of contents (names only) and its stronger empty-file/directory round-trip test supersede it. man.cpp: kept this branch's implemented options and main's fuller oracle-grounded descriptions where the two overlapped (-w, -T). time.cpp: kept this branch's implemented option set and format engine, adopted main's precise -p wording (three decimal places, 's' suffix in the default format, 127/126/125 exit-status contract) and dropped main's stale '[DIFFERS] ... not implemented' text for -f/-o/-a/-v/-q, which this branch implements. Tests: union of both sides (20 cpio cases): main's six #1462 cases plus this branch's append/block-size/device-independent/directory/ dot/pass cases; the dot case now runs with --quiet so its stderr is exactly the dots plus GNU's terminating newline. Refs #1127, #1462
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.
W8 cluster of the #1462 oracle audit: cpio (GNU cpio 2.15 source), the ncurses remainder infocmp/tic/toe/clear/reset (ncurses 6.4 source; tput itself was #1461, audit-only here), and fixes found in the source-less set (lsattr). man/time/less are audit-only per the #1127 P2c boundary — see REPORT.md in the cluster workspace.
What changed
cpio (source-based, cpio-2.15):
-vnames go to stderr so the archive stream stays clean.-u, an existing file newer-or-same-age is not replaced ("not created" message);-u/--unconditionaladded.-H crcwrites real 070702 checksums; extraction verifies them with GNU's checksum-error message.-His validated against the GNU name set; unknown names are a usage error, known-but-unimplemented formats are refused explicitly instead of silently writing newc under another label. The "--format only with --create" restriction is gone.-tprints member names only;-t -vprints GNU long_format columns from the header. Every mode prints the "N block(s)" stderr report (512-byte units) unless--quiet. A bad leading magic is an error, not a silent empty success.infocmp / tput: the builtin terminfo table moves verbatim from tput.cpp into
src/commands/terminfo_table.h, shared by both. infocmp previously ignored operands and $TERM and always printed one hardcoded entry with rc 0; it now dumps the requested entry in GNU source format (canonical order,_nc_tic_expandescaping,-1supported), keeps the shipped windows-ansi entry, and fails on unknown names like GNU. Multi-operand comparison modes report as unimplemented instead of silently answering for one name.tic: a source-file operand fails on stderr with exit 1 (nothing is compiled) instead of printing the notice on stdout with exit 0.
reset:
-qprints the resolved type and changes nothing (tset noset);-ralways reportsTerminal type is %s.on stderr;-suses the resolved type (operand, else $TERM) with the csh setenv form when $SHELL ends in csh; the reset byte stream moves to stderr (GNU'sreset_start(stderr, ...)), keeping stdout clean foreval $(reset -s).clear:
-xomits the scrollback (E3) sequence;-Vadded.lsattr:
-l/--longhonored for plain file operands and-d(was directory-children only).Tests: unit cases updated where they pinned the divergent behavior (cpio list shape, tic fake success, reset -q silence) and added per fix (cpio empty/dir roundtrip, crc verify + corruption, age rule, -H validation, bad magic, --quiet/-v list; infocmp operand/$TERM/unknown/-1; tic; reset -q/-r/-s/streams; clear -x; lsattr -l).
New user-visible strings use
winux::i18n::formatkeys; the winuxcmd-i18n companion PR carries the zh-CN catalog entries + VERSION bump.Refs #1462