Main Page   Modules   Compound List   File List   Compound Members   File Members   Related Pages  

lib/install.c File Reference

More...

#include "system.h"
#include <rpmlib.h>
#include <rpmmacro.h>
#include <rpmurl.h>
#include "cpio.h"
#include "install.h"
#include "depends.h"
#include "misc.h"
#include "debug.h"

Go to the source code of this file.

Compounds

struct  callbackInfo
struct  fileInfo
struct  fileMemory
struct  tagMacro

RPMTS

int rpmVersionCompare (Header first, Header second)
 Compare headers to determine which header is "newer". More...

int rpmInstallSourcePackage (const char * rootDir, FD_t fd, const char ** specFile, rpmCallbackFunction notify, rpmCallbackData notifyData, char ** cookie)
 Install source package. More...


Functions

int rpmInstallLoadMacros (Header h)
 Define per-header macros. More...

struct fileMemorynewFileMemory (void)
 Create memory used to access header. More...

void freeFileMemory ( struct fileMemory *fileMem)
 Destroy memory used to access header. More...

int assembleFileList (Header h, struct fileMemory ** memPtr, int * fileCountPtr, struct fileInfo ** filesPtr, int stripPrefixLength, enum fileActions * actions)
 Build file information array. More...

void setFileOwners (Header h, struct fileInfo * files, int fileCount)
 Localize user/group id's. More...

int mergeFiles (Header h, Header newH, enum fileActions * actions)
 Copy file data from h to newH. More...

int markReplacedFiles (rpmdb rpmdb, const struct sharedFileInfo * replList)
 Mark files in database shared with current package as "replaced". More...

void callback (struct cpioCallbackInfo * cpioInfo, void * data)
int installArchive (FD_t fd, struct fileInfo * files, int fileCount, rpmCallbackFunction notify, rpmCallbackData notifyData, const void * pkgKey, Header h, const char ** specFile, int archiveSize)
 Setup payload map and install payload archive. More...

int installSources (Header h, const char * rootDir, FD_t fd, const char ** specFilePtr, rpmCallbackFunction notify, rpmCallbackData notifyData)
const char* const fileActionString (enum fileActions a)
 Return formatted string representation of file disposition. More...

int installBinaryPackage (const rpmTransactionSet ts, FD_t fd, Header h, const void * pkgKey, enum fileActions * actions, struct sharedFileInfo * sharedList)
 Install binary package (from transaction set). More...


Variables

struct tagMacro  tagMacros []
 Macros to be defined from per-header tag values.


Detailed Description

Definition in file install.c.


Function Documentation

int assembleFileList ( Header h,
struct fileMemory ** memPtr,
int * fileCountPtr,
struct fileInfo ** filesPtr,
int stripPrefixLength,
enum fileActions * actions ) [static]
 

Build file information array.

Parameters:
h   header
Return values:
memPtr   address of allocated memory from header access
fileCountPtr   address of install file count
files   address of install file information
Parameters:
stripPrefixLength   no. bytes of file prefix to skip
actions   array of file dispositions
Returns:
0 always

Definition at line 141 of file install.c.

Referenced by installBinaryPackage(), and installSources().

void callback ( struct cpioCallbackInfo * cpioInfo,
void * data ) [static]
 

Definition at line 527 of file install.c.

const char *const fileActionString ( enum fileActions a )
 

Return formatted string representation of file disposition.

Parameters:
a   file dispostion
Returns:
formatted string

Definition at line 904 of file install.c.

Referenced by assembleFileList(), and removeBinaryPackage().

void freeFileMemory ( struct fileMemory * fileMem ) [static]
 

Destroy memory used to access header.

Parameters:
fileMem   pointer to memory

Definition at line 121 of file install.c.

Referenced by installBinaryPackage(), and installSources().

int installArchive ( FD_t fd,
struct fileInfo * files,
int fileCount,
rpmCallbackFunction notify,
rpmCallbackData notifyData,
const void * pkgKey,
Header h,
const char ** specFile,
int archiveSize ) [static]
 

