Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

lib/rpminstall.c File Reference

More...

#include "system.h"
#include "rpmcli.h"
#include "manifest.h"
#include "misc.h"
#include "debug.h"
#include <sys/ioctl.h>

Go to the source code of this file.

Data Structures

struct  rpmEIU

Typedefs

typedef const char * str_t

Functions

void checkTTY (void)
void printHash (const unsigned long amount, const unsigned long total)
void * rpmShowProgress (const void *arg, const rpmCallbackType what, const unsigned long amount, const unsigned long total, const void *pkgKey, void *data)
 The rpm CLI generic transaction callback.

int rpmInstall (const char *rootdir, const char **fileArgv, rpmtransFlags transFlags, rpmInstallInterfaceFlags interfaceFlags, rpmprobFilterFlags probFilter, rpmRelocation *relocations)
int rpmErase (const char *rootdir, const char **argv, rpmtransFlags transFlags, rpmEraseInterfaceFlags interfaceFlags)
int rpmInstallSource (const char *rootdir, const char *arg, const char **specFile, char **cookie)
int IDTintcmp (const void *a, const void *b)
IDTX IDTXfree (IDTX idtx)
 Destroy id index.

IDTX IDTXgrow (IDTX idtx, int need)
 Insure that index has room for "need" elements.

IDTX IDTXsort (IDTX idtx)
 Sort tag (instance,value) pairs.

IDTX IDTXload (rpmdb db, rpmTag tag)
 Load tag (instance,value) pairs from rpm databse, and return sorted id index.

IDTX IDTXglob (const char *globstr, rpmTag tag)
 Load tag (instance,value) pairs from packages, and return sorted id index.

int rpmRollback (struct rpmInstallArguments_s *ia, const char **argv)

Variables

int fancyPercents = 0
int hashesPrinted = 0
int packagesTotal = 0
int progressTotal = 0
int progressCurrent = 0
int checkedTTY = 0
int countWidth = 0
int nameWidth = 29
int hashesTotal = 50
int reverse = -1
IDTX IDTXnew (void)


Detailed Description

Definition in file rpminstall.c.


Typedef Documentation

typedef const char* str_t
 

Definition at line 247 of file rpminstall.c.


Function Documentation

void checkTTY void    [static]
 

Definition at line 40 of file rpminstall.c.

References checkedTTY, countWidth, fancyPercents, hashesTotal, nameWidth, and packagesTotal.

Referenced by printHash(), and rpmShowProgress().

int IDTintcmp const void *    a,
const void *    b
[static]
 

Definition at line 795 of file rpminstall.c.

References IDT_s::n, reverse, and IDT_s::val.

Referenced by IDTXsort().

IDTX IDTXfree IDTX    idtx
 

Destroy id index.

Parameters:
idtx  id index
Returns:
NULL always

Definition at line 809 of file rpminstall.c.

References _free(), IDT_s::h, headerFree(), IDTindex_s::idt, IDT_s::key, and IDTindex_s::nidt.

Referenced by rpmRollback().

IDTX IDTXglob const char *    globstr,
rpmTag    tag
 

Load tag (instance,value) pairs from packages, and return sorted id index.

Parameters:
globstr  glob expression
tag  rpm tag
Returns:
id index

Definition at line 902 of file rpminstall.c.

References _, _free(), Fclose(), Ferror(), Fopen(), Fstrerror(), IDT_s::h, headerFree(), headerLink(), headerNVR(), HGE_t, IDTindex_s::idt, IDTXgrow(), IDTXsort(), IDT_s::instance, int_32, IDT_s::key, IDT_s::n, IDTindex_s::nidt, IDT_s::r, RPMERR_OPEN, rpmError, rpmGlob(), rpmRC, RPMRC_OK, rpmReadPackageHeader(), rpmTag, rpmTagType, IDT_s::v, IDT_s::val, and xstrdup().

Referenced by rpmRollback().

IDTX IDTXgrow IDTX    idtx,
int    need
 

Insure that index has room for "need" elements.

Parameters:
idtx  id index
need  additional no. of elements needed
Returns:
id index (with room for "need" elements)

Definition at line 833 of file rpminstall.c.

References IDTindex_s::alloced, IDTindex_s::delta, IDTindex_s::idt, IDTXnew, IDTindex_s::nidt, IDTindex_s::size, and xrealloc().

Referenced by IDTXglob(), and IDTXload().

IDTX IDTXload rpmdb    db,
rpmTag    tag
 

Load tag (instance,value) pairs from rpm databse, and return sorted id index.

Parameters:
db  rpm database
tag  rpm tag
Returns:
id index

Definition at line 857 of file rpminstall.c.

References IDT_s::h, headerLink(), headerNVR(), HGE_t, IDTindex_s::idt, IDTXgrow(), IDTXsort(), IDT_s::instance, int_32, IDT_s::key, IDT_s::n, IDTindex_s::nidt, IDT_s::r, RPM_INT32_TYPE, RPM_NULL_TYPE, rpmdbFreeIterator(), rpmdbGetIteratorOffset(), rpmdbInitIterator(), rpmdbNextIterator(), rpmTag, rpmTagType, IDT_s::v, and IDT_s::val.

