rpm  5.4.10
Macros | Typedefs | Enumerations | Functions | Variables
rpmps.h File Reference

Structures and prototypes used for an "rpmps" problem set. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define rpmpsUnlink(_ps, _msg)   ((rpmps)rpmioUnlinkPoolItem((rpmioItem)(_ps), _msg, __FILE__, __LINE__))
 
#define rpmpsLink(_ps, _msg)   ((rpmps)rpmioLinkPoolItem((rpmioItem)(_ps), _msg, __FILE__, __LINE__))
 
#define rpmpsFree(_ps)   ((rpmps)rpmioFreePoolItem((rpmioItem)(_ps), __FUNCTION__, __FILE__, __LINE__))
 

Typedefs

typedef struct rpmProblem_s * rpmProblem
 Raw data for an element of a problem set. More...
 
typedef struct rpmps_s * rpmps
 Transaction problems found while processing a transaction set/. More...
 
typedef struct rpmpsi_s * rpmpsi
 
typedef enum rpmprobFilterFlags_e rpmprobFilterFlags
 
typedef enum rpmProblemType_e rpmProblemType
 Enumerate transaction set problem types. More...
 

Enumerations

enum  rpmprobFilterFlags_e {
  RPMPROB_FILTER_NONE = 0, RPMPROB_FILTER_IGNOREOS = (1 << 0), RPMPROB_FILTER_IGNOREARCH = (1 << 1), RPMPROB_FILTER_REPLACEPKG = (1 << 2),
  RPMPROB_FILTER_FORCERELOCATE = (1 << 3), RPMPROB_FILTER_REPLACENEWFILES = (1 << 4), RPMPROB_FILTER_REPLACEOLDFILES = (1 << 5), RPMPROB_FILTER_OLDPACKAGE = (1 << 6),
  RPMPROB_FILTER_DISKSPACE = (1 << 7), RPMPROB_FILTER_DISKNODES = (1 << 8)
}
 
enum  rpmProblemType_e {
  RPMPROB_BADARCH, RPMPROB_BADOS, RPMPROB_PKG_INSTALLED, RPMPROB_BADRELOCATE,
  RPMPROB_REQUIRES, RPMPROB_CONFLICT, RPMPROB_NEW_FILE_CONFLICT, RPMPROB_FILE_CONFLICT,
  RPMPROB_OLDPACKAGE, RPMPROB_DISKSPACE, RPMPROB_DISKNODES, RPMPROB_RDONLY,
  RPMPROB_BADPRETRANS, RPMPROB_BADPLATFORM, RPMPROB_NOREPACKAGE
}
 Enumerate transaction set problem types. More...
 

Functions

const char * rpmProblemString (const rpmProblem prob)
 Return formatted string representation of a problem. More...
 
rpmps rpmpsUnlink (rpmps ps, const char *msg)
 Unreference a problem set instance. More...
 
rpmps rpmpsLink (rpmps ps, const char *msg)
 Reference a problem set instance. More...
 
rpmps rpmpsFree (rpmps ps)
 Destroy a problem set. More...
 
int rpmpsNumProblems (rpmps ps)
 Return number of problems in set. More...
 
rpmpsi rpmpsInitIterator (rpmps ps)
 Initialize problem set iterator. More...
 
rpmpsi rpmpsFreeIterator (rpmpsi psi)
 Destroy problem set iterator. More...
 
int rpmpsNextIterator (rpmpsi psi)
 Return next problem set iterator index. More...
 
rpmProblem rpmpsProblem (rpmpsi psi)
 Return current problem from problem set. More...
 
rpmps rpmpsCreate (void)
 Create a problem set. More...
 
void rpmpsPrint (FILE *fp, rpmps ps)
 Print problems to file handle. More...
 
void rpmpsAppend (rpmps ps, rpmProblemType type, const char *pkgNEVR, fnpyKey key, const char *dn, const char *bn, const char *altNEVR, rpmuint64_t ulong1)
 Append a problem to current set of problems. More...
 
int rpmpsTrim (rpmps ps, rpmps filter)
 Filter a problem set. More...
 
