2002-03-14 01:59:49 +08:00
|
|
|
#ifndef H_RPMTS
|
|
|
|
#define H_RPMTS
|
|
|
|
|
2002-05-17 00:55:21 +08:00
|
|
|
/** \ingroup rpmts
|
2002-03-14 01:59:49 +08:00
|
|
|
* \file lib/rpmts.h
|
2002-05-20 02:42:25 +08:00
|
|
|
* Structures and prototypes used for an "rpmts" transaction set.
|
2002-03-14 01:59:49 +08:00
|
|
|
*/
|
|
|
|
|
2002-07-14 03:08:51 +08:00
|
|
|
#include "rpmps.h"
|
2002-04-12 00:55:19 +08:00
|
|
|
|
2002-03-14 01:59:49 +08:00
|
|
|
/*@unchecked@*/
|
|
|
|
/*@-exportlocal@*/
|
|
|
|
extern int _ts_debug;
|
|
|
|
/*@=exportlocal@*/
|
|
|
|
|
2002-05-20 07:37:24 +08:00
|
|
|
#define _RPMTS_VSF_NODIGESTS (1 << 0)
|
|
|
|
#define _RPMTS_VSF_NOSIGNATURES (1 << 1)
|
|
|
|
#define _RPMTS_VSF_VERIFY_LEGACY (1 << 2)
|
|
|
|
|
|
|
|
#if defined(_RPMTS_INTERNAL)
|
|
|
|
|
2002-07-14 03:08:51 +08:00
|
|
|
#include "rpmhash.h" /* XXX hashTable */
|
|
|
|
#include "rpmal.h" /* XXX availablePackage/relocateFileList ,*/
|
|
|
|
|
2002-04-12 00:55:19 +08:00
|
|
|
/*@unchecked@*/
|
|
|
|
/*@-exportlocal@*/
|
|
|
|
extern int _cacheDependsRC;
|
|
|
|
/*@=exportlocal@*/
|
|
|
|
|
2002-05-20 02:42:25 +08:00
|
|
|
/** \ingroup rpmts
|
|
|
|
*/
|
|
|
|
typedef /*@abstract@*/ struct diskspaceInfo_s * rpmDiskSpaceInfo;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
*/
|
|
|
|
struct diskspaceInfo_s {
|
|
|
|
dev_t dev; /*!< File system device number. */
|
|
|
|
signed long bneeded; /*!< No. of blocks needed. */
|
|
|
|
signed long ineeded; /*!< No. of inodes needed. */
|
|
|
|
int bsize; /*!< File system block size. */
|
|
|
|
signed long bavail; /*!< No. of blocks available. */
|
|
|
|
signed long iavail; /*!< No. of inodes available. */
|
|
|
|
};
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Adjust for root only reserved space. On linux e2fs, this is 5%.
|
|
|
|
*/
|
|
|
|
#define adj_fs_blocks(_nb) (((_nb) * 21) / 20)
|
|
|
|
|
|
|
|
/* argon thought a shift optimization here was a waste of time... he's
|
|
|
|
probably right :-( */
|
|
|
|
#define BLOCK_ROUND(size, block) (((size) + (block) - 1) / (block))
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
*/
|
2002-04-13 09:28:20 +08:00
|
|
|
typedef enum tsStage_e {
|
|
|
|
TSM_UNKNOWN = 0,
|
|
|
|
TSM_INSTALL = 7,
|
|
|
|
TSM_ERASE = 8,
|
|
|
|
} tsmStage;
|
|
|
|
|
2002-05-17 00:55:21 +08:00
|
|
|
/** \ingroup rpmts
|
2002-03-14 01:59:49 +08:00
|
|
|
* The set of packages to be installed/removed atomically.
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
struct rpmts_s {
|
2002-05-20 07:37:24 +08:00
|
|
|
rpmtransFlags transFlags; /*!< Bit(s) to control operation. */
|
2002-04-13 09:28:20 +08:00
|
|
|
tsmStage goal; /*!< Transaction goal (i.e. mode) */
|
|
|
|
|
2002-07-22 06:06:19 +08:00
|
|
|
/*@refcounted@*/ /*@null@*/
|
|
|
|
rpmdb sdb; /*!< Solve database handle. */
|
|
|
|
int sdbmode; /*!< Solve database open mode. */
|
2002-04-13 09:28:20 +08:00
|
|
|
/*@null@*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int (*solve) (rpmts ts, const rpmds key)
|
2002-04-14 02:52:18 +08:00
|
|
|
/*@modifies ts @*/; /*!< Search for NEVRA key. */
|
2002-04-13 09:28:20 +08:00
|
|
|
int nsuggests; /*!< No. of depCheck suggestions. */
|
|
|
|
/*@only@*/ /*@null@*/
|
|
|
|
const void ** suggests; /*!< Possible depCheck suggestions. */
|
|
|
|
|
2002-04-14 02:52:18 +08:00
|
|
|
/*@observer@*/ /*@null@*/
|
|
|
|
rpmCallbackFunction notify; /*!< Callback function. */
|
2002-03-14 01:59:49 +08:00
|
|
|
/*@observer@*/ /*@null@*/
|
|
|
|
rpmCallbackData notifyData; /*!< Callback private data. */
|
2002-04-14 02:52:18 +08:00
|
|
|
|
2002-03-14 01:59:49 +08:00
|
|
|
/*@refcounted@*/ /*@null@*/
|
2002-05-20 02:42:25 +08:00
|
|
|
rpmps probs; /*!< Current problems in transaction. */
|
2002-03-14 01:59:49 +08:00
|
|
|
rpmprobFilterFlags ignoreSet;
|
|
|
|
/*!< Bits to filter current problems. */
|
|
|
|
|
|
|
|
int filesystemCount; /*!< No. of mounted filesystems. */
|
2002-04-13 09:28:20 +08:00
|
|
|
/*@dependent@*/ /*@null@*/
|
2002-03-14 01:59:49 +08:00
|
|
|
const char ** filesystems; /*!< Mounted filesystem names. */
|
2002-04-12 00:55:19 +08:00
|
|
|
/*@only@*/ /*@null@*/
|
2002-05-20 02:42:25 +08:00
|
|
|
rpmDiskSpaceInfo dsi; /*!< Per filesystem disk/inode usage. */
|
2002-03-14 01:59:49 +08:00
|
|
|
|
|
|
|
/*@refcounted@*/ /*@null@*/
|
2002-05-18 05:08:39 +08:00
|
|
|
rpmdb rdb; /*!< Install database handle. */
|
2002-07-22 06:06:19 +08:00
|
|
|
int dbmode; /*!< Install database open mode. */
|
2002-03-14 01:59:49 +08:00
|
|
|
/*@only@*/
|
|
|
|
hashTable ht; /*!< Fingerprint hash table. */
|
|
|
|
|
|
|
|
/*@only@*/ /*@null@*/
|
|
|
|
int * removedPackages; /*!< Set of packages being removed. */
|
|
|
|
int numRemovedPackages; /*!< No. removed package instances. */
|
|
|
|
int allocedRemovedPackages; /*!< Size of removed packages array. */
|
|
|
|
|
|
|
|
/*@only@*/
|
2002-05-28 02:12:12 +08:00
|
|
|
rpmal addedPackages; /*!< Set of packages being installed. */
|
2002-03-14 01:59:49 +08:00
|
|
|
int numAddedPackages; /*!< No. added package instances. */
|
|
|
|
|
2002-05-28 05:40:08 +08:00
|
|
|
#ifndef DYING
|
2002-03-14 01:59:49 +08:00
|
|
|
/*@only@*/
|
2002-05-28 02:12:12 +08:00
|
|
|
rpmal availablePackages; /*!< Universe of available packages. */
|
2002-03-14 01:59:49 +08:00
|
|
|
int numAvailablePackages; /*!< No. available package instances. */
|
2002-05-28 05:40:08 +08:00
|
|
|
#endif
|
2002-03-14 01:59:49 +08:00
|
|
|
|
|
|
|
/*@owned@*/
|
2002-05-20 02:42:25 +08:00
|
|
|
rpmte * order; /*!< Packages sorted by dependencies. */
|
2002-03-14 01:59:49 +08:00
|
|
|
int orderCount; /*!< No. of transaction elements. */
|
|
|
|
int orderAlloced; /*!< No. of allocated transaction elements. */
|
|
|
|
|
|
|
|
int chrootDone; /*!< Has chroot(2) been been done? */
|
|
|
|
/*@only@*/ /*@null@*/
|
|
|
|
const char * rootDir; /*!< Path to top of install tree. */
|
|
|
|
/*@only@*/ /*@null@*/
|
|
|
|
const char * currDir; /*!< Current working directory. */
|
|
|
|
/*@null@*/
|
|
|
|
FD_t scriptFd; /*!< Scriptlet stdout/stderr. */
|
|
|
|
int delta; /*!< Delta for reallocation. */
|
2002-05-18 05:08:39 +08:00
|
|
|
int_32 tid; /*!< Transaction id. */
|
2002-03-14 01:59:49 +08:00
|
|
|
|
2002-05-24 03:42:23 +08:00
|
|
|
int vsflags; /*!< Signature/digest verification flags. */
|
2002-03-14 01:59:49 +08:00
|
|
|
|
|
|
|
/*@observer@*/ /*@dependent@*/ /*@null@*/
|
|
|
|
const char * fn; /*!< Current package fn. */
|
|
|
|
int_32 sigtag; /*!< Current package signature tag. */
|
|
|
|
int_32 sigtype; /*!< Current package signature data type. */
|
2002-05-28 02:12:12 +08:00
|
|
|
/*@null@*/
|
|
|
|
const void * sig; /*!< Current package signature. */
|
2002-03-14 01:59:49 +08:00
|
|
|
int_32 siglen; /*!< Current package signature length. */
|
2002-05-07 09:07:41 +08:00
|
|
|
|
|
|
|
/*@only@*/ /*@null@*/
|
|
|
|
const unsigned char * pkpkt;/*!< Current pubkey packet. */
|
|
|
|
size_t pkpktlen; /*!< Current pubkey packet length. */
|
|
|
|
unsigned char pksignid[8]; /*!< Current pubkey fingerprint. */
|
|
|
|
|
2002-03-14 01:59:49 +08:00
|
|
|
/*@null@*/
|
2002-07-21 05:07:31 +08:00
|
|
|
pgpDig dig; /*!< Current signature/pubkey parameters. */
|
2002-03-14 01:59:49 +08:00
|
|
|
|
2002-05-28 02:12:12 +08:00
|
|
|
/*@refs@*/
|
|
|
|
int nrefs; /*!< Reference count. */
|
2002-03-14 01:59:49 +08:00
|
|
|
|
|
|
|
};
|
2002-05-20 07:37:24 +08:00
|
|
|
#endif /* _RPMTS_INTERNAL */
|
2002-05-17 00:55:21 +08:00
|
|
|
|
2002-03-14 01:59:49 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2002-05-17 00:55:21 +08:00
|
|
|
/** \ingroup rpmts
|
|
|
|
* Check that all dependencies can be resolved.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return 0 on success
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmtsCheck(rpmts ts)
|
2002-07-22 06:06:19 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
|
|
|
|
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
|
2002-05-17 00:55:21 +08:00
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Determine package order in a transaction set according to dependencies.
|
|
|
|
*
|
|
|
|
* Order packages, returning error if circular dependencies cannot be
|
2002-07-22 06:06:19 +08:00
|
|
|
* eliminated by removing Requires's from the loop(s). Only dependencies from
|
2002-05-17 00:55:21 +08:00
|
|
|
* added or removed packages are used to determine ordering using a
|
|
|
|
* topological sort (Knuth vol. 1, p. 262). Use rpmtsCheck() to verify
|
|
|
|
* that all dependencies can be resolved.
|
|
|
|
*
|
|
|
|
* The final order ends up as installed packages followed by removed packages,
|
|
|
|
* with packages removed for upgrades immediately following the new package
|
|
|
|
* to be installed.
|
|
|
|
*
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return no. of (added) packages that could not be ordered
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmtsOrder(rpmts ts)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@globals fileSystem, internalState@*/
|
|
|
|
/*@modifies ts, fileSystem, internalState @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
2002-07-22 06:06:19 +08:00
|
|
|
* Process all package elements in a transaction set.
|
2002-05-17 00:55:21 +08:00
|
|
|
*
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param okProbs previously known problems (or NULL)
|
|
|
|
* @param ignoreSet bits to filter problem types
|
|
|
|
* @return 0 on success, -1 on error, >0 with newProbs set
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@globals rpmGlobalMacroContext,
|
|
|
|
fileSystem, internalState@*/
|
|
|
|
/*@modifies ts, rpmGlobalMacroContext,
|
|
|
|
fileSystem, internalState @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Unreference a transaction instance.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param msg
|
|
|
|
* @return NULL always
|
|
|
|
*/
|
|
|
|
/*@unused@*/ /*@null@*/
|
2002-05-20 02:42:25 +08:00
|
|
|
rpmts rpmtsUnlink (/*@killref@*/ /*@only@*/ rpmts ts,
|
2002-05-17 00:55:21 +08:00
|
|
|
const char * msg)
|
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
|
|
|
/** @todo Remove debugging entry from the ABI. */
|
|
|
|
/*@null@*/
|
2002-05-20 02:42:25 +08:00
|
|
|
rpmts XrpmtsUnlink (/*@killref@*/ /*@only@*/ rpmts ts,
|
2002-05-17 00:55:21 +08:00
|
|
|
const char * msg, const char * fn, unsigned ln)
|
|
|
|
/*@modifies ts @*/;
|
|
|
|
#define rpmtsUnlink(_ts, _msg) XrpmtsUnlink(_ts, _msg, __FILE__, __LINE__)
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Reference a transaction set instance.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param msg
|
|
|
|
* @return new transaction set reference
|
|
|
|
*/
|
|
|
|
/*@unused@*/
|
2002-05-20 02:42:25 +08:00
|
|
|
rpmts rpmtsLink (rpmts ts, const char * msg)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
|
|
|
/** @todo Remove debugging entry from the ABI. */
|
2002-05-20 02:42:25 +08:00
|
|
|
rpmts XrpmtsLink (rpmts ts,
|
2002-05-17 00:55:21 +08:00
|
|
|
const char * msg, const char * fn, unsigned ln)
|
|
|
|
/*@modifies ts @*/;
|
|
|
|
#define rpmtsLink(_ts, _msg) XrpmtsLink(_ts, _msg, __FILE__, __LINE__)
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Close the database used by the transaction.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return 0 on success
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmtsCloseDB(rpmts ts)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@globals fileSystem @*/
|
|
|
|
/*@modifies ts, fileSystem @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Open the database used by the transaction.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param dbmode O_RDONLY or O_RDWR
|
|
|
|
* @return 0 on success
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmtsOpenDB(rpmts ts, int dbmode)
|
2002-07-22 06:06:19 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
|
|
|
|
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
|
2002-05-17 00:55:21 +08:00
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Return transaction database iterator.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param rpmtag rpm tag
|
|
|
|
* @param keyp key data (NULL for sequential access)
|
|
|
|
* @param keylen key data length (0 will use strlen(keyp))
|
|
|
|
* @return NULL on failure
|
|
|
|
*/
|
|
|
|
/*@only@*/ /*@null@*/
|
2002-07-22 06:06:19 +08:00
|
|
|
rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@null@*/ const void * keyp, size_t keylen)
|
2002-07-22 06:06:19 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
|
|
|
|
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
|
2002-05-17 00:55:21 +08:00
|
|
|
|
|
|
|
/**
|
2002-07-22 06:06:19 +08:00
|
|
|
* Retrieve pubkey from rpm database.
|
|
|
|
* @param ts rpm transaction
|
|
|
|
* @return RPMSIG_OK on success, RPMSIG_NOKEY if not found
|
|
|
|
*/
|
|
|
|
rpmVerifySignatureReturn rpmtsFindPubkey(rpmts ts)
|
|
|
|
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
|
|
|
|
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState */;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Close the database used by the transaction to solve dependencies.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return 0 on success
|
|
|
|
*/
|
|
|
|
/*@-exportlocal@*/
|
|
|
|
int rpmtsCloseSDB(rpmts ts)
|
|
|
|
/*@globals fileSystem @*/
|
|
|
|
/*@modifies ts, fileSystem @*/;
|
|
|
|
/*@=exportlocal@*/
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Open the database used by the transaction to solve dependencies.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param dbmode O_RDONLY or O_RDWR
|
|
|
|
* @return 0 on success
|
|
|
|
*/
|
|
|
|
/*@-exportlocal@*/
|
|
|
|
int rpmtsOpenSDB(rpmts ts, int dbmode)
|
|
|
|
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
|
|
|
|
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
|
|
|
|
/*@=exportlocal@*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Attempt to solve a needed dependency using the solve database..
|
2002-05-17 00:55:21 +08:00
|
|
|
* @param ts transaction set
|
|
|
|
* @param ds dependency set
|
|
|
|
* @return 0 if resolved (and added to ts), 1 not found
|
|
|
|
*/
|
|
|
|
/*@-exportlocal@*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmtsSolve(rpmts ts, rpmds ds)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
|
|
|
|
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
|
|
|
|
/*@=exportlocal@*/
|
|
|
|
|
|
|
|
/**
|
2002-07-22 06:06:19 +08:00
|
|
|
* Attempt to solve a needed dependency using memory resident tables.
|
|
|
|
* @deprecated This function will move from rpmlib to the python bindings.
|
2002-05-17 00:55:21 +08:00
|
|
|
* @param ts transaction set
|
|
|
|
* @param ds dependency set
|
|
|
|
* @return 0 if resolved (and added to ts), 1 not found
|
|
|
|
*/
|
|
|
|
/*@unused@*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmtsAvailable(rpmts ts, const rpmds ds)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@globals fileSystem @*/
|
|
|
|
/*@modifies ts, fileSystem @*/;
|
|
|
|
|
|
|
|
/**
|
2002-05-28 05:40:08 +08:00
|
|
|
* Return current transaction set problems.
|
2002-05-17 00:55:21 +08:00
|
|
|
* @param ts transaction set
|
|
|
|
* @return current problem set (or NULL)
|
|
|
|
*/
|
|
|
|
/*@null@*/
|
2002-05-28 05:40:08 +08:00
|
|
|
rpmps rpmtsProblems(rpmts ts)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
2002-07-22 06:06:19 +08:00
|
|
|
/** \ingroup rpmts
|
|
|
|
* Free signature verification data.
|
|
|
|
* @param ts transaction set
|
|
|
|
*/
|
|
|
|
void rpmtsCleanDig(rpmts ts)
|
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
2002-05-17 00:55:21 +08:00
|
|
|
/** \ingroup rpmts
|
|
|
|
* Re-create an empty transaction set.
|
|
|
|
* @param ts transaction set
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
void rpmtsClean(rpmts ts)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Destroy transaction set, closing the database as well.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return NULL always
|
|
|
|
*/
|
|
|
|
/*@null@*/
|
2002-05-20 02:42:25 +08:00
|
|
|
rpmts rpmtsFree(/*@killref@*/ /*@only@*//*@null@*/ rpmts ts)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@globals fileSystem @*/
|
|
|
|
/*@modifies ts, fileSystem @*/;
|
|
|
|
|
2002-07-22 06:06:19 +08:00
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get verify signatures flag(s).
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return verify signatures flags
|
|
|
|
*/
|
|
|
|
int rpmtsVerifySigFlags(rpmts ts)
|
|
|
|
/*@*/;
|
|
|
|
|
2002-05-17 00:55:21 +08:00
|
|
|
/** \ingroup rpmts
|
|
|
|
* Set verify signatures flag(s).
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param vsflags new verify signatures flags
|
2002-07-22 06:06:19 +08:00
|
|
|
* @return previous value
|
2002-05-17 00:55:21 +08:00
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmtsSetVerifySigFlags(rpmts ts, int vsflags)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get transaction rootDir, i.e. path to chroot(2).
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return transaction rootDir
|
|
|
|
*/
|
|
|
|
/*@observer@*/ /*@null@*/
|
2002-06-16 03:43:41 +08:00
|
|
|
extern const char * rpmtsRootDir(rpmts ts)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Set transaction rootDir, i.e. path to chroot(2).
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param rootDir new transaction rootDir (or NULL)
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
void rpmtsSetRootDir(rpmts ts, /*@null@*/ const char * rootDir)
|
2002-05-18 05:08:39 +08:00
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get transaction currDir, i.e. current directory before chroot(2).
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return transaction currDir
|
|
|
|
*/
|
|
|
|
/*@observer@*/ /*@null@*/
|
2002-06-16 03:43:41 +08:00
|
|
|
extern const char * rpmtsCurrDir(rpmts ts)
|
2002-05-18 05:08:39 +08:00
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Set transaction currDir, i.e. current directory before chroot(2).
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param currDir new transaction currDir (or NULL)
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
void rpmtsSetCurrDir(rpmts ts, /*@null@*/ const char * currDir)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get transaction script file handle, i.e. stdout/stderr on scriptlet execution
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return transaction script file handle
|
|
|
|
*/
|
|
|
|
/*@null@*/
|
2002-05-24 03:42:23 +08:00
|
|
|
FD_t rpmtsScriptFd(rpmts ts)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Set transaction script file handle, i.e. stdout/stderr on scriptlet execution
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param scriptFd new script file handle (or NULL)
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
void rpmtsSetScriptFd(rpmts ts, /*@null@*/ FD_t scriptFd)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@modifies ts, scriptFd @*/;
|
|
|
|
|
2002-05-18 05:08:39 +08:00
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get chrootDone flag, i.e. has chroot(2) been performed?
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return chrootDone flag
|
|
|
|
*/
|
2002-05-24 03:42:23 +08:00
|
|
|
int rpmtsChrootDone(rpmts ts)
|
2002-05-18 05:08:39 +08:00
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Set chrootDone flag, i.e. has chroot(2) been performed?
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param chrootDone new chrootDone flag
|
|
|
|
* @return previous chrootDone flag
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmtsSetChrootDone(rpmts ts, int chrootDone)
|
2002-05-18 05:08:39 +08:00
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get transaction id, i.e. transaction time stamp.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return chrootDone flag
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int_32 rpmtsGetTid(rpmts ts)
|
2002-05-18 05:08:39 +08:00
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Set transaction id, i.e. transaction time stamp.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param tid new transaction id
|
|
|
|
* @return previous transaction id
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int_32 rpmtsSetTid(rpmts ts, int_32 tid)
|
2002-05-18 05:08:39 +08:00
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
2002-07-22 06:06:19 +08:00
|
|
|
* Get signature tag.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return signature tag
|
|
|
|
*/
|
|
|
|
int_32 rpmtsSigtag(const rpmts ts)
|
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get signature tag type.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return signature tag type
|
|
|
|
*/
|
|
|
|
int_32 rpmtsSigtype(const rpmts ts)
|
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get signature tag data, i.e. from header.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return signature tag data
|
|
|
|
*/
|
|
|
|
/*@observer@*/ /*@null@*/
|
|
|
|
extern const void * rpmtsSig(const rpmts ts)
|
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get signature tag data length, i.e. no. of bytes of data.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return signature tag data length
|
|
|
|
*/
|
|
|
|
int_32 rpmtsSiglen(const rpmts ts)
|
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Set signature tag info, i.e. from header.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param sigtag signature tag
|
|
|
|
* @param sigtype signature tag type
|
|
|
|
* @param sig signature tag data
|
|
|
|
* @param siglen signature tag data length
|
|
|
|
* @return 0 always
|
|
|
|
*/
|
|
|
|
int rpmtsSetSig(rpmts ts,
|
|
|
|
int_32 sigtag, int_32 sigtype,
|
|
|
|
/*@kept@*/ /*@null@*/ const void * sig, int_32 siglen)
|
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get OpenPGP packet parameters, i.e. signature/pubkey constants.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return signature/pubkey constants.
|
|
|
|
*/
|
|
|
|
/*@exposed@*/ /*@null@*/
|
|
|
|
pgpDig rpmtsDig(rpmts ts)
|
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get OpenPGP signature constants.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return signature constants.
|
|
|
|
*/
|
|
|
|
/*@exposed@*/ /*@null@*/
|
|
|
|
pgpDigParams rpmtsSignature(const rpmts ts)
|
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get OpenPGP pubkey constants.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return pubkey constants.
|
|
|
|
*/
|
|
|
|
/*@exposed@*/ /*@null@*/
|
|
|
|
pgpDigParams rpmtsPubkey(const rpmts ts)
|
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get transaction set database handle.
|
2002-05-18 05:08:39 +08:00
|
|
|
* @param ts transaction set
|
|
|
|
* @return transaction database handle
|
|
|
|
*/
|
|
|
|
/*@null@*/
|
2002-05-20 02:42:25 +08:00
|
|
|
rpmdb rpmtsGetRdb(rpmts ts)
|
2002-05-18 05:08:39 +08:00
|
|
|
/*@*/;
|
|
|
|
|
2002-05-17 00:55:21 +08:00
|
|
|
/** \ingroup rpmts
|
2002-05-20 02:42:25 +08:00
|
|
|
* Initialize disk space info for each and every mounted file systems.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return 0 on success
|
|
|
|
*/
|
|
|
|
int rpmtsInitDSI(const rpmts ts)
|
|
|
|
/*@globals fileSystem, internalState @*/
|
|
|
|
/*@modifies ts, fileSystem, internalState @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Update disk space info for a file.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param dev mount point device
|
|
|
|
* @param fileSize file size
|
|
|
|
* @param prevSize previous file size (if upgrading)
|
|
|
|
* @param fixupSize size difference (if
|
|
|
|
* @param action file disposition
|
|
|
|
*/
|
|
|
|
void rpmtsUpdateDSI(const rpmts ts, dev_t dev,
|
|
|
|
uint_32 fileSize, uint_32 prevSize, uint_32 fixupSize,
|
|
|
|
fileAction action)
|
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Check a transaction element for disk space problems.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param te current transaction element
|
|
|
|
*/
|
|
|
|
void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
|
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
2002-05-20 07:37:24 +08:00
|
|
|
/**
|
|
|
|
* Perform transaction progress notify callback.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param te current transaction element
|
|
|
|
* @param what type of call back
|
|
|
|
* @param amount current value
|
|
|
|
* @param total final value
|
|
|
|
* @return callback dependent pointer
|
|
|
|
*/
|
|
|
|
/*@null@*/
|
|
|
|
void * rpmtsNotify(rpmts ts, rpmte te,
|
|
|
|
rpmCallbackType what, unsigned long amount, unsigned long total)
|
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return number of (ordered) transaction set elements.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return no. of transaction set elements
|
|
|
|
*/
|
|
|
|
int rpmtsNElements(rpmts ts)
|
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return (ordered) transaction set element.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param ix transaction element index
|
|
|
|
* @return transaction element
|
|
|
|
*/
|
|
|
|
rpmte rpmtsElement(rpmts ts, int ix)
|
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get problem ignore bit mask, i.e. bits to filter encountered problems.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @return ignore bit mask
|
|
|
|
*/
|
|
|
|
rpmprobFilterFlags rpmtsFilterFlags(rpmts ts)
|
|
|
|
/*@*/;
|
|
|
|
|
2002-05-20 02:42:25 +08:00
|
|
|
/** \ingroup rpmts
|
|
|
|
* Get transaction flags, i.e. bits that control rpmtsRun().
|
2002-05-17 00:55:21 +08:00
|
|
|
* @param ts transaction set
|
|
|
|
* @return transaction flags
|
|
|
|
*/
|
2002-05-20 07:37:24 +08:00
|
|
|
rpmtransFlags rpmtsFlags(rpmts ts)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
2002-05-20 02:42:25 +08:00
|
|
|
* Set transaction flags, i.e. bits that control rpmtsRun().
|
2002-05-17 00:55:21 +08:00
|
|
|
* @param ts transaction set
|
2002-05-18 05:08:39 +08:00
|
|
|
* @param transFlags new transaction flags
|
2002-05-17 00:55:21 +08:00
|
|
|
* @return previous transaction flags
|
|
|
|
*/
|
2002-05-20 07:37:24 +08:00
|
|
|
rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Set transaction notify callback function and argument.
|
|
|
|
*
|
|
|
|
* @warning This call must be made before rpmtsRun() for
|
2002-07-22 06:06:19 +08:00
|
|
|
* install/upgrade/freshen to function correctly.
|
2002-05-17 00:55:21 +08:00
|
|
|
*
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param notify progress callback
|
|
|
|
* @param notifyData progress callback private data
|
|
|
|
* @return 0 on success
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmtsSetNotifyCallback(rpmts ts,
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@observer@*/ rpmCallbackFunction notify,
|
|
|
|
/*@observer@*/ rpmCallbackData notifyData)
|
|
|
|
/*@modifies ts @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Create an empty transaction set.
|
|
|
|
* @return new transaction set
|
|
|
|
*/
|
2002-06-20 02:52:46 +08:00
|
|
|
/*@newref@*/
|
2002-05-20 02:42:25 +08:00
|
|
|
rpmts rpmtsCreate(void)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Add package to be installed to transaction set.
|
|
|
|
*
|
2002-07-22 06:06:19 +08:00
|
|
|
* The transaction set is checked for duplicate package names.
|
|
|
|
* If found, the package with the "newest" EVR will be replaced.
|
2002-05-17 00:55:21 +08:00
|
|
|
*
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param h header
|
|
|
|
* @param key package retrieval key (e.g. file name)
|
|
|
|
* @param upgrade is package being upgraded?
|
|
|
|
* @param relocs package file relocations
|
|
|
|
* @return 0 on success, 1 on I/O error, 2 needs capabilities
|
|
|
|
*/
|
2002-05-28 05:40:08 +08:00
|
|
|
int rpmtsAddInstallElement(rpmts ts, Header h,
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@exposed@*/ /*@null@*/ const fnpyKey key, int upgrade,
|
|
|
|
/*@null@*/ rpmRelocation * relocs)
|
2002-07-22 06:06:19 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
|
|
|
|
/*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
|
2002-05-17 00:55:21 +08:00
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Add package to be erased to transaction set.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param h header
|
|
|
|
* @param dboffset rpm database instance
|
|
|
|
* @return 0 on success
|
|
|
|
*/
|
2002-05-28 05:40:08 +08:00
|
|
|
int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset)
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@modifies ts, h @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmts
|
|
|
|
* Retrieve keys from ordered transaction set.
|
|
|
|
* @todo Removed packages have no keys, returned as interleaved NULL pointers.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @retval ep address of returned element array pointer (or NULL)
|
|
|
|
* @retval nep address of no. of returned elements (or NULL)
|
|
|
|
* @return 0 always
|
|
|
|
*/
|
|
|
|
/*@unused@*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmtsGetKeys(rpmts ts,
|
2002-05-17 00:55:21 +08:00
|
|
|
/*@null@*/ /*@out@*/ fnpyKey ** ep,
|
|
|
|
/*@null@*/ /*@out@*/ int * nep)
|
|
|
|
/*@modifies ts, ep, nep @*/;
|
|
|
|
|
2002-03-14 01:59:49 +08:00
|
|
|
/**
|
|
|
|
* Return (malloc'd) header name-version-release string.
|
|
|
|
* @param h header
|
|
|
|
* @retval np name tag value
|
|
|
|
* @return name-version-release string
|
|
|
|
*/
|
2002-06-23 02:51:56 +08:00
|
|
|
/*@only@*/ char * hGetNEVR(Header h, /*@null@*/ /*@out@*/ const char ** np )
|
2002-03-14 01:59:49 +08:00
|
|
|
/*@modifies *np @*/;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* H_RPMTS */
|