Prefix alpm_transevt_t members with ALPM

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2011-07-02 02:01:39 +10:00
parent 39262acab6
commit 3189d3bc4a
6 changed files with 81 additions and 81 deletions

View File

@ -471,7 +471,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
/* we'll need to save some record for backup checks later */
oldpkg = _alpm_pkg_dup(local);
EVENT(trans, PM_TRANS_EVT_UPGRADE_START, newpkg, oldpkg);
EVENT(trans, ALPM_TRANS_EVT_UPGRADE_START, newpkg, oldpkg);
_alpm_log(handle, ALPM_LOG_DEBUG, "upgrading package %s-%s\n",
newpkg->name, newpkg->version);
@ -486,7 +486,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
} else {
is_upgrade = 0;
EVENT(trans, PM_TRANS_EVT_ADD_START, newpkg, NULL);
EVENT(trans, ALPM_TRANS_EVT_ADD_START, newpkg, NULL);
_alpm_log(handle, ALPM_LOG_DEBUG, "adding package %s-%s\n",
newpkg->name, newpkg->version);
@ -670,9 +670,9 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
}
if(is_upgrade) {
EVENT(trans, PM_TRANS_EVT_UPGRADE_DONE, newpkg, oldpkg);
EVENT(trans, ALPM_TRANS_EVT_UPGRADE_DONE, newpkg, oldpkg);
} else {
EVENT(trans, PM_TRANS_EVT_ADD_DONE, newpkg, oldpkg);
EVENT(trans, ALPM_TRANS_EVT_ADD_DONE, newpkg, oldpkg);
}
cleanup:

View File