rpmProblem rpmpsGetProblem (rpmps ps, int num)
 Return a problem from problem set. More...
 
char * rpmProblemGetPkgNEVR (rpmProblem prob)
 Return the package NEVR causing the problem. More...
 
char * rpmProblemGetAltNEVR (rpmProblem prob)
 Return the second package NEVR causing the problem. More...
 
char * rpmProblemGetStr (rpmProblem prob)
 Return a generic data string from a problem. More...
 
rpmuint64_t rpmProblemGetDiskNeed (rpmProblem prob)
 Return generic pointer/long attribute from a problem. More...
 
rpmProblemType rpmProblemGetType (rpmProblem prob)
 Return the problem type. More...
 
fnpyKey rpmProblemKey (rpmProblem prob)
 Return the transaction key causing the problem. More...
 

Variables

int _rpmps_debug
 

Detailed Description

Structures and prototypes used for an "rpmps" problem set.

Definition in file rpmps.h.

Macro Definition Documentation

§ rpmpsFree

#define rpmpsFree (   _ps)    ((rpmps)rpmioFreePoolItem((rpmioItem)(_ps), __FUNCTION__, __FILE__, __LINE__))

Definition at line 153 of file rpmps.h.

§ rpmpsLink

#define rpmpsLink (   _ps,
  _msg 
)    ((rpmps)rpmioLinkPoolItem((rpmioItem)(_ps), _msg, __FILE__, __LINE__))

Definition at line 142 of file rpmps.h.

§ rpmpsUnlink

#define rpmpsUnlink (   _ps,
  _msg 
)    ((rpmps)rpmioUnlinkPoolItem((rpmioItem)(_ps), _msg, __FILE__, __LINE__))

Definition at line 130 of file rpmps.h.

Typedef Documentation

§ rpmprobFilterFlags

Todo:
Generalize filter mechanism.

§ rpmProblem

typedef struct rpmProblem_s* rpmProblem

Raw data for an element of a problem set.

Definition at line 17 of file rpmps.h.

§ rpmProblemType

Enumerate transaction set problem types.

§ rpmps

typedef struct rpmps_s* rpmps

Transaction problems found while processing a transaction set/.

Definition at line 22 of file rpmps.h.

§ rpmpsi

typedef struct rpmpsi_s* rpmpsi

Definition at line 26 of file rpmps.h.

Enumeration Type Documentation

§ rpmprobFilterFlags_e

Todo:
Generalize filter mechanism.
Enumerator
RPMPROB_FILTER_NONE 
RPMPROB_FILTER_IGNOREOS 

from –ignoreos

RPMPROB_FILTER_IGNOREARCH 

from –ignorearch

RPMPROB_FILTER_REPLACEPKG 

from –replacepkgs

RPMPROB_FILTER_FORCERELOCATE 

from –badreloc

RPMPROB_FILTER_REPLACENEWFILES 

from –replacefiles

RPMPROB_FILTER_REPLACEOLDFILES 

from –replacefiles

RPMPROB_FILTER_OLDPACKAGE 

from –oldpackage

RPMPROB_FILTER_DISKSPACE 

from –ignoresize

RPMPROB_FILTER_DISKNODES 

from –ignoresize

Definition at line 31 of file rpmps.h.

§ rpmProblemType_e

Enumerate transaction set problem types.

Enumerator
RPMPROB_BADARCH 

(unused) package ... is for a different architecture

RPMPROB_BADOS 

(unused) package ... is for a different operating system

RPMPROB_PKG_INSTALLED 

package ... is already installed

RPMPROB_BADRELOCATE 

path ... is not relocatable for package ...

RPMPROB_REQUIRES 

package ... has unsatisfied Requires: ...

RPMPROB_CONFLICT 

package ... has unsatisfied Conflicts: ...

RPMPROB_NEW_FILE_CONFLICT 

file ... conflicts between attempted installs of ...

RPMPROB_FILE_CONFLICT 

file ... from install of ... conflicts with file from package ...

RPMPROB_OLDPACKAGE 

package ... (which is newer than ...) is already installed

RPMPROB_DISKSPACE 

