#include "system.h"
#include <rpmlib.h>
#include "rpmps.h"
#include "misc.h"
#include "debug.h"
Go to the source code of this file.
Defines | |
#define | _RPMPS_INTERNAL |
#define | XSTRCMP(a, b) ((!(a) && !(b)) || ((a) && (b) && !strcmp((a), (b)))) |
Functions | |
rpmps | XrpmpsUnlink (rpmps ps, const char *msg, const char *fn, unsigned ln) |
rpmps | XrpmpsLink (rpmps ps, const char *msg, const char *fn, unsigned ln) |
int | rpmpsNumProblems (rpmps ps) |
Return number of problems in set. | |
rpmps | rpmpsCreate (void) |
Create a problem set. | |
rpmps | rpmpsFree (rpmps ps) |
Destroy a problem set. | |
void | rpmpsAppend (rpmps ps, rpmProblemType type, const char *pkgNEVR, fnpyKey key, const char *dn, const char *bn, const char *altNEVR, unsigned long long ulong1) |
Append a problem to current set of problems. | |
int | rpmpsTrim (rpmps ps, rpmps filter) |
Filter a problem set. | |
static int | vsnprintf (char *buf, int nb, const char *fmt, va_list ap) |
static int | snprintf (char *buf, int nb, const char *fmt,...) |
const char * | rpmProblemString (const rpmProblem prob) |
Return formatted string representation of a problem. | |
static int | sameProblem (const rpmProblem ap, const rpmProblem bp) |
void | rpmpsPrint (FILE *fp, rpmps ps) |
Print problems to file handle. | |
rpmProblem | rpmpsGetProblem (rpmps ps, int num) |
Return a problem from problem set. | |
char * | rpmProblemGetPkgNEVR (rpmProblem prob) |
Return the package NEVR causing the problem. | |
char * | rpmProblemGetAltNEVR (rpmProblem prob) |
Return the second package NEVR causing the problem. | |
char * | rpmProblemGetStr (rpmProblem prob) |
Return a generic data string from a problem. | |
unsigned long long | rpmProblemGetLong (rpmProblem prob) |
Return generic pointer/long attribute from a problem. | |
rpmProblemType | rpmProblemGetType (rpmProblem prob) |
Return the problem type. | |
fnpyKey | rpmProblemKey (rpmProblem prob) |
Return the transaction key causing the problem. | |
Variables | |
int | _rpmps_debug = 0 |
Definition in file rpmps.c.
#define XSTRCMP | ( | a, | |||
b | ) | ((!(a) && !(b)) || ((a) && (b) && !strcmp((a), (b)))) |
char* rpmProblemGetAltNEVR | ( | rpmProblem | prob | ) |
unsigned long long rpmProblemGetLong | ( | rpmProblem | prob | ) |
char* rpmProblemGetPkgNEVR | ( | rpmProblem | prob | ) |
char* rpmProblemGetStr | ( | rpmProblem | prob | ) |
rpmProblemType rpmProblemGetType | ( | rpmProblem | prob | ) |
fnpyKey rpmProblemKey | ( | rpmProblem | prob | ) |
const char* rpmProblemString | ( | const rpmProblem | prob | ) |
Return formatted string representation of a problem.
prob | rpm problem |
Definition at line 194 of file rpmps.c.
References _, N_, RPMPROB_BADPLATFORM, RPMPROB_BADPRETRANS, RPMPROB_BADRELOCATE, RPMPROB_CONFLICT, RPMPROB_DISKNODES, RPMPROB_DISKSPACE, RPMPROB_FILE_CONFLICT, RPMPROB_NEW_FILE_CONFLICT, RPMPROB_NOREPACKAGE, RPMPROB_OLDPACKAGE, RPMPROB_PKG_INSTALLED, RPMPROB_RDONLY, RPMPROB_REQUIRES, snprintf(), and xmalloc().
Referenced by rpmps_iternext(), rpmps_subscript(), rpmpsPrint(), and rpmts_Run().
void rpmpsAppend | ( | rpmps | ps, | |
rpmProblemType | type, | |||
const char * | pkgNEVR, | |||
fnpyKey | key, | |||
const char * | dn, | |||
const char * | bn, | |||
const char * | altNEVR, | |||
unsigned long long | ulong1 | |||
) |
Append a problem to current set of problems.
ps | problem set | |
type | type of problem | |
pkgNEVR | package name | |
key | filename or python object address | |
dn | directory name | |
bn | file base name | |
altNEVR | related (e.g. through a dependency) package name | |
ulong1 | generic pointer/long attribute |
Definition at line 82 of file rpmps.c.
References stpcpy(), xcalloc(), xrealloc(), and xstrdup().
Referenced by cmpArgvStr(), ensureOlder(), handleInstInstalledFiles(), handleOverlappedFiles(), relocateFileList(), rpmdsProblem(), rpmps_ass_sub(), rpmtsAddInstallElement(), rpmtsCheckDSIProblems(), and rpmtsRun().
rpmps rpmpsCreate | ( | void | ) |
Create a problem set.
Definition at line 55 of file rpmps.c.
References rpmpsLink, and xcalloc().
Referenced by rpmps_init(), rpmRollback(), rpmtsCheck(), and rpmtsRun().
Destroy a problem set.
ps | problem set |
Definition at line 61 of file rpmps.c.
References _free(), and rpmpsUnlink.
Referenced by checkPackageDeps(), cmpArgvStr(), ensureOlder(), handleInstInstalledFiles(), handleOverlappedFiles(), relocateFileList(), rpmErase(), rpmgiNext(), rpmInstall(), rpmps_dealloc(), rpmps_free(), rpmrbProblems(), rpmRollback(), rpmts_Check(), rpmts_Run(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsCheckDSIProblems(), rpmtsClean(), rpmtsRun(), and verifyDependencies().
rpmProblem rpmpsGetProblem | ( | rpmps | ps, | |
int | num | |||
) |
int rpmpsNumProblems | ( | rpmps | ps | ) |
Return number of problems in set.
ps | problem set |
Definition at line 47 of file rpmps.c.
Referenced by rpmErase(), rpmgiNext(), rpmInstall(), rpmps_length(), rpmrbProblems(), rpmtsCheck(), rpmtsRun(), and verifyDependencies().
void rpmpsPrint | ( | FILE * | fp, | |
rpmps | ps | |||
) |
Print problems to file handle.
fp | file handle (NULL uses stderr) | |
ps | problem set |
Definition at line 309 of file rpmps.c.
References _free(), rpmProblemString(), and sameProblem().
Referenced by rpmErase(), rpmgiNext(), rpmInstall(), rpmps_print(), and rpmrbProblems().
Filter a problem set.
As the problem sets are generated in an order solely dependent on the ordering of the packages in the transaction, and that ordering can't be changed, the problem sets must be parallel to one another. Additionally, the filter set must be a subset of the target set, given the operations available on transaction set. This is good, as it lets us perform this trim in linear time, rather then logarithmic or quadratic.
ps | problem set | |
filter | problem filter (or NULL) |
Definition at line 129 of file rpmps.c.
References XSTRCMP.
Referenced by rpmtsRun().
static int sameProblem | ( | const rpmProblem | ap, | |
const rpmProblem | bp | |||
) | [static] |
static int snprintf | ( | char * | buf, | |
int | nb, | |||
const char * | fmt, | |||
... | ||||
) | [inline, static] |
Definition at line 183 of file rpmps.c.
References vsnprintf().
Referenced by FDGsqlTag(), formatValue(), headerCheck(), intFormat(), pgpsigFormat(), PRCOsqlTag(), rpmfcHelper(), rpmProblemString(), rpmpsmStage(), rpmReadHeader(), rpmReadSignature(), shescapeFormat(), singleSprintf(), statFormat(), xmlFormat(), and yamlFormat().
static int vsnprintf | ( | char * | buf, | |
int | nb, | |||
const char * | fmt, | |||
va_list | ap | |||
) | [inline, static] |
Definition at line 34 of file rpmps.c.
References _rpmps_debug.
Definition at line 21 of file rpmps.c.
References _rpmps_debug.
int _rpmps_debug = 0 |
Definition at line 19 of file rpmps.c.
Referenced by rpmps_alloc(), rpmps_ass_sub(), rpmps_dealloc(), rpmps_Debug(), rpmps_free(), rpmps_getattro(), rpmps_init(), rpmps_iter(), rpmps_iternext(), rpmps_length(), rpmps_new(), rpmps_print(), rpmps_setattro(), rpmps_subscript(), XrpmpsLink(), and XrpmpsUnlink().