From 438f653ba697f1e9c489954bcf96bbc710fdea54 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Tue, 15 Mar 2005 18:41:02 +0000 Subject: Renamed PM_TRANS_CB_XXX to PM_TRANS_EVT_XXX --- lib/libalpm/add.c | 16 ++++++++-------- lib/libalpm/alpm.h | 20 ++++++++++---------- lib/libalpm/remove.c | 8 ++++---- src/pacman/pacman.c | 20 ++++++++++---------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 6795216f..661708bf 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -131,7 +131,7 @@ int add_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data) if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) { PMList *j; - TRANS_CB(trans, PM_TRANS_CB_DEPS_START, NULL, NULL); + TRANS_CB(trans, PM_TRANS_EVT_DEPS_START, NULL, NULL); lp = checkdeps(db, trans->type, trans->packages); if(lp != NULL) { @@ -191,13 +191,13 @@ int add_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data) FREELIST(trans->packages); trans->packages = lp; - TRANS_CB(trans, PM_TRANS_CB_DEPS_DONE, NULL, NULL); + TRANS_CB(trans, PM_TRANS_EVT_DEPS_DONE, NULL, NULL); } /* Check for file conflicts */ if(!(trans->flags & PM_TRANS_FLAG_FORCE)) { - TRANS_CB(trans, PM_TRANS_CB_CONFLICTS_START, NULL, NULL); + TRANS_CB(trans, PM_TRANS_EVT_CONFLICTS_START, NULL, NULL); lp = db_find_conflicts(db, trans->packages, handle->root); if(lp != NULL) { @@ -205,7 +205,7 @@ int add_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data) PM_RET_ERR(PM_ERR_FILE_CONFLICTS, -1); } - TRANS_CB(trans, PM_TRANS_CB_CONFLICTS_DONE, NULL, NULL); + TRANS_CB(trans, PM_TRANS_EVT_CONFLICTS_DONE, NULL, NULL); } return(0); @@ -243,7 +243,7 @@ int add_commit(pmdb_t *db, pmtrans_t *trans) /* see if this is an upgrade. if so, remove the old package first */ if(pmo_upgrade) { if(pkg_isin(info, db_get_pkgcache(db))) { - TRANS_CB(trans, PM_TRANS_CB_UPGRADE_START, info, NULL); + TRANS_CB(trans, PM_TRANS_EVT_UPGRADE_START, info, NULL); /* we'll need the full record for backup checks later */ if((oldpkg = db_scan(db, info->name, INFRQ_ALL)) != NULL) { @@ -278,7 +278,7 @@ int add_commit(pmdb_t *db, pmtrans_t *trans) } } if(!pmo_upgrade) { - TRANS_CB(trans, PM_TRANS_CB_ADD_START, info, NULL); + TRANS_CB(trans, PM_TRANS_EVT_ADD_START, info, NULL); } /* Add the package to the database */ @@ -559,11 +559,11 @@ int add_commit(pmdb_t *db, pmtrans_t *trans) } if(pmo_upgrade && oldpkg) { - TRANS_CB(trans, PM_TRANS_CB_UPGRADE_DONE, info, NULL); + TRANS_CB(trans, PM_TRANS_EVT_UPGRADE_DONE, info, NULL); alpm_logaction("upgraded %s (%s -> %s)", info->name, oldpkg->version, info->version); } else { - TRANS_CB(trans, PM_TRANS_CB_ADD_DONE, info, NULL); + TRANS_CB(trans, PM_TRANS_EVT_ADD_DONE, info, NULL); alpm_logaction("installed %s (%s)", info->name, info->version); } diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 85442196..4551b3f9 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -195,16 +195,16 @@ enum { /* Callback events */ enum { - PM_TRANS_CB_DEPS_START = 1, - PM_TRANS_CB_DEPS_DONE, - PM_TRANS_CB_CONFLICTS_START, - PM_TRANS_CB_CONFLICTS_DONE, - PM_TRANS_CB_ADD_START, - PM_TRANS_CB_ADD_DONE, - PM_TRANS_CB_REMOVE_START, - PM_TRANS_CB_REMOVE_DONE, - PM_TRANS_CB_UPGRADE_START, - PM_TRANS_CB_UPGRADE_DONE + PM_TRANS_EVT_DEPS_START = 1, + PM_TRANS_EVT_DEPS_DONE, + PM_TRANS_EVT_CONFLICTS_START, + PM_TRANS_EVT_CONFLICTS_DONE, + PM_TRANS_EVT_ADD_START, + PM_TRANS_EVT_ADD_DONE, + PM_TRANS_EVT_REMOVE_START, + PM_TRANS_EVT_REMOVE_DONE, + PM_TRANS_EVT_UPGRADE_START, + PM_TRANS_EVT_UPGRADE_DONE }; /* Callback */ diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index c53ffa4d..4a943b3c 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -72,7 +72,7 @@ int remove_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data) ASSERT(data != NULL, PM_RET_ERR(PM_ERR_WRONG_ARGS, -1)); if(!(trans->flags & (PM_TRANS_FLAG_NODEPS)) && (trans->type != PM_TRANS_TYPE_UPGRADE)) { - TRANS_CB(trans, PM_TRANS_CB_DEPS_START, NULL, NULL); + TRANS_CB(trans, PM_TRANS_EVT_DEPS_START, NULL, NULL); if((lp = checkdeps(db, trans->type, trans->packages)) != NULL) { if(trans->flags & PM_TRANS_FLAG_CASCADE) { @@ -99,7 +99,7 @@ int remove_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data) trans->packages = removedeps(db, trans->packages); } - TRANS_CB(trans, PM_TRANS_CB_DEPS_DONE, NULL, NULL); + TRANS_CB(trans, PM_TRANS_EVT_DEPS_DONE, NULL, NULL); } return(0); @@ -120,7 +120,7 @@ int remove_commit(pmdb_t *db, pmtrans_t *trans) info = (pmpkg_t*)targ->data; if(trans->type != PM_TRANS_TYPE_UPGRADE) { - TRANS_CB(trans, PM_TRANS_CB_REMOVE_START, info, NULL); + TRANS_CB(trans, PM_TRANS_EVT_REMOVE_START, info, NULL); /* run the pre-remove scriptlet if it exists */ snprintf(pm_install, PATH_MAX, "%s%s/%s/%s-%s/install", handle->root, handle->dbpath, db->treename, info->name, info->version); @@ -241,7 +241,7 @@ int remove_commit(pmdb_t *db, pmtrans_t *trans) } if(trans->type != PM_TRANS_TYPE_UPGRADE) { - TRANS_CB(trans, PM_TRANS_CB_REMOVE_DONE, info, NULL); + TRANS_CB(trans, PM_TRANS_EVT_REMOVE_DONE, info, NULL); alpm_logaction("removed %s (%s)", info->name, info->version); } } diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 1ecc3ec6..ad5a0436 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -277,40 +277,40 @@ void cb_trans(unsigned short event, void *data1, void *data2) char str[256] = ""; switch(event) { - case PM_TRANS_CB_DEPS_START: + case PM_TRANS_EVT_DEPS_START: MSG(NL, "checking dependencies... "); break; - case PM_TRANS_CB_CONFLICTS_START: + case PM_TRANS_EVT_CONFLICTS_START: MSG(NL, "checking for file conflicts... "); break; - case PM_TRANS_CB_DEPS_DONE: - case PM_TRANS_CB_CONFLICTS_DONE: + case PM_TRANS_EVT_DEPS_DONE: + case PM_TRANS_EVT_CONFLICTS_DONE: MSG(CL, "done.\n"); break; - case PM_TRANS_CB_ADD_START: + case PM_TRANS_EVT_ADD_START: MSG(NL, "installing %s... ", (char *)alpm_pkg_getinfo(data1, PM_PKG_NAME)); break; - case PM_TRANS_CB_ADD_DONE: + case PM_TRANS_EVT_ADD_DONE: MSG(CL, "done.\n"); snprintf(str, 256, "installed %s (%s)", (char *)alpm_pkg_getinfo(data1, PM_PKG_NAME), (char *)alpm_pkg_getinfo(data1, PM_PKG_VERSION)); alpm_logaction(str); break; - case PM_TRANS_CB_REMOVE_START: + case PM_TRANS_EVT_REMOVE_START: MSG(NL, "removing %s... ", (char *)alpm_pkg_getinfo(data1, PM_PKG_NAME)); break; - case PM_TRANS_CB_REMOVE_DONE: + case PM_TRANS_EVT_REMOVE_DONE: MSG(CL, "done.\n"); snprintf(str, 256, "removed %s (%s)", (char *)alpm_pkg_getinfo(data1, PM_PKG_NAME), (char *)alpm_pkg_getinfo(data1, PM_PKG_VERSION)); alpm_logaction(str); break; - case PM_TRANS_CB_UPGRADE_START: + case PM_TRANS_EVT_UPGRADE_START: MSG(NL, "upgrading %s... ", (char *)alpm_pkg_getinfo(data1, PM_PKG_NAME)); break; - case PM_TRANS_CB_UPGRADE_DONE: + case PM_TRANS_EVT_UPGRADE_DONE: MSG(CL, "done.\n"); snprintf(str, 256, "upgraded %s (%s -> %s)", (char *)alpm_pkg_getinfo(data1, PM_PKG_NAME), -- cgit v1.2.3-70-g09d2