Referenced by rpmRollback().

IDTX IDTXsort IDTX    idtx
 

Sort tag (instance,value) pairs.

Parameters:
idtx  id index
Returns:
id index

Definition at line 850 of file rpminstall.c.

References IDTindex_s::idt, IDTintcmp(), IDTindex_s::nidt, and IDTindex_s::size.

Referenced by IDTXglob(), and IDTXload().

void printHash const unsigned long    amount,
const unsigned long    total
[static]
 

Definition at line 89 of file rpminstall.c.

References checkTTY(), hashesPrinted, hashesTotal, progressCurrent, and progressTotal.

Referenced by rpmShowProgress().

int rpmErase const char *    rootdir,
const char **    argv,
rpmtransFlags    transFlags,
rpmEraseInterfaceFlags    interfaceFlags
 

Erase binary rpm package.

Parameters:
rootdir  path to top of install tree
argv  array of package file names (NULL terminated)
transFlags  bits to control rpmRunTransactions()
interfaceFlags  bits to control rpmInstall()
Returns:
0 on success

Definition at line 664 of file rpminstall.c.

References _, _free(), printDepProblems(), rpmdbClose(), rpmdbFreeIterator(), rpmdbGetIteratorCount(), rpmdbGetIteratorOffset(), RPMDBI_LABEL, rpmdbInitIterator(), rpmdbNextIterator(), rpmdbOpen(), rpmdepCheck(), rpmdepFreeConflicts(), rpmEraseInterfaceFlags, rpmGetPath(), RPMMESS_ERROR, rpmMessage, rpmRunTransactions(), RPMTRANS_FLAG_REVERSE, RPMTRANS_FLAG_TEST, rpmtransCreateSet(), rpmtransFlags, rpmtransFree(), rpmtransRemovePackage(), UNINSTALL_ALLMATCHES, and UNINSTALL_NODEPS.

Referenced by main().

int rpmInstall const char *    rootdir,
const char **    fileArgv,
rpmtransFlags    transFlags,
rpmInstallInterfaceFlags    interfaceFlags,
rpmprobFilterFlags    probFilter,
rpmRelocation   relocations
 

Todo:
Generalize --freshen policies.

Definition at line 272 of file rpminstall.c.

References _, _free(), alloca(), rpmEIU::argc, rpmEIU::argv, rpmEIU::db, Fclose(), rpmEIU::fd, Ferror(), rpmEIU::fnp, Fopen(), ftpStrerror(), rpmEIU::h, headerFree(), headerFreeData(), headerGetEntry(), headerNVR(), INSTALL_FRESHEN, INSTALL_LABEL, INSTALL_NODEPS, INSTALL_NOORDER, INSTALL_UPGRADE, rpmEIU::isSource, rpmRelocation_s::newPath, rpmEIU::numFailed, rpmEIU::numPkgs, rpmEIU::numRPMS, rpmEIU::numSRPMS, rpmRelocation_s::oldPath, packagesTotal, rpmEIU::pkgState, rpmEIU::pkgURL, rpmEIU::pkgx, rpmEIU::prevx, printDepProblems(), rpmEIU::relocations, rpmdbClose(), rpmdbFreeIterator(), rpmdbGetIteratorCount(), rpmdbInitIterator(), rpmdbNextIterator(), rpmdbOpen(), rpmdepCheck(), rpmdepFreeConflicts(), rpmdepOrder(), RPMERR_MANIFEST, RPMERR_OPEN, rpmError, rpmGenPath(), rpmGetPath(), rpmGlob(), rpmInstallInterfaceFlags, rpmInstallSourcePackage(), rpmIsVerbose, RPMMESS_DEBUG, RPMMESS_ERROR, rpmMessage, rpmprobFilterFlags, rpmProblemSetFree(), rpmProblemSetPrint(), rpmEIU::rpmrc, RPMRC_BADMAGIC, RPMRC_BADSIZE, RPMRC_FAIL, RPMRC_OK, RPMRC_SHORTREAD, rpmReadPackageHeader(), rpmReadPackageManifest(), rpmRunTransactions(), rpmShowProgress(), RPMTAG_NAME, RPMTAG_PREFIXES, RPMTRANS_FLAG_TEST, rpmtransAddPackage(), rpmtransCreateSet(), rpmtransFlags, rpmtransFree(), rpmVersionCompare(), rpmEIU::sourceURL, rpmEIU::ts, Unlink(), URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, urlGetFile(), urlIsURL(), urlPath(), xrealloc(), and xstrdup().

Referenced by main().

int rpmInstallSource const char *    rootdir,
const char *    arg,
const char **    specFile,
char **    cookie
 

Install source rpm package.

Parameters:
rootdir  path to top of install tree
arg  source rpm file name
Return values:
specFile  address of (installed) spec file name
cookie 
Returns:
0 on success

Definition at line 752 of file rpminstall.c.