@ -772,79 +772,79 @@ typedef enum _alpm_transflag_t {
*/
typedef enum _alpm_transevt_t {
/** Dependencies will be computed for a package. */
PM_TRANS_EVT_CHECKDEPS_START = 1,
ALPM_TRANS_EVT_CHECKDEPS_START = 1,
/** Dependencies were computed for a package. */
PM_TRANS_EVT_CHECKDEPS_DONE,
ALPM_TRANS_EVT_CHECKDEPS_DONE,
/** File conflicts will be computed for a package. */
PM_TRANS_EVT_FILECONFLICTS_START,
ALPM_TRANS_EVT_FILECONFLICTS_START,
/** File conflicts were computed for a package. */
PM_TRANS_EVT_FILECONFLICTS_DONE,
ALPM_TRANS_EVT_FILECONFLICTS_DONE,
/** Dependencies will be resolved for target package. */
PM_TRANS_EVT_RESOLVEDEPS_START,
ALPM_TRANS_EVT_RESOLVEDEPS_START,
/** Dependencies were resolved for target package. */
PM_TRANS_EVT_RESOLVEDEPS_DONE,
ALPM_TRANS_EVT_RESOLVEDEPS_DONE,
/** Inter-conflicts will be checked for target package. */
PM_TRANS_EVT_INTERCONFLICTS_START,
ALPM_TRANS_EVT_INTERCONFLICTS_START,
/** Inter-conflicts were checked for target package. */
PM_TRANS_EVT_INTERCONFLICTS_DONE,
ALPM_TRANS_EVT_INTERCONFLICTS_DONE,
/** Package will be installed.
* A pointer to the target package is passed to the callback.
*/
PM_TRANS_EVT_ADD_START,
ALPM_TRANS_EVT_ADD_START,
/** Package was installed.
* A pointer to the new package is passed to the callback.
*/
PM_TRANS_EVT_ADD_DONE,
ALPM_TRANS_EVT_ADD_DONE,
/** Package will be removed.
* A pointer to the target package is passed to the callback.
*/
PM_TRANS_EVT_REMOVE_START,
ALPM_TRANS_EVT_REMOVE_START,
/** Package was removed.
* A pointer to the removed package is passed to the callback.
*/
PM_TRANS_EVT_REMOVE_DONE,
ALPM_TRANS_EVT_REMOVE_DONE,
/** Package will be upgraded.
* A pointer to the upgraded package is passed to the callback.
*/
PM_TRANS_EVT_UPGRADE_START,
ALPM_TRANS_EVT_UPGRADE_START,
/** Package was upgraded.
* A pointer to the new package, and a pointer to the old package is passed
* to the callback, respectively.
*/
PM_TRANS_EVT_UPGRADE_DONE,
ALPM_TRANS_EVT_UPGRADE_DONE,
/** Target package's integrity will be checked. */
PM_TRANS_EVT_INTEGRITY_START,
ALPM_TRANS_EVT_INTEGRITY_START,
/** Target package's integrity was checked. */
PM_TRANS_EVT_INTEGRITY_DONE,
ALPM_TRANS_EVT_INTEGRITY_DONE,
/** Target deltas's integrity will be checked. */
PM_TRANS_EVT_DELTA_INTEGRITY_START,
ALPM_TRANS_EVT_DELTA_INTEGRITY_START,
/** Target delta's integrity was checked. */
PM_TRANS_EVT_DELTA_INTEGRITY_DONE,
ALPM_TRANS_EVT_DELTA_INTEGRITY_DONE,
/** Deltas will be applied to packages. */
PM_TRANS_EVT_DELTA_PATCHES_START,
ALPM_TRANS_EVT_DELTA_PATCHES_START,
/** Deltas were applied to packages. */
PM_TRANS_EVT_DELTA_PATCHES_DONE,
ALPM_TRANS_EVT_DELTA_PATCHES_DONE,
/** Delta patch will be applied to target package.
* The filename of the package and the filename of the patch is passed to the
* callback.
*/
PM_TRANS_EVT_DELTA_PATCH_START,
ALPM_TRANS_EVT_DELTA_PATCH_START,
/** Delta patch was applied to target package. */
PM_TRANS_EVT_DELTA_PATCH_DONE,
ALPM_TRANS_EVT_DELTA_PATCH_DONE,
/** Delta patch failed to apply to target package. */
PM_TRANS_EVT_DELTA_PATCH_FAILED,
ALPM_TRANS_EVT_DELTA_PATCH_FAILED,
/** Scriptlet has printed information.
* A line of text is passed to the callback.
*/
PM_TRANS_EVT_SCRIPTLET_INFO,
ALPM_TRANS_EVT_SCRIPTLET_INFO,
/** Files will be downloaded from a repository.
* The repository's tree name is passed to the callback.
*/
PM_TRANS_EVT_RETRIEVE_START,
ALPM_TRANS_EVT_RETRIEVE_START,
/** Disk space usage will be computed for a package */
PM_TRANS_EVT_DISKSPACE_START,
ALPM_TRANS_EVT_DISKSPACE_START,
/** Disk space usage was computed for a package */
PM_TRANS_EVT_DISKSPACE_DONE,
ALPM_TRANS_EVT_DISKSPACE_DONE,
} alpm_transevt_t;
/** Transaction Conversations (ie, questions) */

View File

@ -147,7 +147,7 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data)
}
if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) {
EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_CHECKDEPS_START, NULL, NULL);
_alpm_log(handle, ALPM_LOG_DEBUG, "looking for unsatisfied dependencies\n");
lp = alpm_checkdeps(handle, _alpm_db_get_pkgcache(db), trans->remove, NULL, 1);
@ -185,7 +185,7 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data)
}
if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) {
EVENT(trans, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL);
}
return 0;
@ -378,7 +378,7 @@ int _alpm_remove_packages(alpm_handle_t *handle)
snprintf(scriptlet, PATH_MAX, "%s%s-%s/install",
_alpm_db_path(handle->db_local), pkgname, alpm_pkg_get_version(info));
EVENT(trans, PM_TRANS_EVT_REMOVE_START, info, NULL);
EVENT(trans, ALPM_TRANS_EVT_REMOVE_START, info, NULL);
_alpm_log(handle, ALPM_LOG_DEBUG, "removing package %s-%s\n",
pkgname, alpm_pkg_get_version(info));
@ -446,7 +446,7 @@ int _alpm_remove_packages(alpm_handle_t *handle)
pkgname);
}
EVENT(trans, PM_TRANS_EVT_REMOVE_DONE, info, NULL);
EVENT(trans, ALPM_TRANS_EVT_REMOVE_DONE, info, NULL);
}
/* run ldconfig if it exists */

