Renamed PM_TRANS_CB_XXX to PM_TRANS_EVT_XXX
This commit is contained in:
parent
518c333ee1
commit
438f653ba6
4 changed files with 32 additions and 32 deletions
|
@ -131,7 +131,7 @@ int add_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data)
|
||||||
if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) {
|
if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) {
|
||||||
PMList *j;
|
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);
|
lp = checkdeps(db, trans->type, trans->packages);
|
||||||
if(lp != NULL) {
|
if(lp != NULL) {
|
||||||
|
@ -191,13 +191,13 @@ int add_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data)
|
||||||
FREELIST(trans->packages);
|
FREELIST(trans->packages);
|
||||||
trans->packages = lp;
|
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
|
/* Check for file conflicts
|
||||||
*/
|
*/
|
||||||
if(!(trans->flags & PM_TRANS_FLAG_FORCE)) {
|
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);
|
lp = db_find_conflicts(db, trans->packages, handle->root);
|
||||||
if(lp != NULL) {
|
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);
|
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);
|
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 */
|
/* see if this is an upgrade. if so, remove the old package first */
|
||||||
if(pmo_upgrade) {
|
if(pmo_upgrade) {
|
||||||
if(pkg_isin(info, db_get_pkgcache(db))) {
|
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 */
|
/* we'll need the full record for backup checks later */
|
||||||
if((oldpkg = db_scan(db, info->name, INFRQ_ALL)) != NULL) {
|
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) {
|
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 */
|
/* Add the package to the database */
|
||||||
|
@ -559,11 +559,11 @@ int add_commit(pmdb_t *db, pmtrans_t *trans)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pmo_upgrade && oldpkg) {
|
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,
|
alpm_logaction("upgraded %s (%s -> %s)", info->name,
|
||||||
oldpkg->version, info->version);
|
oldpkg->version, info->version);
|
||||||
} else {
|
} 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);
|
alpm_logaction("installed %s (%s)", info->name, info->version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -195,16 +195,16 @@ enum {
|
||||||
|
|
||||||
/* Callback events */
|
/* Callback events */
|
||||||
enum {
|
enum {
|
||||||
PM_TRANS_CB_DEPS_START = 1,
|
PM_TRANS_EVT_DEPS_START = 1,
|
||||||
PM_TRANS_CB_DEPS_DONE,
|
PM_TRANS_EVT_DEPS_DONE,
|
||||||
PM_TRANS_CB_CONFLICTS_START,
|
PM_TRANS_EVT_CONFLICTS_START,
|
||||||
PM_TRANS_CB_CONFLICTS_DONE,
|
PM_TRANS_EVT_CONFLICTS_DONE,
|
||||||
PM_TRANS_CB_ADD_START,
|
PM_TRANS_EVT_ADD_START,
|
||||||
PM_TRANS_CB_ADD_DONE,
|
PM_TRANS_EVT_ADD_DONE,
|
||||||
PM_TRANS_CB_REMOVE_START,
|
PM_TRANS_EVT_REMOVE_START,
|
||||||
PM_TRANS_CB_REMOVE_DONE,
|
PM_TRANS_EVT_REMOVE_DONE,
|
||||||
PM_TRANS_CB_UPGRADE_START,
|
PM_TRANS_EVT_UPGRADE_START,
|
||||||
PM_TRANS_CB_UPGRADE_DONE
|
PM_TRANS_EVT_UPGRADE_DONE
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Callback */
|
/* Callback */
|
||||||
|
|
|
@ -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));
|
ASSERT(data != NULL, PM_RET_ERR(PM_ERR_WRONG_ARGS, -1));
|
||||||
|
|
||||||
if(!(trans->flags & (PM_TRANS_FLAG_NODEPS)) && (trans->type != PM_TRANS_TYPE_UPGRADE)) {
|
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((lp = checkdeps(db, trans->type, trans->packages)) != NULL) {
|
||||||
if(trans->flags & PM_TRANS_FLAG_CASCADE) {
|
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->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);
|
return(0);
|
||||||
|
@ -120,7 +120,7 @@ int remove_commit(pmdb_t *db, pmtrans_t *trans)
|
||||||
info = (pmpkg_t*)targ->data;
|
info = (pmpkg_t*)targ->data;
|
||||||
|
|
||||||
if(trans->type != PM_TRANS_TYPE_UPGRADE) {
|
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 */
|
/* 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);
|
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) {
|
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);
|
alpm_logaction("removed %s (%s)", info->name, info->version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -277,40 +277,40 @@ void cb_trans(unsigned short event, void *data1, void *data2)
|
||||||
char str[256] = "";
|
char str[256] = "";
|
||||||
|
|
||||||
switch(event) {
|
switch(event) {
|
||||||
case PM_TRANS_CB_DEPS_START:
|
case PM_TRANS_EVT_DEPS_START:
|
||||||
MSG(NL, "checking dependencies... ");
|
MSG(NL, "checking dependencies... ");
|
||||||
break;
|
break;
|
||||||
case PM_TRANS_CB_CONFLICTS_START:
|
case PM_TRANS_EVT_CONFLICTS_START:
|
||||||
MSG(NL, "checking for file conflicts... ");
|
MSG(NL, "checking for file conflicts... ");
|
||||||
break;
|
break;
|
||||||
case PM_TRANS_CB_DEPS_DONE:
|
case PM_TRANS_EVT_DEPS_DONE:
|
||||||
case PM_TRANS_CB_CONFLICTS_DONE:
|
case PM_TRANS_EVT_CONFLICTS_DONE:
|
||||||
MSG(CL, "done.\n");
|
MSG(CL, "done.\n");
|
||||||
break;
|
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));
|
MSG(NL, "installing %s... ", (char *)alpm_pkg_getinfo(data1, PM_PKG_NAME));
|
||||||
break;
|
break;
|
||||||
case PM_TRANS_CB_ADD_DONE:
|
case PM_TRANS_EVT_ADD_DONE:
|
||||||
MSG(CL, "done.\n");
|
MSG(CL, "done.\n");
|
||||||
snprintf(str, 256, "installed %s (%s)",
|
snprintf(str, 256, "installed %s (%s)",
|
||||||
(char *)alpm_pkg_getinfo(data1, PM_PKG_NAME),
|
(char *)alpm_pkg_getinfo(data1, PM_PKG_NAME),
|
||||||
(char *)alpm_pkg_getinfo(data1, PM_PKG_VERSION));
|
(char *)alpm_pkg_getinfo(data1, PM_PKG_VERSION));
|
||||||
alpm_logaction(str);
|
alpm_logaction(str);
|
||||||
break;
|
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));
|
MSG(NL, "removing %s... ", (char *)alpm_pkg_getinfo(data1, PM_PKG_NAME));
|
||||||
break;
|
break;
|
||||||
case PM_TRANS_CB_REMOVE_DONE:
|
case PM_TRANS_EVT_REMOVE_DONE:
|
||||||
MSG(CL, "done.\n");
|
MSG(CL, "done.\n");
|
||||||
snprintf(str, 256, "removed %s (%s)",
|
snprintf(str, 256, "removed %s (%s)",
|
||||||
(char *)alpm_pkg_getinfo(data1, PM_PKG_NAME),
|
(char *)alpm_pkg_getinfo(data1, PM_PKG_NAME),
|
||||||
(char *)alpm_pkg_getinfo(data1, PM_PKG_VERSION));
|
(char *)alpm_pkg_getinfo(data1, PM_PKG_VERSION));
|
||||||
alpm_logaction(str);
|
alpm_logaction(str);
|
||||||
break;
|
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));
|
MSG(NL, "upgrading %s... ", (char *)alpm_pkg_getinfo(data1, PM_PKG_NAME));
|
||||||
break;
|
break;
|
||||||
case PM_TRANS_CB_UPGRADE_DONE:
|
case PM_TRANS_EVT_UPGRADE_DONE:
|
||||||
MSG(CL, "done.\n");
|
MSG(CL, "done.\n");
|
||||||
snprintf(str, 256, "upgraded %s (%s -> %s)",
|
snprintf(str, 256, "upgraded %s (%s -> %s)",
|
||||||
(char *)alpm_pkg_getinfo(data1, PM_PKG_NAME),
|
(char *)alpm_pkg_getinfo(data1, PM_PKG_NAME),
|
||||||
|
|
Loading…
Add table
Reference in a new issue