Browse Source

better specification and usage

Alessandro Mauri 3 years ago
  1. 61


@ -20,7 +20,6 @@ An application packaged as a tarinstall is made as such
| |
| app/ |
| lib/ |
| start |
| env |
| |
@ -30,7 +29,7 @@ Decompressor: It decompresses the archive and then runs the loader
Loader: It reads the `env` file in the tarball and enumerates the `lib/`
directory to loads all the necessary libraries and sets the correct environment
before executing the `start` script in the `app/` directory
before executing the correct binary in the `app/` directory
- Find a way to include external files
@ -49,8 +48,66 @@ an empty `lib/` directory at first start, all the dependencies can be downloaded
upon running the application for the first time. It can also be used when
packaging the tarinstall to automatically download the dependencies.
`bin/` directory: it contains all other binary programs that the app may use
such as POSIX utilies and shell
## Advantages
- Allows for application compression
- Simpler and configyred in plaintext
- Does not include any external dependencies other than optional ones
- It can be used alongside other package managers and package formats
Compression is optional, it can be used to produce smaller packages but also
increments latency wich may be unwanted.
## Configuration
When the application is started the decompressor extracts the directory
structure into a temporary directory in the filesystem in order to start it.
This directory can be configured trough the `XDG_CACHE_HOME` enviroment variable
and if not set it will default to `/tmp/ti-<appname>`, to ensure optimal
performance the `XDG_CACHE_HOME` directory should be mounted on RAM, that said
if mounted on permanent storage altough the start times will be worse, the
files will only be overritten if the checksum changes so to not require
the extraction everytime.
## How it works
1. On executing the tarinstall the decompressor is executed which:
1. Calculates the cheksum of the tar application
2. It then checks the destination directory for a `checksum` file
3. If the calculated checksum matches the one in the `checksum` file it
skips the extraction
4. Else it extracts the content of the tar application in the destination
2. The decompressor then executes the loader inside the destination directory
1. It sets environment according to the `env` file
2. It overrides the loader libraries with the contents of `lib/`
3. it enters the `app/` directory and executes the binary named
`argv[0]` with all the passed arguments
## Examples
### Simple example, one binary in `app/`
foo -> /home/anon/.local/bin/foo.ti
executing `foo -h` starts `app/foo -h` inside `foo.ti`
###More complex example, multiple biaries inside `app/`
foo -> /home/anon/.local/bin/foo.ti
bar -> /home/anon/.local/bin/foo.ti
baz -> /home/anon/.local/bin/foo.ti
- executing `foo -v` starts `app/foo -v` inside `foo.ti`
- executing `bar -h` starts `app/bar -h` inside `foo.ti`
- executing `baz -o file` starts `app/baz -o file` inside `foo.ti`