Setup payload map and install payload archive.

Todo:
Add endian tag so that srpm MD5 sums can ber verified when installed.

Document.

Parameters:
fd   file handle of package (positioned at payload)
files   files to install (NULL means "all files")
fileCount   no. files to install
notify   callback function
notifyData   callback private data
pkgKey   package private data (e.g. file name)
h   header
Return values:
specFile   address of spec file name
Parameters:
archiveSize  
Returns:
0 on success

Definition at line 561 of file install.c.

Referenced by installBinaryPackage(), and installSources().

int installBinaryPackage ( const rpmTransactionSet ts,
FD_t fd,
Header h,
const void * pkgKey,
enum fileActions * actions,
struct sharedFileInfo * sharedList )
 

Install binary package (from transaction set).

Parameters:
ts   transaction set
fd   package file handle
h   package header
pkgKey   package private data
actions   array of file dispositions
sharedList   header instances of packages that share files
Returns:
0 on success, 1 on bad magic, 2 on error

Definition at line 956 of file install.c.

Referenced by rpmRunTransactions().

int installSources ( Header h,
const char * rootDir,
FD_t fd,
const char ** specFilePtr,
rpmCallbackFunction notify,
rpmCallbackData notifyData ) [static]
 

Parameters:
h   header
rootDir   path to top of install tree
fd   file handle of package (positioned at payload)
Return values:
specFilePtr   address of spec file name
Parameters:
notify   callback function
notifyData   callback private data
Returns:
0 on success, 1 on bad magic, 2 on error

Definition at line 681 of file install.c.

Referenced by rpmInstallSourcePackage().

int markReplacedFiles ( rpmdb rpmdb,
const struct sharedFileInfo * replList ) [static]
 

Mark files in database shared with current package as "replaced".

Parameters:
db   rpm database
replist   shared file list
Returns:
0 always

Definition at line 462 of file install.c.

Referenced by installBinaryPackage().

int mergeFiles ( Header h,
Header newH,
enum fileActions * actions ) [static]
 

Copy file data from h to newH.

Parameters:
h   header from
newH   header to
actions   array of file dispositions
Returns:
0 on success, 1 on failure

Definition at line 283 of file install.c.

Referenced by installBinaryPackage().

struct fileMemory * newFileMemory ( void ) [static]
 

Create memory used to access header.

Returns:
pointer to memory

Definition at line 107 of file install.c.

int rpmInstallLoadMacros ( Header h ) [static]
 

Define per-header macros.

Parameters:
h   header
Returns:
0 always

Definition at line 77 of file install.c.

Referenced by rpmInstallSourcePackage().

int rpmInstallSourcePackage ( const char * root,
FD_t fd,
const char ** specFile,
rpmCallbackFunction notify,
rpmCallbackData notifyData,
char ** cookie )
 

Install source package.

Parameters:
root   path to top of install tree
fd   file handle
Return values:
specFile   address of spec file name
Parameters:
notify   progress callback
notifyData   progress callback private data
Return values:
cooke   address of cookie pointer
Returns:
0 on success, 1 on bad magic, 2 on error

Definition at line 922 of file install.c.

Referenced by rpmInstall(), and rpmInstallSource().

int rpmVersionCompare ( Header first,
Header second )
 

Compare headers to determine which header is "newer".

Parameters:
first   1st header
second   2nd header
Returns:
result of comparison

Definition at line 868 of file install.c.

Referenced by ensureOlder(), pkgCompareVer(), rpmInstall(), rpmtransAddPackage(), and versionCompare().

void setFileOwners ( Header h,
struct fileInfo * files,
int fileCount ) [static]
 

Localize user/group id's.

Parameters:
h   header
files   install file information
fileCount   install file count

Definition at line 203 of file install.c.

Referenced by installBinaryPackage().


Variable Documentation

struct tagMacro tagMacros[] [static]
 

Macros to be defined from per-header tag values.


Generated at Sun Apr 8 18:43:04 2001 for rpm by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000