Update Formats.md

This commit is contained in:
Zak Yani Star Fenton 2025-06-08 05:36:36 +00:00
parent 5874a9e92c
commit df3313798e

View File

@ -2,7 +2,11 @@
The `slpkg` tool uses custom formats rather than zip/tar/gz and so on. The `slpkg` tool uses custom formats rather than zip/tar/gz and so on.
The reasoning behind this is very simple: zip and tar are complex formats with different extensions & cross-platform concerns, whereas the package manager just needs to do the basic job of packaging & installing software files (NOT modifying archives one file at a time, NOT backwards compatibility with old archives etc.). So it's much easier to implement formats for that purpose than using legacy zip or tar formats then having to add modern extensions as well as packaging metadata on top. ## Why New Formats?
The reasoning behind this is very simple: zip and tar are complex formats with different extensions & cross-platform concerns, whereas the package manager just needs to do the basic job of packaging & installing software files (NOT modifying archives one file at a time, NOT backwards compatibility with old archives etc.).
So it's much easier to implement formats for that purpose than using legacy zip or tar formats then having to add modern extensions as well as packaging metadata on top, but this also allows tight control over things like data integrity so hopefully the package manager also gives better feedback when things do break.
## .pkb files ## .pkb files
@ -12,6 +16,8 @@ These are human-edited text files listing package contents and other metadata ne
These are binary files consisting of an archive header, a number of (file-like or metadata) entry headers, a string section and then a series of file contents. These are binary files consisting of an archive header, a number of (file-like or metadata) entry headers, a string section and then a series of file contents.
Each part of a `.pkg` file is checksummed individually, allowing archivers years down the track to monitor any bitrot in old packages in a fine-grained way.
## .pkh files ## .pkh files
These are the same format as their corresponding `.pkg` except only need to contain the headers & strings to index installed data. These are the same format as their corresponding `.pkg` except only need to contain the headers & strings to index installed data.