diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-10-31 12:08:01 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-10-31 12:08:01 +0200 |
commit | 05fcdb49f1d366b65a72b1a22f299fa5be41f4e3 (patch) | |
tree | f157a2e62640acd059e774a58df26db5801b5e6b | |
parent | a3bbfc98eefa6cf272ed8f391c8efc6af995bd53 (diff) | |
download | librpm-tizen-05fcdb49f1d366b65a72b1a22f299fa5be41f4e3.tar.gz librpm-tizen-05fcdb49f1d366b65a72b1a22f299fa5be41f4e3.tar.bz2 librpm-tizen-05fcdb49f1d366b65a72b1a22f299fa5be41f4e3.zip |
Split out rpmts_internal.h from rpmts.h
-rw-r--r-- | lib/Makefile.am | 2 | ||||
-rw-r--r-- | lib/depends.c | 3 | ||||
-rw-r--r-- | lib/rpmts.c | 4 | ||||
-rw-r--r-- | lib/rpmts.h | 118 | ||||
-rw-r--r-- | lib/rpmts_internal.h | 120 | ||||
-rw-r--r-- | lib/transaction.c | 3 |
6 files changed, 124 insertions, 126 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index e178c5708..89b0f7b5f 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -24,7 +24,7 @@ librpm_la_SOURCES = \ idtx.c manifest.c manifest.h misc.c package.c \ poptALL.c poptI.c poptQV.c psm.c psm.h query.c \ rpmal.c rpmchecksig.c rpmds.c rpmfi.c rpmgi.c rpmgi_internal.h \ - rpminstall.c rpmtsscore.h \ + rpminstall.c rpmtsscore.h rpmts_internal.h \ rpmlead.c rpmlead.h rpmlibprov.c rpmps.c rpmrc.c rpmte.c rpmts.c \ rpmvercmp.c signature.c signature.h stringbuf.c transaction.c \ verify.c rpmlock.c rpmlock.h misc.h diff --git a/lib/depends.c b/lib/depends.c index 163b3193f..324c4e63a 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -17,8 +17,7 @@ #define _RPMTE_INTERNAL #include "rpmte.h" -#define _RPMTS_INTERNAL -#include "rpmts.h" +#include "rpmts_internal.h" #include "debug.h" diff --git a/lib/rpmts.c b/lib/rpmts.c index 81851bbcc..13a7626b9 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -18,9 +18,7 @@ #include "rpmte.h" -#define _RPMTS_INTERNAL -#include "rpmts.h" -#include "rpmtsscore.h" +#include "rpmts_internal.h" /* XXX FIXME: merge with existing (broken?) tests in system.h */ /* portability fiddles */ diff --git a/lib/rpmts.h b/lib/rpmts.h index 4ec1727e8..7d9617541 100644 --- a/lib/rpmts.h +++ b/lib/rpmts.h @@ -95,124 +95,6 @@ typedef enum rpmtsOpX_e { RPMTS_OP_MAX = 17 } rpmtsOpX; -#if defined(_RPMTS_INTERNAL) - -#include "rpmhash.h" /* XXX hashTable */ -#include "rpmal.h" /* XXX availablePackage/relocateFileList ,*/ -#include "rpmtsscore.h" /* for rpmtsScore */ - -extern int _cacheDependsRC; - -/** \ingroup rpmts - */ -typedef 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 long bavail; /*!< No. of blocks available. */ - signed long 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 - * The set of packages to be installed/removed atomically. - */ -struct rpmts_s { - rpmtransFlags transFlags; /*!< Bit(s) to control operation. */ - rpmtsType type; /*!< default, rollback, autorollback */ - - rpmdb sdb; /*!< Solve database handle. */ - int sdbmode; /*!< Solve database open mode. */ - int (*solve) (rpmts ts, rpmds key, const void * data); - /*!< Search for NEVRA key. */ - const void * solveData; /*!< Solve callback data */ - int nsuggests; /*!< No. of depCheck suggestions. */ - const void ** suggests; /*!< Possible depCheck suggestions. */ - - rpmCallbackFunction notify; /*!< Callback function. */ - rpmCallbackData notifyData; /*!< Callback private data. */ - - rpmps probs; /*!< Current problems in transaction. */ - rpmprobFilterFlags ignoreSet; - /*!< Bits to filter current problems. */ - - int filesystemCount; /*!< No. of mounted filesystems. */ - const char ** filesystems; /*!< Mounted filesystem names. */ - rpmDiskSpaceInfo dsi; /*!< Per filesystem disk/inode usage. */ - - rpmdb rdb; /*!< Install database handle. */ - int dbmode; /*!< Install database open mode. */ - hashTable ht; /*!< Fingerprint hash table. */ - - int * removedPackages; /*!< Set of packages being removed. */ - int numRemovedPackages; /*!< No. removed package instances. */ - int allocedRemovedPackages; /*!< Size of removed packages array. */ - - rpmal addedPackages; /*!< Set of packages being installed. */ - int numAddedPackages; /*!< No. added package instances. */ - -#ifndef DYING - rpmal availablePackages; /*!< Universe of available packages. */ - int numAvailablePackages; /*!< No. available package instances. */ -#endif - - rpmte relocateElement; /*!< Element to use when relocating packages. */ - - rpmte * order; /*!< Packages sorted by dependencies. */ - int orderCount; /*!< No. of transaction elements. */ - int orderAlloced; /*!< No. of allocated transaction elements. */ - int unorderedSuccessors; /*!< Index of 1st element of successors. */ - int ntrees; /*!< No. of dependency trees. */ - int maxDepth; /*!< Maximum depth of dependency tree(s). */ - - int selinuxEnabled; /*!< Is SE linux enabled? */ - int chrootDone; /*!< Has chroot(2) been been done? */ - const char * rootDir; /*!< Path to top of install tree. */ - const char * currDir; /*!< Current working directory. */ - FD_t scriptFd; /*!< Scriptlet stdout/stderr. */ - int delta; /*!< Delta for reallocation. */ - int32_t tid; /*!< Transaction id. */ - - uint32_t color; /*!< Transaction color bits. */ - uint32_t prefcolor; /*!< Preferred file color. */ - - rpmVSFlags vsflags; /*!< Signature/digest verification flags. */ - - const char * fn; /*!< Current package fn. */ - int32_t sigtag; /*!< Current package signature tag. */ - int32_t sigtype; /*!< Current package signature data type. */ - const void * sig; /*!< Current package signature. */ - int32_t siglen; /*!< Current package signature length. */ - - const unsigned char * pkpkt;/*!< Current pubkey packet. */ - size_t pkpktlen; /*!< Current pubkey packet length. */ - unsigned char pksignid[8]; /*!< Current pubkey fingerprint. */ - - struct rpmop_s ops[RPMTS_OP_MAX]; - - pgpDig dig; /*!< Current signature/pubkey parameters. */ - - rpmSpec spec; /*!< Spec file control structure. */ - - rpmtsScore score; /*!< Transaction Score (autorollback). */ - - int nrefs; /*!< Reference count. */ -}; -#endif /* _RPMTS_INTERNAL */ - /** \ingroup rpmts * Perform dependency resolution on the transaction set. * diff --git a/lib/rpmts_internal.h b/lib/rpmts_internal.h new file mode 100644 index 000000000..dd52ef1f9 --- /dev/null +++ b/lib/rpmts_internal.h @@ -0,0 +1,120 @@ +#ifndef _RPMTS_INTERNAL_H +#define _RPMTS_INTERNAL_H + +#include "rpmts.h" +#include "rpmhash.h" /* XXX hashTable */ +#include "rpmal.h" /* XXX availablePackage/relocateFileList ,*/ +#include "rpmtsscore.h" /* for rpmtsScore */ + +extern int _cacheDependsRC; + +/** \ingroup rpmts + */ +typedef 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 long bavail; /*!< No. of blocks available. */ + signed long 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 + * The set of packages to be installed/removed atomically. + */ +struct rpmts_s { + rpmtransFlags transFlags; /*!< Bit(s) to control operation. */ + rpmtsType type; /*!< default, rollback, autorollback */ + + rpmdb sdb; /*!< Solve database handle. */ + int sdbmode; /*!< Solve database open mode. */ + int (*solve) (rpmts ts, rpmds key, const void * data); + /*!< Search for NEVRA key. */ + const void * solveData; /*!< Solve callback data */ + int nsuggests; /*!< No. of depCheck suggestions. */ + const void ** suggests; /*!< Possible depCheck suggestions. */ + + rpmCallbackFunction notify; /*!< Callback function. */ + rpmCallbackData notifyData; /*!< Callback private data. */ + + rpmps probs; /*!< Current problems in transaction. */ + rpmprobFilterFlags ignoreSet; + /*!< Bits to filter current problems. */ + + int filesystemCount; /*!< No. of mounted filesystems. */ + const char ** filesystems; /*!< Mounted filesystem names. */ + rpmDiskSpaceInfo dsi; /*!< Per filesystem disk/inode usage. */ + + rpmdb rdb; /*!< Install database handle. */ + int dbmode; /*!< Install database open mode. */ + hashTable ht; /*!< Fingerprint hash table. */ + + int * removedPackages; /*!< Set of packages being removed. */ + int numRemovedPackages; /*!< No. removed package instances. */ + int allocedRemovedPackages; /*!< Size of removed packages array. */ + + rpmal addedPackages; /*!< Set of packages being installed. */ + int numAddedPackages; /*!< No. added package instances. */ + +#ifndef DYING + rpmal availablePackages; /*!< Universe of available packages. */ + int numAvailablePackages; /*!< No. available package instances. */ +#endif + + rpmte relocateElement; /*!< Element to use when relocating packages. */ + + rpmte * order; /*!< Packages sorted by dependencies. */ + int orderCount; /*!< No. of transaction elements. */ + int orderAlloced; /*!< No. of allocated transaction elements. */ + int unorderedSuccessors; /*!< Index of 1st element of successors. */ + int ntrees; /*!< No. of dependency trees. */ + int maxDepth; /*!< Maximum depth of dependency tree(s). */ + + int selinuxEnabled; /*!< Is SE linux enabled? */ + int chrootDone; /*!< Has chroot(2) been been done? */ + const char * rootDir; /*!< Path to top of install tree. */ + const char * currDir; /*!< Current working directory. */ + FD_t scriptFd; /*!< Scriptlet stdout/stderr. */ + int delta; /*!< Delta for reallocation. */ + int32_t tid; /*!< Transaction id. */ + + uint32_t color; /*!< Transaction color bits. */ + uint32_t prefcolor; /*!< Preferred file color. */ + + rpmVSFlags vsflags; /*!< Signature/digest verification flags. */ + + const char * fn; /*!< Current package fn. */ + int32_t sigtag; /*!< Current package signature tag. */ + int32_t sigtype; /*!< Current package signature data type. */ + const void * sig; /*!< Current package signature. */ + int32_t siglen; /*!< Current package signature length. */ + + const unsigned char * pkpkt;/*!< Current pubkey packet. */ + size_t pkpktlen; /*!< Current pubkey packet length. */ + unsigned char pksignid[8]; /*!< Current pubkey fingerprint. */ + + struct rpmop_s ops[RPMTS_OP_MAX]; + + pgpDig dig; /*!< Current signature/pubkey parameters. */ + + rpmSpec spec; /*!< Spec file control structure. */ + + rpmtsScore score; /*!< Transaction Score (autorollback). */ + + int nrefs; /*!< Reference count. */ +}; + +#endif /* _RPMTS_INTERNAL_H */ diff --git a/lib/transaction.c b/lib/transaction.c index a38076642..4f47019b5 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -23,8 +23,7 @@ #define _RPMTE_INTERNAL #include "rpmte.h" -#define _RPMTS_INTERNAL -#include "rpmts.h" +#include "rpmts_internal.h" #include "cpio.h" #include "fprint.h" |