From eb39a9482b711d58a6c12840800f2372dee0c120 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 2 Jul 2011 02:01:38 +1000 Subject: Prefix alpm_pkgreason_t members with ALPM Signed-off-by: Allan McRae --- lib/libalpm/sync.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/sync.c') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 8f038400..5114309d 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -182,8 +182,8 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) lpkg->name, tpkg->name); tpkg->removes = alpm_list_add(tpkg->removes, lpkg); /* check the to-be-replaced package's reason field */ - if(alpm_pkg_get_reason(lpkg) == PM_PKG_REASON_EXPLICIT) { - tpkg->reason = PM_PKG_REASON_EXPLICIT; + if(alpm_pkg_get_reason(lpkg) == ALPM_PKG_REASON_EXPLICIT) { + tpkg->reason = ALPM_PKG_REASON_EXPLICIT; } } else { /* add spkg to the target list */ @@ -378,7 +378,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) for(i = resolved; i; i = i->next) { alpm_pkg_t *pkg = i->data; if(!_alpm_pkg_find(trans->add, pkg->name)) { - pkg->reason = PM_PKG_REASON_DEPEND; + pkg->reason = ALPM_PKG_REASON_DEPEND; } } -- cgit v1.2.3 From ca43fdd92f06a6997c53e45bfed6fb27f3044de5 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 2 Jul 2011 02:01:38 +1000 Subject: Prefix alpm_loglevel_t members with ALPM Signed-off-by: Allan McRae --- lib/libalpm/sync.c | 78 +++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'lib/libalpm/sync.c') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 5114309d..c82665fc 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -66,14 +66,14 @@ alpm_pkg_t SYMEXPORT *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_syn } if(spkg == NULL) { - _alpm_log(pkg->handle, PM_LOG_DEBUG, "'%s' not found in sync db => no upgrade\n", + _alpm_log(pkg->handle, ALPM_LOG_DEBUG, "'%s' not found in sync db => no upgrade\n", alpm_pkg_get_name(pkg)); return NULL; } /* compare versions and see if spkg is an upgrade */ if(_alpm_pkg_compare_versions(spkg, pkg) > 0) { - _alpm_log(pkg->handle, PM_LOG_DEBUG, "new version of '%s' found (%s => %s)\n", + _alpm_log(pkg->handle, ALPM_LOG_DEBUG, "new version of '%s' found (%s => %s)\n", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg), alpm_pkg_get_version(spkg)); return spkg; @@ -97,12 +97,12 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) ASSERT(trans != NULL, RET_ERR(handle, PM_ERR_TRANS_NULL, -1)); ASSERT(trans->state == STATE_INITIALIZED, RET_ERR(handle, PM_ERR_TRANS_NOT_INITIALIZED, -1)); - _alpm_log(handle, PM_LOG_DEBUG, "checking for package upgrades\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "checking for package upgrades\n"); for(i = _alpm_db_get_pkgcache(db_local); i; i = i->next) { alpm_pkg_t *lpkg = i->data; if(_alpm_pkg_find(trans->add, lpkg->name)) { - _alpm_log(handle, PM_LOG_DEBUG, "%s is already in the target list -- skipping\n", lpkg->name); + _alpm_log(handle, ALPM_LOG_DEBUG, "%s is already in the target list -- skipping\n", lpkg->name); continue; } @@ -116,15 +116,15 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) /* 1. literal was found in sdb */ int cmp = _alpm_pkg_compare_versions(spkg, lpkg); if(cmp > 0) { - _alpm_log(handle, PM_LOG_DEBUG, "new version of '%s' found (%s => %s)\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "new version of '%s' found (%s => %s)\n", lpkg->name, lpkg->version, spkg->version); /* check IgnorePkg/IgnoreGroup */ if(_alpm_pkg_should_ignore(handle, spkg) || _alpm_pkg_should_ignore(handle, lpkg)) { - _alpm_log(handle, PM_LOG_WARNING, _("%s: ignoring package upgrade (%s => %s)\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("%s: ignoring package upgrade (%s => %s)\n"), lpkg->name, lpkg->version, spkg->version); } else { - _alpm_log(handle, PM_LOG_DEBUG, "adding package %s-%s to the transaction targets\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "adding package %s-%s to the transaction targets\n", spkg->name, spkg->version); trans->add = alpm_list_add(trans->add, spkg); } @@ -133,15 +133,15 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) /* check IgnorePkg/IgnoreGroup */ if(_alpm_pkg_should_ignore(handle, spkg) || _alpm_pkg_should_ignore(handle, lpkg)) { - _alpm_log(handle, PM_LOG_WARNING, _("%s: ignoring package downgrade (%s => %s)\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("%s: ignoring package downgrade (%s => %s)\n"), lpkg->name, lpkg->version, spkg->version); } else { - _alpm_log(handle, PM_LOG_WARNING, _("%s: downgrading from version %s to version %s\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("%s: downgrading from version %s to version %s\n"), lpkg->name, lpkg->version, spkg->version); trans->add = alpm_list_add(trans->add, spkg); } } else { - _alpm_log(handle, PM_LOG_WARNING, _("%s: local (%s) is newer than %s (%s)\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("%s: local (%s) is newer than %s (%s)\n"), lpkg->name, lpkg->version, sdb->treename, spkg->version); } } @@ -157,7 +157,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) /* check IgnorePkg/IgnoreGroup */ if(_alpm_pkg_should_ignore(handle, spkg) || _alpm_pkg_should_ignore(handle, lpkg)) { - _alpm_log(handle, PM_LOG_WARNING, _("ignoring package replacement (%s-%s => %s-%s)\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("ignoring package replacement (%s-%s => %s-%s)\n"), lpkg->name, lpkg->version, spkg->name, spkg->version); continue; } @@ -174,11 +174,11 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) if(tpkg) { /* sanity check, multiple repos can contain spkg->name */ if(tpkg->origin_data.db != sdb) { - _alpm_log(handle, PM_LOG_WARNING, _("cannot replace %s by %s\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("cannot replace %s by %s\n"), lpkg->name, spkg->name); continue; } - _alpm_log(handle, PM_LOG_DEBUG, "appending %s to the removes list of %s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "appending %s to the removes list of %s\n", lpkg->name, tpkg->name); tpkg->removes = alpm_list_add(tpkg->removes, lpkg); /* check the to-be-replaced package's reason field */ @@ -190,7 +190,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) /* copy over reason */ spkg->reason = alpm_pkg_get_reason(lpkg); spkg->removes = alpm_list_add(NULL, lpkg); - _alpm_log(handle, PM_LOG_DEBUG, "adding package %s-%s to the transaction targets\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "adding package %s-%s to the transaction targets\n", spkg->name, spkg->version); trans->add = alpm_list_add(trans->add, spkg); } @@ -282,10 +282,10 @@ static int compute_download_size(alpm_pkg_t *newpkg) &newpkg->delta_path); if(newpkg->delta_path && (dltsize < pkgsize * MAX_DELTA_RATIO)) { - _alpm_log(handle, PM_LOG_DEBUG, "using delta size\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "using delta size\n"); size = dltsize; } else { - _alpm_log(handle, PM_LOG_DEBUG, "using package size\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "using package size\n"); size = alpm_pkg_get_size(newpkg); alpm_list_free(newpkg->delta_path); newpkg->delta_path = NULL; @@ -294,7 +294,7 @@ static int compute_download_size(alpm_pkg_t *newpkg) size = alpm_pkg_get_size(newpkg); } - _alpm_log(handle, PM_LOG_DEBUG, "setting download size %jd for pkg %s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "setting download size %jd for pkg %s\n", (intmax_t)size, alpm_pkg_get_name(newpkg)); newpkg->infolevel |= INFRQ_DSIZE; @@ -321,7 +321,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); - _alpm_log(handle, PM_LOG_DEBUG, "resolving target's dependencies\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "resolving target's dependencies\n"); /* build remove list for resolvedeps */ for(i = trans->add; i; i = i->next) { @@ -398,10 +398,10 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) /* check for inter-conflicts and whatnot */ EVENT(trans, PM_TRANS_EVT_INTERCONFLICTS_START, NULL, NULL); - _alpm_log(handle, PM_LOG_DEBUG, "looking for conflicts\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "looking for conflicts\n"); /* 1. check for conflicts in the target list */ - _alpm_log(handle, PM_LOG_DEBUG, "check targets vs targets\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "check targets vs targets\n"); deps = _alpm_innerconflicts(handle, trans->add); for(i = deps; i; i = i->next) { @@ -415,7 +415,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) continue; } - _alpm_log(handle, PM_LOG_DEBUG, "conflicting packages in the sync list: '%s' <-> '%s'\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "conflicting packages in the sync list: '%s' <-> '%s'\n", conflict->package1, conflict->package2); /* if sync1 provides sync2, we remove sync2 from the targets, and vice versa */ @@ -428,7 +428,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) rsync = sync1; sync = sync2; } else { - _alpm_log(handle, PM_LOG_ERROR, _("unresolvable package conflicts detected\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("unresolvable package conflicts detected\n")); handle->pm_errno = PM_ERR_CONFLICTING_DEPS; ret = -1; if(data) { @@ -447,7 +447,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) _alpm_dep_free(dep2); /* Prints warning */ - _alpm_log(handle, PM_LOG_WARNING, + _alpm_log(handle, ALPM_LOG_WARNING, _("removing '%s' from target list because it conflicts with '%s'\n"), rsync->name, sync->name); trans->add = alpm_list_remove(trans->add, rsync, _alpm_pkg_cmp, NULL); @@ -460,7 +460,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) deps = NULL; /* 2. we check for target vs db conflicts (and resolve)*/ - _alpm_log(handle, PM_LOG_DEBUG, "check targets vs db and db vs targets\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "check targets vs db and db vs targets\n"); deps = _alpm_outerconflicts(handle->db_local, trans->add); for(i = deps; i; i = i->next) { @@ -479,7 +479,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) continue; } - _alpm_log(handle, PM_LOG_DEBUG, "package '%s' conflicts with '%s'\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "package '%s' conflicts with '%s'\n", conflict->package1, conflict->package2); alpm_pkg_t *sync = _alpm_pkg_find(trans->add, conflict->package1); @@ -489,10 +489,10 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) conflict->package2, conflict->reason, &doremove); if(doremove) { /* append to the removes list */ - _alpm_log(handle, PM_LOG_DEBUG, "electing '%s' for removal\n", conflict->package2); + _alpm_log(handle, ALPM_LOG_DEBUG, "electing '%s' for removal\n", conflict->package2); sync->removes = alpm_list_add(sync->removes, local); } else { /* abort */ - _alpm_log(handle, PM_LOG_ERROR, _("unresolvable package conflicts detected\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("unresolvable package conflicts detected\n")); handle->pm_errno = PM_ERR_CONFLICTING_DEPS; ret = -1; if(data) { @@ -517,14 +517,14 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) for(j = spkg->removes; j; j = j->next) { alpm_pkg_t *rpkg = j->data; if(!_alpm_pkg_find(trans->remove, rpkg->name)) { - _alpm_log(handle, PM_LOG_DEBUG, "adding '%s' to remove list\n", rpkg->name); + _alpm_log(handle, ALPM_LOG_DEBUG, "adding '%s' to remove list\n", rpkg->name); trans->remove = alpm_list_add(trans->remove, _alpm_pkg_dup(rpkg)); } } } if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) { - _alpm_log(handle, PM_LOG_DEBUG, "checking dependencies\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "checking dependencies\n"); deps = alpm_checkdeps(handle, _alpm_db_get_pkgcache(handle->db_local), trans->remove, trans->add, 1); if(deps) { @@ -627,7 +627,7 @@ static int apply_deltas(alpm_handle_t *handle) snprintf(command, PATH_MAX, "xdelta3 -d -q -s %s %s %s", from, delta, to); } - _alpm_log(handle, PM_LOG_DEBUG, "command: %s\n", command); + _alpm_log(handle, ALPM_LOG_DEBUG, "command: %s\n", command); EVENT(trans, PM_TRANS_EVT_DELTA_PATCH_START, d->to, d->delta); @@ -810,7 +810,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) FREELIST(files); if(errors) { - _alpm_log(handle, PM_LOG_WARNING, _("failed to retrieve some files from %s\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("failed to retrieve some files from %s\n"), current->treename); if(handle->pm_errno == 0) { handle->pm_errno = PM_ERR_RETRIEVE; @@ -878,7 +878,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) /* load the package file and replace pkgcache entry with it in the target list */ /* TODO: alpm_pkg_get_db() will not work on this target anymore */ - _alpm_log(handle, PM_LOG_DEBUG, + _alpm_log(handle, ALPM_LOG_DEBUG, "replacing pkgcache entry with package file for target %s\n", spkg->name); alpm_pkg_t *pkgfile =_alpm_pkg_load_internal(handle, filepath, 1, spkg->md5sum, @@ -916,7 +916,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) if(!(trans->flags & PM_TRANS_FLAG_FORCE)) { EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_START, NULL, NULL); - _alpm_log(handle, PM_LOG_DEBUG, "looking for file conflicts\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "looking for file conflicts\n"); alpm_list_t *conflict = _alpm_db_find_fileconflicts(handle, trans->add, trans->remove); if(conflict) { @@ -936,9 +936,9 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) if(handle->checkspace) { EVENT(trans, PM_TRANS_EVT_DISKSPACE_START, NULL, NULL); - _alpm_log(handle, PM_LOG_DEBUG, "checking available disk space\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "checking available disk space\n"); if(_alpm_check_diskspace(handle) == -1) { - _alpm_log(handle, PM_LOG_ERROR, "%s\n", _("not enough free disk space")); + _alpm_log(handle, ALPM_LOG_ERROR, "%s\n", _("not enough free disk space")); return -1; } @@ -947,18 +947,18 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) /* remove conflicting and to-be-replaced packages */ if(replaces) { - _alpm_log(handle, PM_LOG_DEBUG, "removing conflicting and to-be-replaced packages\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "removing conflicting and to-be-replaced packages\n"); /* we want the frontend to be aware of commit details */ if(_alpm_remove_packages(handle) == -1) { - _alpm_log(handle, PM_LOG_ERROR, _("could not commit removal transaction\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not commit removal transaction\n")); return -1; } } /* install targets */ - _alpm_log(handle, PM_LOG_DEBUG, "installing packages\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "installing packages\n"); if(_alpm_upgrade_packages(handle) == -1) { - _alpm_log(handle, PM_LOG_ERROR, _("could not commit transaction\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not commit transaction\n")); return -1; } -- cgit v1.2.3 From 39262acab6b956bbc4491d3b90e967a09828e732 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 2 Jul 2011 02:01:39 +1000 Subject: Prefix alpm_transflag_t members with ALPM Signed-off-by: Allan McRae --- lib/libalpm/sync.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/libalpm/sync.c') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index c82665fc..410cbc7d 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -315,7 +315,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) *data = NULL; } - if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) { + if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) { alpm_list_t *resolved = NULL; /* target list after resolvedeps */ /* Build up list by repeatedly resolving each transaction package */ @@ -394,7 +394,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) EVENT(trans, PM_TRANS_EVT_RESOLVEDEPS_DONE, NULL, NULL); } - if(!(trans->flags & PM_TRANS_FLAG_NOCONFLICTS)) { + if(!(trans->flags & ALPM_TRANS_FLAG_NOCONFLICTS)) { /* check for inter-conflicts and whatnot */ EVENT(trans, PM_TRANS_EVT_INTERCONFLICTS_START, NULL, NULL); @@ -523,7 +523,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) } } - if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) { + if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) { _alpm_log(handle, ALPM_LOG_DEBUG, "checking dependencies\n"); deps = alpm_checkdeps(handle, _alpm_db_get_pkgcache(handle->db_local), trans->remove, trans->add, 1); @@ -904,7 +904,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) RET_ERR(handle, PM_ERR_PKG_INVALID, -1); } - if(trans->flags & PM_TRANS_FLAG_DOWNLOADONLY) { + if(trans->flags & ALPM_TRANS_FLAG_DOWNLOADONLY) { return 0; } @@ -913,7 +913,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) replaces = alpm_list_count(trans->remove); /* fileconflict check */ - if(!(trans->flags & PM_TRANS_FLAG_FORCE)) { + if(!(trans->flags & ALPM_TRANS_FLAG_FORCE)) { EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_START, NULL, NULL); _alpm_log(handle, ALPM_LOG_DEBUG, "looking for file conflicts\n"); -- cgit v1.2.3 From 3189d3bc4a7b5f3e92db14256e307e9a58071b2a Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 2 Jul 2011 02:01:39 +1000 Subject: Prefix alpm_transevt_t members with ALPM Signed-off-by: Allan McRae --- lib/libalpm/sync.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'lib/libalpm/sync.c') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 410cbc7d..77f3bbaf 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -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 */ -- cgit v1.2.3 From 495ba26e63ec5cb6b8def29f4e22ea7c444348d8 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 2 Jul 2011 02:01:39 +1000 Subject: Prefix alpm_transconv_t members with ALPM Signed-off-by: Allan McRae --- lib/libalpm/sync.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/libalpm/sync.c') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 77f3bbaf..f179f8e7 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -163,7 +163,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) } int doreplace = 0; - QUESTION(trans, PM_TRANS_CONV_REPLACE_PKG, lpkg, spkg, sdb->treename, &doreplace); + QUESTION(trans, ALPM_TRANS_CONV_REPLACE_PKG, lpkg, spkg, sdb->treename, &doreplace); if(!doreplace) { continue; } @@ -234,7 +234,7 @@ alpm_list_t SYMEXPORT *alpm_find_group_pkgs(alpm_list_t *dbs, if(_alpm_pkg_should_ignore(db->handle, pkg)) { ignorelist = alpm_list_add(ignorelist, pkg); int install = 0; - QUESTION(db->handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, pkg, + QUESTION(db->handle->trans, ALPM_TRANS_CONV_INSTALL_IGNOREPKG, pkg, NULL, NULL, &install); if(!install) continue; @@ -353,7 +353,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) see if they'd like to ignore them rather than failing the sync */ if(unresolvable != NULL) { int remove_unresolvable = 0; - QUESTION(trans, PM_TRANS_CONV_REMOVE_PKGS, unresolvable, + QUESTION(trans, ALPM_TRANS_CONV_REMOVE_PKGS, unresolvable, NULL, NULL, &remove_unresolvable); if(remove_unresolvable) { /* User wants to remove the unresolvable packages from the @@ -485,7 +485,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) alpm_pkg_t *sync = _alpm_pkg_find(trans->add, conflict->package1); alpm_pkg_t *local = _alpm_db_get_pkgfromcache(handle->db_local, conflict->package2); int doremove = 0; - QUESTION(trans, PM_TRANS_CONV_CONFLICT_PKG, conflict->package1, + QUESTION(trans, ALPM_TRANS_CONV_CONFLICT_PKG, conflict->package1, conflict->package2, conflict->reason, &doremove); if(doremove) { /* append to the removes list */ @@ -679,7 +679,7 @@ static int test_md5sum(alpm_trans_t *trans, const char *filepath, int ret = _alpm_test_md5sum(filepath, md5sum); if(ret == 1) { int doremove = 0; - QUESTION(trans, PM_TRANS_CONV_CORRUPTED_PKG, (char *)filepath, + QUESTION(trans, ALPM_TRANS_CONV_CORRUPTED_PKG, (char *)filepath, NULL, NULL, &doremove); if(doremove) { unlink(filepath); -- cgit v1.2.3 From bd88a8d5511c24db55dd2a5c04161918571dbfbd Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 2 Jul 2011 02:01:39 +1000 Subject: Prefix alpm_transprog_t members with ALPM Signed-off-by: Allan McRae --- lib/libalpm/sync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/sync.c') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index f179f8e7..1537347e 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -865,7 +865,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) char *filepath; pgp_verify_t check_sig; - PROGRESS(trans, PM_TRANS_PROGRESS_INTEGRITY_START, "", percent, + PROGRESS(trans, ALPM_TRANS_PROGRESS_INTEGRITY_START, "", percent, numtargs, current); if(spkg->origin == PKG_FROM_FILE) { continue; /* pkg_load() has been already called, this package is valid */ @@ -895,7 +895,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) _alpm_pkg_free_trans(spkg); /* spkg has been removed from the target list */ } - PROGRESS(trans, PM_TRANS_PROGRESS_INTEGRITY_START, "", 100, + PROGRESS(trans, ALPM_TRANS_PROGRESS_INTEGRITY_START, "", 100, numtargs, current); EVENT(trans, ALPM_TRANS_EVT_INTEGRITY_DONE, NULL, NULL); -- cgit v1.2.3 From afc96f2ab3d05f14a73e81f871164f01423b5572 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 2 Jul 2011 02:01:39 +1000 Subject: Prefix _alpm_errno_t members with ALPM Signed-off-by: Allan McRae --- lib/libalpm/sync.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'lib/libalpm/sync.c') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 1537347e..d6b54ba0 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -94,8 +94,8 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) trans = handle->trans; db_local = handle->db_local; dbs_sync = handle->dbs_sync; - ASSERT(trans != NULL, RET_ERR(handle, PM_ERR_TRANS_NULL, -1)); - ASSERT(trans->state == STATE_INITIALIZED, RET_ERR(handle, PM_ERR_TRANS_NOT_INITIALIZED, -1)); + ASSERT(trans != NULL, RET_ERR(handle, ALPM_ERR_TRANS_NULL, -1)); + ASSERT(trans->state == STATE_INITIALIZED, RET_ERR(handle, ALPM_ERR_TRANS_NOT_INITIALIZED, -1)); _alpm_log(handle, ALPM_LOG_DEBUG, "checking for package upgrades\n"); for(i = _alpm_db_get_pkgcache(db_local); i; i = i->next) { @@ -266,7 +266,7 @@ static int compute_download_size(alpm_pkg_t *newpkg) } fname = alpm_pkg_get_filename(newpkg); - ASSERT(fname != NULL, RET_ERR(handle, PM_ERR_PKG_INVALID_NAME, -1)); + ASSERT(fname != NULL, RET_ERR(handle, ALPM_ERR_PKG_INVALID_NAME, -1)); fpath = _alpm_filecache_find(handle, fname); if(fpath) { @@ -429,7 +429,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) sync = sync2; } else { _alpm_log(handle, ALPM_LOG_ERROR, _("unresolvable package conflicts detected\n")); - handle->pm_errno = PM_ERR_CONFLICTING_DEPS; + handle->pm_errno = ALPM_ERR_CONFLICTING_DEPS; ret = -1; if(data) { alpm_conflict_t *newconflict = _alpm_conflict_dup(conflict); @@ -493,7 +493,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) sync->removes = alpm_list_add(sync->removes, local); } else { /* abort */ _alpm_log(handle, ALPM_LOG_ERROR, _("unresolvable package conflicts detected\n")); - handle->pm_errno = PM_ERR_CONFLICTING_DEPS; + handle->pm_errno = ALPM_ERR_CONFLICTING_DEPS; ret = -1; if(data) { alpm_conflict_t *newconflict = _alpm_conflict_dup(conflict); @@ -528,7 +528,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) deps = alpm_checkdeps(handle, _alpm_db_get_pkgcache(handle->db_local), trans->remove, trans->add, 1); if(deps) { - handle->pm_errno = PM_ERR_UNSATISFIED_DEPS; + handle->pm_errno = ALPM_ERR_UNSATISFIED_DEPS; ret = -1; if(data) { *data = deps; @@ -612,11 +612,11 @@ static int apply_deltas(alpm_handle_t *handle) } else { /* len = cachedir len + from len + '/' + null */ len = strlen(cachedir) + strlen(d->from) + 2; - CALLOC(from, len, sizeof(char), RET_ERR(handle, PM_ERR_MEMORY, 1)); + CALLOC(from, len, sizeof(char), RET_ERR(handle, ALPM_ERR_MEMORY, 1)); snprintf(from, len, "%s/%s", cachedir, d->from); } len = strlen(cachedir) + strlen(d->to) + 2; - CALLOC(to, len, sizeof(char), RET_ERR(handle, PM_ERR_MEMORY, 1)); + CALLOC(to, len, sizeof(char), RET_ERR(handle, ALPM_ERR_MEMORY, 1)); snprintf(to, len, "%s/%s", cachedir, d->to); /* build the patch command */ @@ -652,7 +652,7 @@ static int apply_deltas(alpm_handle_t *handle) if(retval != 0) { /* one delta failed for this package, cancel the remaining ones */ EVENT(trans, ALPM_TRANS_EVT_DELTA_PATCH_FAILED, NULL, NULL); - handle->pm_errno = PM_ERR_DLT_PATCHFAILED; + handle->pm_errno = ALPM_ERR_DLT_PATCHFAILED; ret = 1; break; } @@ -714,7 +714,7 @@ static int validate_deltas(alpm_handle_t *handle, alpm_list_t *deltas, FREE(filepath); } if(errors) { - handle->pm_errno = PM_ERR_DLT_INVALID; + handle->pm_errno = ALPM_ERR_DLT_INVALID; return -1; } EVENT(trans, ALPM_TRANS_EVT_DELTA_INTEGRITY_DONE, NULL, NULL); @@ -760,7 +760,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) const char *fname = NULL; fname = alpm_pkg_get_filename(spkg); - ASSERT(fname != NULL, RET_ERR(handle, PM_ERR_PKG_INVALID_NAME, -1)); + ASSERT(fname != NULL, RET_ERR(handle, ALPM_ERR_PKG_INVALID_NAME, -1)); alpm_list_t *delta_path = spkg->delta_path; if(delta_path) { /* using deltas */ @@ -794,7 +794,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) /* print server + filename into a buffer */ len = strlen(server_url) + strlen(filename) + 2; - CALLOC(fileurl, len, sizeof(char), RET_ERR(handle, PM_ERR_MEMORY, -1)); + CALLOC(fileurl, len, sizeof(char), RET_ERR(handle, ALPM_ERR_MEMORY, -1)); snprintf(fileurl, len, "%s/%s", server_url, filename); ret = _alpm_download(handle, fileurl, cachedir, 0, 1, 0); @@ -813,7 +813,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) _alpm_log(handle, ALPM_LOG_WARNING, _("failed to retrieve some files from %s\n"), current->treename); if(handle->pm_errno == 0) { - handle->pm_errno = PM_ERR_RETRIEVE; + handle->pm_errno = ALPM_ERR_RETRIEVE; } return -1; } @@ -901,7 +901,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) if(errors) { - RET_ERR(handle, PM_ERR_PKG_INVALID, -1); + RET_ERR(handle, ALPM_ERR_PKG_INVALID, -1); } if(trans->flags & ALPM_TRANS_FLAG_DOWNLOADONLY) { @@ -926,7 +926,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) alpm_list_free_inner(conflict, (alpm_list_fn_free)_alpm_fileconflict_free); alpm_list_free(conflict); } - RET_ERR(handle, PM_ERR_FILE_CONFLICTS, -1); + RET_ERR(handle, ALPM_ERR_FILE_CONFLICTS, -1); } EVENT(trans, ALPM_TRANS_EVT_FILECONFLICTS_DONE, NULL, NULL); -- cgit v1.2.3