References _, _free(), Fclose(), Ferror(), Fopen(), Fstrerror(), rpmInstallSourcePackage(), rpmIsVerbose, RPMMESS_ERROR, rpmMessage, rpmRC, and RPMRC_OK.

Referenced by main().

int rpmRollback struct rpmInstallArguments_s   ia,
const char **    argv
 

Rollback transactions, erasing new, reinstalling old, package(s).

Returns:
0 on success

Definition at line 973 of file rpminstall.c.

References _, _free(), IDT_s::h, headerFree(), IDTindex_s::idt, IDTXfree(), IDTXglob(), IDTXload(), INSTALL_ERASE, INSTALL_FRESHEN, INSTALL_INSTALL, INSTALL_UPGRADE, rpmInstallArguments_s::installInterfaceFlags, IDT_s::instance, IDT_s::key, IDT_s::n, IDTindex_s::nidt, packagesTotal, printDepProblems(), rpmInstallArguments_s::probFilter, IDT_s::r, rpmInstallArguments_s::rbtid, rpmInstallArguments_s::relocations, rpmInstallArguments_s::rootdir, rpmdbClose(), rpmdbOpen(), rpmdepCheck(), rpmdepFreeConflicts(), rpmdepOrder(), rpmExpand(), rpmIsDebug, RPMMESS_DEBUG, RPMMESS_ERROR, rpmMessage, RPMPROB_FILTER_OLDPACKAGE, rpmProblemSetFree(), rpmProblemSetPrint(), rpmRunTransactions(), rpmShowProgress(), RPMTAG_INSTALLTID, RPMTAG_REMOVETID, rpmtransAddPackage(), rpmtransCreateSet(), rpmtransFree(), rpmtransRemovePackage(), rpmInstallArguments_s::transFlags, IDT_s::v, and IDT_s::val.

Referenced by main().

void* rpmShowProgress const void *    arg,
const rpmCallbackType    what,
const unsigned long    amount,
const unsigned long    total,
const void *    pkgKey,
void *    data
 

The rpm CLI generic transaction callback.

Deprecated:
Transaction callback arguments need to change, so don't rely on this routine in the rpmcli API.
Parameters:
arg  per-callback private data (e.g. an rpm header)
what  callback identifier
amount  per-callback progress info
total  per-callback progress info
pkgKey  opaque header key (e.g. file name or PyObject)
data  private data (e.g. rpmInstallInterfaceFlags)
Returns:
per-callback data (e.g. an opened FD_t)

Definition at line 137 of file rpminstall.c.

References _, _free(), checkTTY(), countWidth, Fclose(), fdFree, fdLink, Fopen(), hashesPrinted, headerSprintf(), INSTALL_HASH, INSTALL_LABEL, INSTALL_PERCENT, nameWidth, packagesTotal, printHash(), progressCurrent, progressTotal, RPMCALLBACK_CPIO_ERROR, RPMCALLBACK_INST_CLOSE_FILE, RPMCALLBACK_INST_OPEN_FILE, RPMCALLBACK_INST_PROGRESS, RPMCALLBACK_INST_START, RPMCALLBACK_TRANS_PROGRESS, RPMCALLBACK_TRANS_START, RPMCALLBACK_TRANS_STOP, RPMCALLBACK_UNINST_PROGRESS, RPMCALLBACK_UNINST_START, RPMCALLBACK_UNINST_STOP, RPMCALLBACK_UNPACK_ERROR, and rpmCallbackType.

Referenced by rpmInstall(), and rpmRollback().


Variable Documentation

int checkedTTY = 0 [static]
 

Definition at line 35 of file rpminstall.c.

Referenced by checkTTY().

int countWidth = 0 [static]
 

Definition at line 36 of file rpminstall.c.

Referenced by checkTTY(), and rpmShowProgress().

int fancyPercents = 0
 

Definition at line 23 of file rpminstall.c.

Referenced by checkTTY().

int hashesPrinted = 0 [static]
 

Definition at line 26 of file rpminstall.c.

Referenced by printHash(), and rpmShowProgress().

int hashesTotal = 50 [static]
 

Definition at line 38 of file rpminstall.c.

Referenced by checkTTY(), and printHash().

IDTX IDTXnew(void)
 

Definition at line 825 of file rpminstall.c.

Referenced by IDTXgrow().

int nameWidth = 29 [static]
 

Definition at line 37 of file rpminstall.c.

Referenced by checkTTY(), and rpmShowProgress().

int packagesTotal = 0
 

Definition at line 29 of file rpminstall.c.

Referenced by checkTTY(), rpmInstall(), rpmRollback(), and rpmShowProgress().

int progressCurrent = 0 [static]
 

Definition at line 33 of file rpminstall.c.

Referenced by printHash(), and rpmShowProgress().

int progressTotal = 0 [static]
 

Definition at line 31 of file rpminstall.c.

Referenced by printHash(), and rpmShowProgress().

int reverse = -1 [static]
 

Definition at line 791 of file rpminstall.c.

Referenced by IDTintcmp().


Generated on Sun Feb 2 23:32:09 2003 for rpm by doxygen1.2.18