Add native byte comparison for build and storage recipes #11
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/coreutils#11
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem and motivation
Build, reproducibility and storage recipes need byte comparison. EriX has no
native
cmp, so those recipes currently depend on an imported executable.Proposed behavior and scope
Add
cmp [-l | -s] [--] file1 file2to Coreutils and the extended images.Support stdin through
-, first-difference reporting, octal byte listings andsilent comparison. Return 0 for equality, 1 for differences and 2 for errors.
Follow the checked POSIX comparison contract
for C-locale output. Compare incremental reads without loading complete files.
Package the command, its READ ceiling and
cmp(1)together.Authority, security and reliability
Use only the two exact operand READ grants or the authenticated original stdin.
Names and matching metadata cannot establish authority or equality. Preserve
unconsumed bytes across unequal short reads; equality requires genuine EOF from
both inputs. Keep acquisition, read and release owners through failure and
cancellation. Required closed streams cause operational errors; silent or equal
comparisons need no unused output stream. Uncertain cleanup retains custody.
A repeated stdin operand compares its one admitted original without consuming it.
Acceptance criteria
EOF and one-based byte/line positions with distinct 0/1/2 statuses.
first errors and once-only cleanup through denial, output failure and unwind.
preserving existing utility entries and capability ceilings.
unit and guard cases cover malformed input and ownership failures.
supported syntax and explicit authority contract.
Alternatives and tradeoffs
Imported diffutils remains useful for
diffand its extensions. A nativecmpremoves that dependency from byte-comparison recipes. This scope does not add
GNU skip/count extensions or claim full locale support.
Tracking and rollout
Coordinate Coreutils PR 2,
Integration PR 12 and the
phase checklist.