apk/installed: parse Z: (file checksum) token in ParseInstalled#2230
apk/installed: parse Z: (file checksum) token in ParseInstalled#2230Dev-X25874 wants to merge 1 commit into
Conversation
Signed-off-by: Dev-X25874 <283057883+Dev-X25874@users.noreply.github.com>
|
Hey @a-crate — would you mind taking a look at this when you get a chance? This adds the missing |
|
Sorry for delay. Looking. |
a-crate
left a comment
There was a problem hiding this comment.
Z: is an APK V2 field: https://wiki.alpinelinux.org/wiki/Apk_spec
apko doesn't have support for APK V2 yet, and while it would be good to add it I don't think adding piecemeal support for individual APK V2 fields is the right way go about this. Even if we parse APK V2 fields in the installed DB we're not going to write new correct entries in V2 format.
Do you have a specific usecase that's broken without this change?
There was a problem hiding this comment.
Unify the indentation here please, keep all cases statements at the same indentation and don't modify indentation from 341:344. gofmt should do this for you, I think. The diff and control flow is a bit confusing otherwise.
AddInstalledPackagewrites aZ:<checksum>line for every regularfile that carries a checksum, and real installed databases are full of
them.
ParseInstalledhad nocase "Z":handler, so those lines weresilently dropped on read-back — every reconstructed
tar.Headercameback with a nil
PAXRecordsmap and no checksum.Add the missing case, mirroring the write path: allocate
PAXRecordson demand and store the value under
paxRecordsChecksumKey, the samekey used by
installRegularFileandAddInstalledPackage.