1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-21 23:38:49 -05:00

Renamed PM_TRANS_CB_XXX to PM_TRANS_EVT_XXX

This commit is contained in:
Aurelien Foret 2005-03-15 18:41:02 +00:00
parent 518c333ee1
commit 438f653ba6
4 changed files with 32 additions and 32 deletions

View File

@ -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);
}

View File

@ -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 */

View File

@ -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);
}
}

View File

@ -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),