Author: | Mike Kelly <pioto@pioto.org> |
---|---|
Date: | 2007-12-25 |
Revision: | 228 |
Version: | 0.6.0 |
This is a sketch of the basic API for interfacing with the creandus scripts.
There are several different tasks which these scripts must do:
This action is performed by the add.bash script. It should be run once, before the package is unpacked, compiled, or installed. It is invoked as follows:
add.bash "new users" "new groups" cpv userspace [root]
The arguments it takes are:
- "new users"
- A single parameter, a space-separated list of new users to be added for this package.
- "new groups"
- Same as above, only for groups.
- cpv
- A unique identifier for the package about to be installed (category, name, and version).
- userspace
- A unique identifier of the userspace we are running in. This is something of the form USERLAND-ELIBC. For example, most GNU/Linux systems would specify GNU-glibc, while FreeBSD-based systems would use BSD-FreeBSD.
- [root]
- An optional parameter, defines the system root to install into. If not provided, assumes /.
Cleaning up from an install can be done in two different cases.
These databases contain a newline separated list of package identifiers (name and version, usually), which mainly serves to tell the scripts when a user is no longer used by any package on the system. Database actions should all go through the db.bash script.
This can be invoked in 2 different modes, to add and remove an entry from the database:
db.bash add dbtype cpv newname userspace [root] db.bash del cpv [root]
The arguments are:
- dbtype
- The database to be affected (either "user" or "group").
- cpv
- A unique package identifier (category, name, and version).
- newname
- The name of the user or group to be added.
- userspace
- A unique specifier for the userspace being run under, of the form of USERLAND-ELIBC. For GNU/Linux, for example, this would be GNU-glibc; for FreeBSD, BSD-FreeBSD.
- [root]
- An optional parameter. Defines the system root to install into. If not provided, it is assumed to be /.