View File

@ -320,7 +320,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
/* Build up list by repeatedly resolving each transaction package */
/* Resolve targets dependencies */
EVENT(trans, PM_TRANS_EVT_RESOLVEDEPS_START, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_RESOLVEDEPS_START, NULL, NULL);
_alpm_log(handle, ALPM_LOG_DEBUG, "resolving target's dependencies\n");
/* build remove list for resolvedeps */
@ -391,12 +391,12 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
trans->add = _alpm_sortbydeps(handle, resolved, 0);
alpm_list_free(resolved);
EVENT(trans, PM_TRANS_EVT_RESOLVEDEPS_DONE, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_RESOLVEDEPS_DONE, NULL, NULL);
}
if(!(trans->flags & ALPM_TRANS_FLAG_NOCONFLICTS)) {
/* check for inter-conflicts and whatnot */
EVENT(trans, PM_TRANS_EVT_INTERCONFLICTS_START, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_INTERCONFLICTS_START, NULL, NULL);
_alpm_log(handle, ALPM_LOG_DEBUG, "looking for conflicts\n");
@ -506,7 +506,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
goto cleanup;
}
}
EVENT(trans, PM_TRANS_EVT_INTERCONFLICTS_DONE, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_INTERCONFLICTS_DONE, NULL, NULL);
alpm_list_free_inner(deps, (alpm_list_fn_free)_alpm_conflict_free);
alpm_list_free(deps);
}
@ -629,11 +629,11 @@ static int apply_deltas(alpm_handle_t *handle)
_alpm_log(handle, ALPM_LOG_DEBUG, "command: %s\n", command);
EVENT(trans, PM_TRANS_EVT_DELTA_PATCH_START, d->to, d->delta);
EVENT(trans, ALPM_TRANS_EVT_DELTA_PATCH_START, d->to, d->delta);
int retval = system(command);
if(retval == 0) {
EVENT(trans, PM_TRANS_EVT_DELTA_PATCH_DONE, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_DELTA_PATCH_DONE, NULL, NULL);
/* delete the delta file */
unlink(delta);
@ -651,7 +651,7 @@ static int apply_deltas(alpm_handle_t *handle)
if(retval != 0) {
/* one delta failed for this package, cancel the remaining ones */
EVENT(trans, PM_TRANS_EVT_DELTA_PATCH_FAILED, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_DELTA_PATCH_FAILED, NULL, NULL);
handle->pm_errno = PM_ERR_DLT_PATCHFAILED;
ret = 1;
break;
@ -701,7 +701,7 @@ static int validate_deltas(alpm_handle_t *handle, alpm_list_t *deltas,
}
/* Check integrity of deltas */
EVENT(trans, PM_TRANS_EVT_DELTA_INTEGRITY_START, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_DELTA_INTEGRITY_START, NULL, NULL);
for(i = deltas; i; i = i->next) {
alpm_delta_t *d = alpm_list_getdata(i);
@ -717,12 +717,12 @@ static int validate_deltas(alpm_handle_t *handle, alpm_list_t *deltas,
handle->pm_errno = PM_ERR_DLT_INVALID;
return -1;
}
EVENT(trans, PM_TRANS_EVT_DELTA_INTEGRITY_DONE, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_DELTA_INTEGRITY_DONE, NULL, NULL);
/* Use the deltas to generate the packages */
EVENT(trans, PM_TRANS_EVT_DELTA_PATCHES_START, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_DELTA_PATCHES_START, NULL, NULL);
ret = apply_deltas(handle);
EVENT(trans, PM_TRANS_EVT_DELTA_PATCHES_DONE, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_DELTA_PATCHES_DONE, NULL, NULL);
return ret;
}
@ -782,7 +782,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas)
}
if(files) {
EVENT(handle->trans, PM_TRANS_EVT_RETRIEVE_START, current->treename, NULL);
EVENT(handle->trans, ALPM_TRANS_EVT_RETRIEVE_START, current->treename, NULL);
for(j = files; j; j = j->next) {
const char *filename = j->data;
alpm_list_t *server;
@ -854,7 +854,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data)
/* Check integrity of packages */
numtargs = alpm_list_count(trans->add);
EVENT(trans, PM_TRANS_EVT_INTEGRITY_START, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_INTEGRITY_START, NULL, NULL);
errors = 0;
@ -897,7 +897,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data)
PROGRESS(trans, PM_TRANS_PROGRESS_INTEGRITY_START, "", 100,
numtargs, current);
EVENT(trans, PM_TRANS_EVT_INTEGRITY_DONE, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_INTEGRITY_DONE, NULL, NULL);
if(errors) {
@ -914,7 +914,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data)
/* fileconflict check */
if(!(trans->flags & ALPM_TRANS_FLAG_FORCE)) {
EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_START, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_FILECONFLICTS_START, NULL, NULL);
_alpm_log(handle, ALPM_LOG_DEBUG, "looking for file conflicts\n");
alpm_list_t *conflict = _alpm_db_find_fileconflicts(handle,
@ -929,12 +929,12 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data)
RET_ERR(handle, PM_ERR_FILE_CONFLICTS, -1);
}
EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_DONE, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_FILECONFLICTS_DONE, NULL, NULL);
}
/* check available disk space */
if(handle->checkspace) {
EVENT(trans, PM_TRANS_EVT_DISKSPACE_START, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_DISKSPACE_START, NULL, NULL);
_alpm_log(handle, ALPM_LOG_DEBUG, "checking available disk space\n");
if(_alpm_check_diskspace(handle) == -1) {
@ -942,7 +942,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data)
return -1;
}
EVENT(trans, PM_TRANS_EVT_DISKSPACE_DONE, NULL, NULL);
EVENT(trans, ALPM_TRANS_EVT_DISKSPACE_DONE, NULL, NULL);
}
/* remove conflicting and to-be-replaced packages */

