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"`

Go to the source code of this file.

## Data Structures

struct | rpmEIU

## Typedefs

typedef const char * | str_t

## Functions

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)
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)
IDTX | IDTXnew (void)
IDTX | IDTXgrow (IDTX idtx, int need)
IDTX | IDTXsort (IDTX idtx)
IDTX | IDTXload (rpmdb db, rpmTag tag)
IDTX | IDTXglob (const char *globstr, rpmTag tag)
int | rpmRollback (struct rpmInstallArguments_s *ia, const char **argv)

## Variables

int | hashesPrinted = 0
int | packagesTotal = 0
int | progressTotal = 0
int | progressCurrent = 0
int | reverse = -1

## Detailed Description

Definition in file rpminstall.c.

## Typedef Documentation

typedef const char* str_t

| Definition at line 179 of file rpminstall.c.

## Function Documentation

int IDTintcmp | ( | const void * | a,
|  | const void * | b
| ) | `[static]`

| Definition at line 727 of file rpminstall.c. References reverse. Referenced by IDTXsort.

IDTX IDTXfree | ( | IDTX | idtx | ) |

| Definition at line 741 of file rpminstall.c. References _free, and headerFree. Referenced by rpmRollback.

IDTX IDTXglob | ( | const char * | globstr,
|  | rpmTag | tag
| ) |

| Definition at line 834 of file rpminstall.c. References _, _free, Fclose, Ferror, Fopen, Fstrerror, headerFree, headerLink, headerNVR, HGE_t, IDTXgrow, IDTXsort, int_32, rpmGlob, rpmRC, RPMRC_OK, rpmReadPackageHeader, rpmTag, rpmTagType, and xstrdup. Referenced by rpmRollback.

IDTX IDTXgrow | ( | IDTX | idtx,
|  | int | need
| ) |

| Definition at line 765 of file rpminstall.c. References IDTXnew, and xrealloc. Referenced by IDTXglob, and IDTXload.

IDTX IDTXload | ( | rpmdb | db,
|  | rpmTag | tag
| ) |

| Definition at line 789 of file rpminstall.c. References headerLink, headerNVR, HGE_t, IDTXgrow, IDTXsort, int_32, RPM_INT32_TYPE, RPM_NULL_TYPE, rpmdbFreeIterator, rpmdbGetIteratorOffset, rpmdbInitIterator, rpmdbNextIterator, rpmTag, and rpmTagType. Referenced by rpmRollback.

IDTX IDTXnew | ( | void |  | ) |

| Definition at line 757 of file rpminstall.c. References xcalloc. Referenced by IDTXgrow.

IDTX IDTXsort | ( | IDTX | idtx | ) |

| Definition at line 782 of file rpminstall.c. References IDTintcmp. Referenced by IDTXglob, and IDTXload.

void printHash | ( | const unsigned long | amount,
|  | const unsigned long | total
| ) | `[static]`

| Definition at line 33 of file rpminstall.c. References hashesPrinted, progressCurrent, and progressTotal. Referenced by rpmShowProgress.

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

Definition at line 596 of file rpminstall.c.

References _, _free, printDepProblems, rpmdbClose, rpmdbFreeIterator, rpmdbGetIteratorCount, rpmdbGetIteratorOffset, RPMDBI_LABEL, rpmdbInitIterator, rpmdbNextIterator, rpmdbOpen, rpmdepCheck, rpmdepFreeConflicts, rpmGetPath, rpmRunTransactions, RPMTRANS_FLAG_REVERSE, RPMTRANS_FLAG_TEST, rpmtransCreateSet, rpmtransFlags, rpmtransFree, and rpmtransRemovePackage.

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 204 of file rpminstall.c.

References _, _free, alloca, rpmEIU::argc, rpmEIU::argv, rpmEIU::db, Fclose, rpmEIU::fd, Ferror, rpmEIU::fnp, Fopen, Fstrerror, ftpStrerror, rpmEIU::h, headerFree, headerFreeData, headerGetEntry, headerNVR, 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, rpmGenPath, rpmGetPath, rpmGlob, rpmInstallSourcePackage, 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
| ) |

| Definition at line 684 of file rpminstall.c. References _, _free, Fclose, Ferror, Fopen, Fstrerror, rpmInstallSourcePackage, rpmRC, and RPMRC_OK. Referenced by main.

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

Definition at line 905 of file rpminstall.c.

References _, _free, headerFree, IDTXfree, IDTXglob, IDTXload, packagesTotal, printDepProblems, rpmdbClose, rpmdbOpen, rpmdepCheck, rpmdepFreeConflicts, rpmdepOrder, rpmExpand, RPMPROB_FILTER_OLDPACKAGE, rpmProblemSetFree, rpmProblemSetPrint, rpmRunTransactions, rpmShowProgress, RPMTAG_INSTALLTID, RPMTAG_REMOVETID, rpmtransAddPackage, rpmtransCreateSet, rpmtransFree, and rpmtransRemovePackage.

Referenced by main.

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

| Definition at line 75 of file rpminstall.c. References _, _free, Fclose, fdFree, fdLink, Fopen, hashesPrinted, headerSprintf, packagesTotal, printHash, progressCurrent, progressTotal, and rpmTagTable. Referenced by rpmInstall, and rpmRollback.

## Variable Documentation

int hashesPrinted = 0`[static]`

| Definition at line 22 of file rpminstall.c. Referenced by printHash, and rpmShowProgress.

int packagesTotal = 0

| Definition at line 25 of file rpminstall.c. Referenced by rpmInstall, rpmRollback, and rpmShowProgress.

int progressCurrent = 0`[static]`

| Definition at line 29 of file rpminstall.c. Referenced by printHash, and rpmShowProgress.

int progressTotal = 0`[static]`

| Definition at line 27 of file rpminstall.c. Referenced by printHash, and rpmShowProgress.

int reverse = -1`[static]`

| Definition at line 723 of file rpminstall.c. Referenced by IDTintcmp.