installing package ... needs ... on the ... filesystem

RPMPROB_DISKNODES 

installing package ... needs ... on the ... filesystem

RPMPROB_RDONLY 

installing package ... on ... rdonly filesystem

RPMPROB_BADPRETRANS 

(unimplemented)

RPMPROB_BADPLATFORM 

package ... is for a different platform

RPMPROB_NOREPACKAGE 

re-packaged package ... is missing

Definition at line 47 of file rpmps.h.

Function Documentation

§ rpmProblemGetAltNEVR()

char* rpmProblemGetAltNEVR ( rpmProblem  prob)

Return the second package NEVR causing the problem.

Parameters
probrpm problem
Returns
NEVR string ptr, or NULL if unset

Definition at line 403 of file rpmps.c.

Referenced by rpmts_Check(), and verifyDependencies().

§ rpmProblemGetDiskNeed()

rpmuint64_t rpmProblemGetDiskNeed ( rpmProblem  prob)

Return generic pointer/long attribute from a problem.

Parameters
probrpm problem
Returns
a generic pointer/long attribute

Definition at line 413 of file rpmps.c.

Referenced by rpmts_Run().

§ rpmProblemGetPkgNEVR()

char* rpmProblemGetPkgNEVR ( rpmProblem  prob)

Return the package NEVR causing the problem.

Parameters
probrpm problem
Returns
NEVR string ptr

Definition at line 398 of file rpmps.c.

Referenced by rpmts_Check(), and verifyDependencies().

§ rpmProblemGetStr()

char* rpmProblemGetStr ( rpmProblem  prob)

Return a generic data string from a problem.

Parameters
probrpm problem
Returns
a generic data string
Todo:
needs a better name

Definition at line 408 of file rpmps.c.

Referenced by rpmts_Run().

§ rpmProblemGetType()

rpmProblemType rpmProblemGetType ( rpmProblem  prob)

Return the problem type.

Parameters
probrpm problem
Returns
rpmProblemType

Definition at line 418 of file rpmps.c.

Referenced by rpmts_Check(), and rpmts_Run().

§ rpmProblemKey()

fnpyKey rpmProblemKey ( rpmProblem  prob)

Return the transaction key causing the problem.

Parameters
probrpm problem
Returns
fnpkey ptr if any or NULL

Definition at line 423 of file rpmps.c.

Referenced by rpmts_Check().

§ rpmProblemString()

const char* rpmProblemString ( const rpmProblem  prob)

§ rpmpsAppend()

void rpmpsAppend ( rpmps  ps,
rpmProblemType  type,
const char *  pkgNEVR,
fnpyKey  key,
const char *  dn,
const char *  bn,
const char *  altNEVR,
rpmuint64_t  ulong1 
)

Append a problem to current set of problems.

Warning
This function's args have changed, so the function cannot be used portably
Parameters
psproblem set
typetype of problem
pkgNEVRpackage name
keyfilename or python object address
dndirectory name
bnfile base name
altNEVRrelated (e.g. through a dependency) package name
ulong1generic pointer/long attribute

Definition at line 123 of file rpmps.c.

References stpcpy(), xcalloc(), xrealloc, and xstrdup().

Referenced by cmpArgvStr(), ensureOlder(), handleInstInstalledFile(), handleOverlappedFiles(), relocateFileList(), rpmdsProblem(), rpmps_Append(), rpmps_ass_sub(), rpmps_push(), rpmtsAddInstallElement(), rpmtsCheckDSIProblems(), and rpmtsSanityCheck().

§ rpmpsCreate()

rpmps rpmpsCreate ( void  )

Create a problem set.

Returns
new problem set

Definition at line 61 of file rpmps.c.

References rpmpsGetPool(), and rpmpsLink().

Referenced by rpmps_alloc(), rpmps_init(), and rpmtsProblems().

§ rpmpsFree()

rpmps rpmpsFree ( rpmps  ps)

§ rpmpsFreeIterator()

rpmpsi rpmpsFreeIterator ( rpmpsi  psi)

Destroy problem set iterator.

