2
0
Fork
You've already forked autils
4

WIP: apkg-csum #5

Closed
mobinmob wants to merge 3 commits from mobinmob/autils:apkg-csum into main
pull from: mobinmob/autils:apkg-csum
merge into: emmett1:main
emmett1:main
Contributor
Copy link

apkg-csum, a script to compute and verify checksums for source files

This a proof-of-concept for adding checksum verification to apkg. I wrote the script with the intention of using it for verification for apkg and standalone for creating the checksum files. If one wants secutiry, that needs signatures, that is quite different :)
I understand that having functionality outside of the apkg script is not welcome, and I can try to integrate it if the basis is judged as sound and acceptable.

Basics of operation

  • Only compute and verify checksums for downloaded tarballs, not for every file in the directory that holds the apkg. The integrity of the files downloaded by git is not in question :)
  • Store the checksums on a .checksum file inside the abuild dir, one line per-file.
  • Use the full output of the checksum utility for every line. That means two columns, one that contains the checksum and one that contains the full name of the file. That needs more work originally but has advantages. Checking can be done by the the standard -c argument of the checksum utilities, which produces usefull output without needing extra code.
# .checksum example
81ecbc9d9cd444d51d11264665620b689be58df00eb131715c6070a7 llvm-18.1.8.src.tar.xz
c062c3fe894eb8b264f470b624fa1509c2e16c9faa22d9432fd9f13c cmake-18.1.8.src.tar.xz
# example verification outputs 
# Correct csums:
llvm-18.1.8.src.tar.xz: OK
cmake-18.1.8.src.tar.xz: OK
Correct checksum(s)!
# One csum wrong:
llvm-18.1.8.src.tar.xz: FAILED
cmake-18.1.8.src.tar.xz: OK
sha3sum: WARNING: 1 of 2 computed checksums did NOT match
error: Wrong checksum(s), see above!
  • Easy way to change checksuming algorithm utilities - just change $CHECKSUM_CMD! The arguments and outputs are compatible between the busybox utils, coreutils and b3sumc.

The way forward

If the above basics are acceptable, I can adapt the code inside the apkg script. It can use -g for generating checksums and (削除) -c (削除ここまで) -v for checking. It will not be that hard and it will be less code then the current script.

## apkg-csum, a script to compute and verify checksums for source files This a proof-of-concept for adding checksum verification to apkg. I wrote the script with the intention of using it for verification for apkg and standalone for creating the checksum files. If one wants secutiry, that needs signatures, that is quite different :) I understand that having functionality outside of the apkg script is not welcome, and I can try to integrate it if the basis is judged as sound and acceptable. ### Basics of operation - Only compute and verify checksums for downloaded tarballs, not for every file in the directory that holds the apkg. The integrity of the files downloaded by git is not in question :) - Store the checksums on a `.checksum` file inside the abuild dir, one line per-file. - Use the full output of the checksum utility for every line. That means two columns, one that contains the checksum and one that contains the full name of the file. That needs more work originally but has advantages. Checking can be done by the the standard `-c` argument of the checksum utilities, which produces usefull output without needing extra code. ``` # .checksum example 81ecbc9d9cd444d51d11264665620b689be58df00eb131715c6070a7 llvm-18.1.8.src.tar.xz c062c3fe894eb8b264f470b624fa1509c2e16c9faa22d9432fd9f13c cmake-18.1.8.src.tar.xz ``` ``` # example verification outputs # Correct csums: llvm-18.1.8.src.tar.xz: OK cmake-18.1.8.src.tar.xz: OK Correct checksum(s)! # One csum wrong: llvm-18.1.8.src.tar.xz: FAILED cmake-18.1.8.src.tar.xz: OK sha3sum: WARNING: 1 of 2 computed checksums did NOT match error: Wrong checksum(s), see above! ``` - Easy way to change checksuming algorithm utilities - just change $CHECKSUM_CMD! The arguments and outputs are compatible between the busybox utils, coreutils and b3sumc. ### The way forward If the above basics are acceptable, I can adapt the code inside the apkg script. It can use `-g` for generating checksums and ~`-c`~ `-v` for checking. It will not be that hard and it will be less code then the current script.
- allow for abuilds with multiple sourcefiles
- emit usefull bug compact error messages for verification
mobinmob changed title from (削除) apkg-csum (削除ここまで) to WIP: apkg-csum 2024年08月26日 11:31:25 +02:00
Author
Contributor
Copy link

-v for verification seems better :P

`-v` for verification seems better :P
Author
Contributor
Copy link

@emmett1 shared a compact and well-integrated implementation on the tg, so I am closing this. 😉

@emmett1 shared a compact and well-integrated implementation on the tg, so I am closing this. 😉
mobinmob closed this pull request 2024年08月26日 19:13:31 +02:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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
emmett1/autils!5
Reference in a new issue
emmett1/autils
No description provided.
Delete branch "mobinmob/autils:apkg-csum"

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?