Rename pmtrans_t to alpm_trans_t

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2011-06-28 23:27:16 +10:00
parent 8a04bc25a1
commit 6b62508c86
9 changed files with 28 additions and 28 deletions

View file

@ -53,7 +53,7 @@
int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg)
{ {
const char *pkgname, *pkgver; const char *pkgname, *pkgver;
pmtrans_t *trans; alpm_trans_t *trans;
alpm_pkg_t *local; alpm_pkg_t *local;
/* Sanity checks */ /* Sanity checks */
@ -458,7 +458,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
int is_upgrade = 0; int is_upgrade = 0;
alpm_pkg_t *oldpkg = NULL; alpm_pkg_t *oldpkg = NULL;
alpm_db_t *db = handle->db_local; alpm_db_t *db = handle->db_local;
pmtrans_t *trans = handle->trans; alpm_trans_t *trans = handle->trans;
snprintf(scriptlet, PATH_MAX, "%s%s-%s/install", snprintf(scriptlet, PATH_MAX, "%s%s-%s/install",
_alpm_db_path(db), alpm_pkg_get_name(newpkg), _alpm_db_path(db), alpm_pkg_get_name(newpkg),
@ -689,7 +689,7 @@ int _alpm_upgrade_packages(alpm_handle_t *handle)
size_t pkg_count, pkg_current; size_t pkg_count, pkg_current;
int skip_ldconfig = 0, ret = 0; int skip_ldconfig = 0, ret = 0;
alpm_list_t *targ; alpm_list_t *targ;
pmtrans_t *trans = handle->trans; alpm_trans_t *trans = handle->trans;
if(trans->add == NULL) { if(trans->add == NULL) {
return 0; return 0;

View file

@ -103,7 +103,7 @@ typedef enum _pgp_verify_t {
typedef struct __alpm_handle_t alpm_handle_t; typedef struct __alpm_handle_t alpm_handle_t;
typedef struct __alpm_db_t alpm_db_t; typedef struct __alpm_db_t alpm_db_t;
typedef struct __alpm_pkg_t alpm_pkg_t; typedef struct __alpm_pkg_t alpm_pkg_t;
typedef struct __pmtrans_t pmtrans_t; typedef struct __alpm_trans_t alpm_trans_t;
/** Dependency */ /** Dependency */
typedef struct _pmdepend_t { typedef struct _pmdepend_t {

View file

@ -368,7 +368,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
alpm_list_t *i, *j, *conflicts = NULL; alpm_list_t *i, *j, *conflicts = NULL;
size_t numtargs = alpm_list_count(upgrade); size_t numtargs = alpm_list_count(upgrade);
size_t current; size_t current;
pmtrans_t *trans = handle->trans; alpm_trans_t *trans = handle->trans;
if(!upgrade) { if(!upgrade) {
return NULL; return NULL;

View file

@ -264,7 +264,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle)
size_t replaces = 0, current = 0, numtargs; size_t replaces = 0, current = 0, numtargs;
int error = 0; int error = 0;
alpm_list_t *targ; alpm_list_t *targ;
pmtrans_t *trans = handle->trans; alpm_trans_t *trans = handle->trans;
numtargs = alpm_list_count(trans->add); numtargs = alpm_list_count(trans->add);
mount_points = mount_point_list(handle); mount_points = mount_point_list(handle);

View file

@ -36,7 +36,7 @@ struct __alpm_handle_t {
alpm_list_t *dbs_sync; /* List of (alpm_db_t *) */ alpm_list_t *dbs_sync; /* List of (alpm_db_t *) */
FILE *logstream; /* log file stream pointer */ FILE *logstream; /* log file stream pointer */
FILE *lckstream; /* lock file stream pointer if one exists */ FILE *lckstream; /* lock file stream pointer if one exists */
pmtrans_t *trans; alpm_trans_t *trans;
#ifdef HAVE_LIBCURL #ifdef HAVE_LIBCURL
/* libcurl handle */ /* libcurl handle */

View file

@ -47,7 +47,7 @@
int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg)
{ {
const char *pkgname; const char *pkgname;
pmtrans_t *trans; alpm_trans_t *trans;
/* Sanity checks */ /* Sanity checks */
CHECK_HANDLE(handle, return -1); CHECK_HANDLE(handle, return -1);
@ -72,7 +72,7 @@ int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg)
static void remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp) static void remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp)
{ {
pmtrans_t *trans = handle->trans; alpm_trans_t *trans = handle->trans;
while(lp) { while(lp) {
alpm_list_t *i; alpm_list_t *i;
@ -99,7 +99,7 @@ static void remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp)
static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp) static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp)
{ {
pmtrans_t *trans = handle->trans; alpm_trans_t *trans = handle->trans;
/* Remove needed packages (which break dependencies) from target list */ /* Remove needed packages (which break dependencies) from target list */
while(lp != NULL) { while(lp != NULL) {
@ -137,7 +137,7 @@ static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp)
int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data) int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data)
{ {
alpm_list_t *lp; alpm_list_t *lp;
pmtrans_t *trans = handle->trans; alpm_trans_t *trans = handle->trans;
alpm_db_t *db = handle->db_local; alpm_db_t *db = handle->db_local;
if((trans->flags & PM_TRANS_FLAG_RECURSE) && !(trans->flags & PM_TRANS_FLAG_CASCADE)) { if((trans->flags & PM_TRANS_FLAG_RECURSE) && !(trans->flags & PM_TRANS_FLAG_CASCADE)) {
@ -358,7 +358,7 @@ int _alpm_remove_packages(alpm_handle_t *handle)
alpm_pkg_t *info; alpm_pkg_t *info;
alpm_list_t *targ, *lp; alpm_list_t *targ, *lp;
size_t pkg_count; size_t pkg_count;
pmtrans_t *trans = handle->trans; alpm_trans_t *trans = handle->trans;
pkg_count = alpm_list_count(trans->remove); pkg_count = alpm_list_count(trans->remove);

View file

@ -86,7 +86,7 @@ alpm_pkg_t SYMEXPORT *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_syn
int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade)
{ {
alpm_list_t *i, *j, *k; alpm_list_t *i, *j, *k;
pmtrans_t *trans; alpm_trans_t *trans;
alpm_db_t *db_local; alpm_db_t *db_local;
alpm_list_t *dbs_sync; alpm_list_t *dbs_sync;
@ -309,7 +309,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
alpm_list_t *unresolvable = NULL; alpm_list_t *unresolvable = NULL;
alpm_list_t *remove = NULL; alpm_list_t *remove = NULL;
int ret = 0; int ret = 0;
pmtrans_t *trans = handle->trans; alpm_trans_t *trans = handle->trans;
if(data) { if(data) {
*data = NULL; *data = NULL;
@ -588,7 +588,7 @@ static int apply_deltas(alpm_handle_t *handle)
alpm_list_t *i; alpm_list_t *i;
int ret = 0; int ret = 0;
const char *cachedir = _alpm_filecache_setup(handle); const char *cachedir = _alpm_filecache_setup(handle);
pmtrans_t *trans = handle->trans; alpm_trans_t *trans = handle->trans;
for(i = trans->add; i; i = i->next) { for(i = trans->add; i; i = i->next) {
alpm_pkg_t *spkg = i->data; alpm_pkg_t *spkg = i->data;
@ -673,7 +673,7 @@ static int apply_deltas(alpm_handle_t *handle)
* *
* @return 0 if the md5sum matched, 1 if not, -1 in case of errors * @return 0 if the md5sum matched, 1 if not, -1 in case of errors
*/ */
static int test_md5sum(pmtrans_t *trans, const char *filepath, static int test_md5sum(alpm_trans_t *trans, const char *filepath,
const char *md5sum) const char *md5sum)
{ {
int ret = _alpm_test_md5sum(filepath, md5sum); int ret = _alpm_test_md5sum(filepath, md5sum);
@ -694,7 +694,7 @@ static int validate_deltas(alpm_handle_t *handle, alpm_list_t *deltas,
{ {
int errors = 0, ret = 0; int errors = 0, ret = 0;
alpm_list_t *i; alpm_list_t *i;
pmtrans_t *trans = handle->trans; alpm_trans_t *trans = handle->trans;
if(!deltas) { if(!deltas) {
return 0; return 0;
@ -839,7 +839,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data)
alpm_list_t *deltas = NULL; alpm_list_t *deltas = NULL;
size_t numtargs, current = 0, replaces = 0; size_t numtargs, current = 0, replaces = 0;
int errors; int errors;
pmtrans_t *trans = handle->trans; alpm_trans_t *trans = handle->trans;
if(download_files(handle, &deltas)) { if(download_files(handle, &deltas)) {
alpm_list_free(deltas); alpm_list_free(deltas);

View file

@ -52,7 +52,7 @@ int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, pmtransflag_t flags,
alpm_trans_cb_event event, alpm_trans_cb_conv conv, alpm_trans_cb_event event, alpm_trans_cb_conv conv,
alpm_trans_cb_progress progress) alpm_trans_cb_progress progress)
{ {
pmtrans_t *trans; alpm_trans_t *trans;
alpm_list_t *i; alpm_list_t *i;
/* Sanity checks */ /* Sanity checks */
@ -73,7 +73,7 @@ int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, pmtransflag_t flags,
} }
} }
CALLOC(trans, 1, sizeof(pmtrans_t), RET_ERR(handle, PM_ERR_MEMORY, -1)); CALLOC(trans, 1, sizeof(alpm_trans_t), RET_ERR(handle, PM_ERR_MEMORY, -1));
trans->flags = flags; trans->flags = flags;
trans->cb_event = event; trans->cb_event = event;
trans->cb_conv = conv; trans->cb_conv = conv;
@ -113,7 +113,7 @@ static alpm_list_t *check_arch(alpm_handle_t *handle, alpm_list_t *pkgs)
/** Prepare a transaction. */ /** Prepare a transaction. */
int SYMEXPORT alpm_trans_prepare(alpm_handle_t *handle, alpm_list_t **data) int SYMEXPORT alpm_trans_prepare(alpm_handle_t *handle, alpm_list_t **data)
{ {
pmtrans_t *trans; alpm_trans_t *trans;
/* Sanity checks */ /* Sanity checks */
CHECK_HANDLE(handle, return -1); CHECK_HANDLE(handle, return -1);
@ -157,7 +157,7 @@ int SYMEXPORT alpm_trans_prepare(alpm_handle_t *handle, alpm_list_t **data)
/** Commit a transaction. */ /** Commit a transaction. */
int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data) int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data)
{ {
pmtrans_t *trans; alpm_trans_t *trans;
/* Sanity checks */ /* Sanity checks */
CHECK_HANDLE(handle, return -1); CHECK_HANDLE(handle, return -1);
@ -196,7 +196,7 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data)
/** Interrupt a transaction. */ /** Interrupt a transaction. */
int SYMEXPORT alpm_trans_interrupt(alpm_handle_t *handle) int SYMEXPORT alpm_trans_interrupt(alpm_handle_t *handle)
{ {
pmtrans_t *trans; alpm_trans_t *trans;
/* Sanity checks */ /* Sanity checks */
CHECK_HANDLE(handle, return -1); CHECK_HANDLE(handle, return -1);
@ -214,7 +214,7 @@ int SYMEXPORT alpm_trans_interrupt(alpm_handle_t *handle)
/** Release a transaction. */ /** Release a transaction. */
int SYMEXPORT alpm_trans_release(alpm_handle_t *handle) int SYMEXPORT alpm_trans_release(alpm_handle_t *handle)
{ {
pmtrans_t *trans; alpm_trans_t *trans;
/* Sanity checks */ /* Sanity checks */
CHECK_HANDLE(handle, return -1); CHECK_HANDLE(handle, return -1);
@ -243,7 +243,7 @@ int SYMEXPORT alpm_trans_release(alpm_handle_t *handle)
/** @} */ /** @} */
void _alpm_trans_free(pmtrans_t *trans) void _alpm_trans_free(alpm_trans_t *trans)
{ {
if(trans == NULL) { if(trans == NULL) {
return; return;

View file

@ -36,7 +36,7 @@ typedef enum _pmtransstate_t {
} pmtransstate_t; } pmtransstate_t;
/* Transaction */ /* Transaction */
struct __pmtrans_t { struct __alpm_trans_t {
pmtransflag_t flags; pmtransflag_t flags;
pmtransstate_t state; pmtransstate_t state;
alpm_list_t *add; /* list of (alpm_pkg_t *) */ alpm_list_t *add; /* list of (alpm_pkg_t *) */
@ -66,8 +66,8 @@ do { \
} \ } \
} while(0) } while(0)
void _alpm_trans_free(pmtrans_t *trans); void _alpm_trans_free(alpm_trans_t *trans);
int _alpm_trans_init(pmtrans_t *trans, pmtransflag_t flags, int _alpm_trans_init(alpm_trans_t *trans, pmtransflag_t flags,
alpm_trans_cb_event event, alpm_trans_cb_conv conv, alpm_trans_cb_event event, alpm_trans_cb_conv conv,
alpm_trans_cb_progress progress); alpm_trans_cb_progress progress);
int _alpm_runscriptlet(alpm_handle_t *handle, const char *installfn, int _alpm_runscriptlet(alpm_handle_t *handle, const char *installfn,