From 2898d272fb99f1b167900c14beec09dad953d23f Mon Sep 17 00:00:00 2001 From: Raine Date: Sat, 14 Oct 2023 22:39:42 +0200 Subject: [PATCH] docs: added more specification --- docs/README.md | 20 ++++++++++++++++++++ docs/pkgfile.md | 24 ++++++++++++++++++++++++ docs/pkgr/README.md | 28 ++++++++++++++++++++++++++++ docs/pkgr/installedmanifest.md | 19 +++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 docs/README.md create mode 100644 docs/pkgfile.md create mode 100644 docs/pkgr/README.md create mode 100644 docs/pkgr/installedmanifest.md diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..0e9b295 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,20 @@ +# Packager + +Packager is a tool for package management. +It was built to make it easier to download and distribute packages. + +## pkgr +pkgr is the main tool for the packager. + +Because this tool is so feature rich, it has its own [README](./pkgr/README.md). + +## bootpkg +bootpkg is a tool primariliy used to bootstrap the packager. + +### Usage + +```bash +bootpkg strap ./pkgr.pkg +``` + +This will extract the pkgfile and read the `[pkgr.bootstrap]` section to bootstrap the packager or any other package. \ No newline at end of file diff --git a/docs/pkgfile.md b/docs/pkgfile.md new file mode 100644 index 0000000..4b2b81a --- /dev/null +++ b/docs/pkgfile.md @@ -0,0 +1,24 @@ +# 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 +``` + +## Packing +You can write your own packer, or use the following command: +```bash +pkgr pack +``` diff --git a/docs/pkgr/README.md b/docs/pkgr/README.md new file mode 100644 index 0000000..042206a --- /dev/null +++ b/docs/pkgr/README.md @@ -0,0 +1,28 @@ +# pkgr +PKGR is the main tool for the packager. + +## Commands +### `pkgr install [--bin/--build] ` +This command will download a package from the repository or the uri provided and install it. +This command can also be used to update a package. + +### `pkgr remove ` +This command will remove a package from the system. + +### `pkgr revert ` +This command will revert a package to the previous version. + +### `pkgr download ` +This command will download a package from the repository or the uri provided into the specified path. + +### `pkgr unpack ` +This command will unpack a pkgfile into the specified output directory. + +### `pkgr pack ` +This command will pack a manifest and archive into a pkgfile. + +### `pkgr list [-i]` +This command will list all packages known or installed packages if `-i` is specified. + +### `pkgr update [package_name]` +This command will update all packages or a specific package. diff --git a/docs/pkgr/installedmanifest.md b/docs/pkgr/installedmanifest.md new file mode 100644 index 0000000..48f7b7b --- /dev/null +++ b/docs/pkgr/installedmanifest.md @@ -0,0 +1,19 @@ +# Installed manifest + +## Where? +The package manager will store the install manifest in: +`/var/lib/pkgr/installed///installed.toml` + +To find the latest we'll use the `latest` symlink: +`/var/lib/pkgr/installed//latest/installed.toml` + +```toml +install_start = "2021-01-01T00:00:00Z" # install_start is the time the pkgr started installing the package +install_end = "2021-01-01T00:00:00Z" # install_end is the time the pkgr finished installing the package +install_by = "pkgr" # install_by is the name of the package manager that installed the package + +[old_versions] # This logs old versions of the package (that were installed before) +9 = "../9/pkgr.pkg" + +# pkgr.* is reserved for the manifest of the package +``` \ No newline at end of file