|
ginnOS
The reference: libc, the libraries and the kernel
|
librat: install a package file, or upgrade an installed package with it. More...
#include "internal.h"#include <errno.h>#include <stdlib.h>#include <string.h>#include <sys/stat.h>#include <time.h>#include <unistd.h>#include "conf.h"Enumerations | |
| enum | put_t { PUT_IN_PLACE , PUT_NEXT_TO , PUT_NOWHERE } |
| the list of operations of the install More... | |
Functions | |
| int | rat_install_file (rat_t *rat, const char *path, unsigned flags, rat_note_t note, void *context, rat_error_t *err) |
| install a package file. | |
librat: install a package file, or upgrade an installed package with it.
the prepare step changes nothing outside var/lib/rat: it unpacks the package into the stage folder, checks each path against the base image, the other packages and the disk, and writes the new record into the stage folder. then the transaction removes the files and folders of the old version that the new one does not have, makes the folders, moves the files and links into place (a rename replaces a file of the old version), and puts the record in place of the old one.
a settings file (under etc/) that the person changed stays. when the new version changes it too, the new file goes next to it, with the name <path>.ratnew. a settings file that no package owns (a remove kept it) stays in the same way, unless RAT_FORCE.
| enum put_t |
| int rat_install_file | ( | rat_t * | rat, |
| const char * | path, | ||
| unsigned | flags, | ||
| rat_note_t | note, | ||
| void * | context, | ||
| rat_error_t * | err ) |
install a package file.
when an older version of the package is installed, upgrade it: the files of the old version that the new one does not have go, in the same change. the same version is refused.
| flags | RAT_FORCE, RAT_DOWNGRADE (accept an older version than the installed one), or 0. |
| note | gets a line for each thing the person must know (may be NULL). |