The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
install.c File Reference

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.

Detailed Description

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.

Enumeration Type Documentation

◆ put_t

enum put_t

the list of operations of the install

where a file of the new version goes

Enumerator
PUT_IN_PLACE 
PUT_NEXT_TO 
PUT_NOWHERE 

Function Documentation

◆ rat_install_file()

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.

Parameters
flagsRAT_FORCE, RAT_DOWNGRADE (accept an older version than the installed one), or 0.
notegets a line for each thing the person must know (may be NULL).
Returns
0, or -1 with nothing changed.