View File

@ -500,7 +500,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *path, char *const argv[]
if(fgets(line, PATH_MAX, pipe_file) == NULL)
break;
alpm_logaction(handle, "%s", line);
EVENT(handle->trans, PM_TRANS_EVT_SCRIPTLET_INFO, line, NULL);
EVENT(handle->trans, ALPM_TRANS_EVT_SCRIPTLET_INFO, line, NULL);
}
fclose(pipe_file);
}

View File

@ -156,93 +156,93 @@ static void fill_progress(const int bar_percent, const int disp_percent,
void cb_trans_evt(alpm_transevt_t event, void *data1, void *data2)
{
switch(event) {
case PM_TRANS_EVT_CHECKDEPS_START:
case ALPM_TRANS_EVT_CHECKDEPS_START:
printf(_("checking dependencies...\n"));
break;
case PM_TRANS_EVT_FILECONFLICTS_START:
case ALPM_TRANS_EVT_FILECONFLICTS_START:
if(config->noprogressbar) {
printf(_("checking for file conflicts...\n"));
}
break;
case PM_TRANS_EVT_RESOLVEDEPS_START:
case ALPM_TRANS_EVT_RESOLVEDEPS_START:
printf(_("resolving dependencies...\n"));
break;
case PM_TRANS_EVT_INTERCONFLICTS_START:
case ALPM_TRANS_EVT_INTERCONFLICTS_START:
printf(_("looking for inter-conflicts...\n"));
break;
case PM_TRANS_EVT_ADD_START:
case ALPM_TRANS_EVT_ADD_START:
if(config->noprogressbar) {
printf(_("installing %s...\n"), alpm_pkg_get_name(data1));
}
break;
case PM_TRANS_EVT_ADD_DONE:
case ALPM_TRANS_EVT_ADD_DONE:
alpm_logaction(config->handle, "installed %s (%s)\n",
alpm_pkg_get_name(data1),
alpm_pkg_get_version(data1));
display_optdepends(data1);
break;
case PM_TRANS_EVT_REMOVE_START:
case ALPM_TRANS_EVT_REMOVE_START:
if(config->noprogressbar) {
printf(_("removing %s...\n"), alpm_pkg_get_name(data1));
}
break;
case PM_TRANS_EVT_REMOVE_DONE:
case ALPM_TRANS_EVT_REMOVE_DONE:
alpm_logaction(config->handle, "removed %s (%s)\n",
alpm_pkg_get_name(data1),
alpm_pkg_get_version(data1));
break;
case PM_TRANS_EVT_UPGRADE_START:
case ALPM_TRANS_EVT_UPGRADE_START:
if(config->noprogressbar) {
printf(_("upgrading %s...\n"), alpm_pkg_get_name(data1));
}
break;
case PM_TRANS_EVT_UPGRADE_DONE:
case ALPM_TRANS_EVT_UPGRADE_DONE:
alpm_logaction(config->handle, "upgraded %s (%s -> %s)\n",
(char *)alpm_pkg_get_name(data1),
(char *)alpm_pkg_get_version(data2),
(char *)alpm_pkg_get_version(data1));
display_new_optdepends(data2,data1);
break;
case PM_TRANS_EVT_INTEGRITY_START:
case ALPM_TRANS_EVT_INTEGRITY_START:
if(config->noprogressbar) {
printf(_("checking package integrity...\n"));
}
break;
case PM_TRANS_EVT_DELTA_INTEGRITY_START:
case ALPM_TRANS_EVT_DELTA_INTEGRITY_START:
printf(_("checking delta integrity...\n"));
break;
case PM_TRANS_EVT_DELTA_PATCHES_START:
case ALPM_TRANS_EVT_DELTA_PATCHES_START:
printf(_("applying deltas...\n"));
break;
case PM_TRANS_EVT_DELTA_PATCH_START:
case ALPM_TRANS_EVT_DELTA_PATCH_START:
printf(_("generating %s with %s... "), (char *)data1, (char *)data2);
break;
case PM_TRANS_EVT_DELTA_PATCH_DONE:
case ALPM_TRANS_EVT_DELTA_PATCH_DONE:
printf(_("success!\n"));
break;
case PM_TRANS_EVT_DELTA_PATCH_FAILED:
case ALPM_TRANS_EVT_DELTA_PATCH_FAILED:
printf(_("failed.\n"));
break;
case PM_TRANS_EVT_SCRIPTLET_INFO:
case ALPM_TRANS_EVT_SCRIPTLET_INFO:
printf("%s", (char *)data1);
break;
case PM_TRANS_EVT_RETRIEVE_START:
case ALPM_TRANS_EVT_RETRIEVE_START:
printf(_(":: Retrieving packages from %s...\n"), (char *)data1);
break;
case PM_TRANS_EVT_DISKSPACE_START:
case ALPM_TRANS_EVT_DISKSPACE_START:
if(config->noprogressbar) {
printf(_("checking available disk space...\n"));
}
break;
/* all the simple done events, with fallthrough for each */
case PM_TRANS_EVT_FILECONFLICTS_DONE:
case PM_TRANS_EVT_CHECKDEPS_DONE:
case PM_TRANS_EVT_RESOLVEDEPS_DONE:
case PM_TRANS_EVT_INTERCONFLICTS_DONE:
case PM_TRANS_EVT_INTEGRITY_DONE:
case PM_TRANS_EVT_DELTA_INTEGRITY_DONE:
case PM_TRANS_EVT_DELTA_PATCHES_DONE:
case PM_TRANS_EVT_DISKSPACE_DONE:
case ALPM_TRANS_EVT_FILECONFLICTS_DONE:
case ALPM_TRANS_EVT_CHECKDEPS_DONE:
case ALPM_TRANS_EVT_RESOLVEDEPS_DONE:
case ALPM_TRANS_EVT_INTERCONFLICTS_DONE:
case ALPM_TRANS_EVT_INTEGRITY_DONE:
case ALPM_TRANS_EVT_DELTA_INTEGRITY_DONE:
case ALPM_TRANS_EVT_DELTA_PATCHES_DONE:
case ALPM_TRANS_EVT_DISKSPACE_DONE:
/* nothing */
break;
}