Content
Repository setup (Client side)
pkgmanager is shipped with default repository configs which refers to official TankOS repository.
cat /etc/pkgmanager/ftp.tankos.org.conf
[ftp.tankos.org]
URL=ftp://ftp.tankos.org
priority=0
[ftp.tankos.org]
represents the name of the repository.
URL
defines the path and protocol. FTP, FTPS, HTTP and HTTPS are supported
priority
- priority of the repository while resolving package names. Low priority results in behavior when a package is only downloaded from the low priority repo if it's not present anywhere else.
Repository setup (Server side)
To set up a TankOS compatible repository it's needed that:
- A folder with packages to be published is present
- The folder is made available for anonymous read via FTP, FTPS, HTTP or HTTPS
- A list of packages is generated as shown
-rw-rw-r-- ./path/package-1.2.1-x86_64-2_tank.txz
- A sha256 sum is placed next to each package. It's necessary for final sum checks on client side
./path/package-1.2.1-x86_64-2_tank.SHA256
Postinstall execution hooks
Various updates and file changes require commands to be run when all new files are finally in place. This requires a mechanism that is triggered only at certain circumstances.
pkgmanager looks at hooks in /etc/pkgmanager/hooks as for the last step before an upgrade or an installation of a new software package can be considered as done. Each hook is a script that reads input from stdin and does some action. Pkgmanager gives the complete list of modified and new files as an input arguments.
Take a look at the example:
#!/bin/bash
if cat $1 | egrep -q '^/usr/share/glib-2.0/schemas'; then
glib-compile-schemas /usr/share/glib-2.0/schemas
fi
This code will be executed only if we had any files changed in /usr/share/glib-2.0/schemas.