docs: spec changes

This commit is contained in:
Strix 2023-10-14 22:39:47 +02:00
parent 9dbfdeb826
commit bac6f80ff7
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774
4 changed files with 52 additions and 24 deletions

5
docs/manifest.md Normal file
View file

@ -0,0 +1,5 @@
# Manifest
---
The manifest spec is located in `/package.toml` as an example.

View file

@ -1,24 +0,0 @@
# PKGFILE
This file is essentially a tar with the manifest in the header.
## Format
The format is as follows:
```
[PKGFILE version (1 byte)][manifest length x 256 (1 byte)][manifest length (1 byte)]
[manifest (manifest length bytes)]
[archive]
```
The file is Big Endian.
## Unpacking
To unpack a PKGFILE, you can use the following command:
```bash
pkgr unpack <pkgfile> <output>
```
## Packing
You can write your own packer, or use the following command:
```bash
pkgr pack <manifest path> <archive path> <output file>
```

25
docs/pkgfiles/current.md Normal file
View file

@ -0,0 +1,25 @@
# PKGFILE
version 1
---
PKGFiles are an all-in-one solution to install a package.
## Overhead
Because pkgfiles include everything, many times you can download more than what is needed.
This may seem stupid but pkgfiles are *not* meant to stay on your system.
## Format
The format is as follows:
```
[PKGFILE version (1 byte)][manifest length x 256 (1 byte)][manifest length (1 byte)]
[manifest (manifest length bytes)]
[archive]
```
### Endianness
The file is Big Endian.

22
docs/pkgfiles/planned.md Normal file
View file

@ -0,0 +1,22 @@
# Planned PKGFILE features.
---
### Compression
> Planned for next PKGFILE version.
Currently, compression is not supported, since PKGFILE is an all-in-one solution this is very unpleasant.
When compression will be implemented, there is a big possibility that the manifest won't be compressed.
This is done to allow servers to easily parse and inspect manifests.
The compression will likely be versatile in the way that the format will be stated in the header and the pkgr
implementation can work it out by itself.
There will be a default compression format, likely gzip.
### Compact Manifest
> Not planned yet.
Right now, the manifest is an utf-8 blob sandwiched between the header and the archive.
This also requires a fixed max size for the manifest which is unfavourable.
In the future, the manifest may turn into a versatile binary blob with no size limitations.