Parameters
psiproblem set iterator
Returns
problem set iterator (NULL)

Definition at line 91 of file rpmps.c.

References _free(), and rpmpsUnlink().

Referenced by rpmps_iternext(), rpmps_subscript(), rpmpsPrint(), rpmts_Check(), rpmts_Run(), rpmtsSanityCheck(), and verifyDependencies().

§ rpmpsGetProblem()

rpmProblem rpmpsGetProblem ( rpmps  ps,
int  num 
)

Return a problem from problem set.

Parameters
psproblem set
numproblem number (<0 is last problem)
Returns
rpmProblem, or NULL if error

Definition at line 386 of file rpmps.c.

Referenced by rpmtsAddInstallElement(), and rpmtsSanityCheck().

§ rpmpsInitIterator()

rpmpsi rpmpsInitIterator ( rpmps  ps)

Initialize problem set iterator.

Parameters
psproblem set
Returns
problem set iterator

Definition at line 78 of file rpmps.c.

References rpmpsLink(), and xcalloc().

Referenced by rpmps_iter(), rpmps_iternext(), rpmps_subscript(), rpmpsPrint(), rpmts_Check(), rpmts_Run(), rpmtsSanityCheck(), and verifyDependencies().

§ rpmpsLink()

rpmps rpmpsLink ( rpmps  ps,
const char *  msg 
)

Reference a problem set instance.

Parameters
pstransaction set
msg
Returns
new transaction set reference

Referenced by rpmpsCreate(), rpmpsInitIterator(), and rpmtsProblems().

§ rpmpsNextIterator()

int rpmpsNextIterator ( rpmpsi  psi)

Return next problem set iterator index.

Parameters
psiproblem set iterator
Returns
iterator index, -1 on termination

Definition at line 100 of file rpmps.c.

References rpmpsNumProblems().

Referenced by rpmps_iternext(), rpmps_subscript(), rpmpsPrint(), rpmts_Check(), rpmts_Run(), rpmtsSanityCheck(), and verifyDependencies().

§ rpmpsNumProblems()

int rpmpsNumProblems ( rpmps  ps)

Return number of problems in set.

Parameters
psproblem set
Returns
number of problems

Definition at line 70 of file rpmps.c.

Referenced by _rpmtsCheck(), _rpmtsRun(), rpmcliInstallProblems(), rpmps_length(), rpmps_length_get(), rpmps_print(), rpmps_push(), rpmpsNextIterator(), rpmpsProblem(), and verifyDependencies().

§ rpmpsPrint()

void rpmpsPrint ( FILE *  fp,
rpmps  ps 
)

Print problems to file handle.

Parameters
fpfile handle (NULL uses stderr)
psproblem set

Definition at line 346 of file rpmps.c.

References _free(), rpmProblemString(), rpmpsFreeIterator(), rpmpsInitIterator(), rpmpsNextIterator(), rpmpsProblem(), and sameProblem().

Referenced by rpmcliInstallProblems(), and rpmps_print().

§ rpmpsProblem()

rpmProblem rpmpsProblem ( rpmpsi  psi)

Return current problem from problem set.

Parameters
psiproblem set iterator
Returns
current rpmProblem

Definition at line 114 of file rpmps.c.

References rpmpsNumProblems().

Referenced by rpmps_iternext(), rpmps_subscript(), rpmpsPrint(), rpmts_Check(), rpmts_Run(), and verifyDependencies().

§ rpmpsTrim()

int rpmpsTrim ( rpmps  ps,
rpmps  filter 
)

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.

Parameters
psproblem set
filterproblem filter (or NULL)
Returns
0 no problems, 1 if problems remain

Definition at line 166 of file rpmps.c.

References XSTRCMP.

Referenced by _rpmtsRun().

§ rpmpsUnlink()

rpmps rpmpsUnlink ( rpmps  ps,
const char *  msg 
)

Unreference a problem set instance.

Parameters
psproblem set
msg
Returns
problem set

Referenced by rpmpsFreeIterator().

Variable Documentation

§ _rpmps_debug

int _rpmps_debug

Definition at line 26 of file rpmps.c.