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/deps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/deps.c') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 6ca79c34..8c8307fb 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -483,7 +483,7 @@ static int can_remove_package(alpm_db_t *db, alpm_pkg_t *pkg, alpm_list_t *targe if(!include_explicit) { /* see if it was explicitly installed */ - if(alpm_pkg_get_reason(pkg) == PM_PKG_REASON_EXPLICIT) { + if(alpm_pkg_get_reason(pkg) == ALPM_PKG_REASON_EXPLICIT) { _alpm_log(db->handle, PM_LOG_DEBUG, "excluding %s -- explicitly installed\n", alpm_pkg_get_name(pkg)); return 0; -- cgit v1.2.3 From f818f570c555668314fa9ca657fba2fe3ffd8bd4 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 2 Jul 2011 02:01:38 +1000 Subject: Prefix alpm_depmod_t members with ALPM Signed-off-by: Allan McRae --- lib/libalpm/deps.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'lib/libalpm/deps.c') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 8c8307fb..dd08e795 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -213,7 +213,7 @@ static alpm_depend_t *filtered_depend(alpm_depend_t *dep, int nodepversion) if(nodepversion) { alpm_depend_t *newdep = _alpm_dep_dup(dep); ASSERT(newdep, return dep); - newdep->mod = PM_DEP_MOD_ANY; + newdep->mod = ALPM_DEP_MOD_ANY; dep = newdep; } return dep; @@ -353,16 +353,16 @@ static int dep_vercmp(const char *version1, alpm_depmod_t mod, { int equal = 0; - if(mod == PM_DEP_MOD_ANY) { + if(mod == ALPM_DEP_MOD_ANY) { equal = 1; } else { int cmp = alpm_pkg_vercmp(version1, version2); switch(mod) { - case PM_DEP_MOD_EQ: equal = (cmp == 0); break; - case PM_DEP_MOD_GE: equal = (cmp >= 0); break; - case PM_DEP_MOD_LE: equal = (cmp <= 0); break; - case PM_DEP_MOD_LT: equal = (cmp < 0); break; - case PM_DEP_MOD_GT: equal = (cmp > 0); break; + case ALPM_DEP_MOD_EQ: equal = (cmp == 0); break; + case ALPM_DEP_MOD_GE: equal = (cmp >= 0); break; + case ALPM_DEP_MOD_LE: equal = (cmp <= 0); break; + case ALPM_DEP_MOD_LT: equal = (cmp < 0); break; + case ALPM_DEP_MOD_GT: equal = (cmp > 0); break; default: equal = 1; break; } } @@ -392,7 +392,7 @@ int _alpm_depcmp(alpm_pkg_t *pkg, alpm_depend_t *dep) const char *provver = strchr(provision, '='); if(provver == NULL) { /* no provision version */ - satisfy = (dep->mod == PM_DEP_MOD_ANY + satisfy = (dep->mod == ALPM_DEP_MOD_ANY && strcmp(provision, dep->name) == 0); } else { /* This is a bit tricker than the old code for performance reasons. To @@ -425,24 +425,24 @@ alpm_depend_t *_alpm_splitdep(const char *depstring) /* Find a version comparator if one exists. If it does, set the type and * increment the ptr accordingly so we can copy the right strings. */ if((ptr = strstr(depstring, ">="))) { - depend->mod = PM_DEP_MOD_GE; + depend->mod = ALPM_DEP_MOD_GE; version = ptr + 2; } else if((ptr = strstr(depstring, "<="))) { - depend->mod = PM_DEP_MOD_LE; + depend->mod = ALPM_DEP_MOD_LE; version = ptr + 2; } else if((ptr = strstr(depstring, "="))) { /* Note: we must do =,<,> checks after <=, >= checks */ - depend->mod = PM_DEP_MOD_EQ; + depend->mod = ALPM_DEP_MOD_EQ; version = ptr + 1; } else if((ptr = strstr(depstring, "<"))) { - depend->mod = PM_DEP_MOD_LT; + depend->mod = ALPM_DEP_MOD_LT; version = ptr + 1; } else if((ptr = strstr(depstring, ">"))) { - depend->mod = PM_DEP_MOD_GT; + depend->mod = ALPM_DEP_MOD_GT; version = ptr + 1; } else { /* no version specified, leave version and ptr NULL */ - depend->mod = PM_DEP_MOD_ANY; + depend->mod = ALPM_DEP_MOD_ANY; } /* copy the right parts to the right places */ @@ -784,22 +784,22 @@ char SYMEXPORT *alpm_dep_compute_string(const alpm_depend_t *dep) } switch(dep->mod) { - case PM_DEP_MOD_ANY: + case ALPM_DEP_MOD_ANY: opr = ""; break; - case PM_DEP_MOD_GE: + case ALPM_DEP_MOD_GE: opr = ">="; break; - case PM_DEP_MOD_LE: + case ALPM_DEP_MOD_LE: opr = "<="; break; - case PM_DEP_MOD_EQ: + case ALPM_DEP_MOD_EQ: opr = "="; break; - case PM_DEP_MOD_LT: + case ALPM_DEP_MOD_LT: opr = "<"; break; - case PM_DEP_MOD_GT: + case ALPM_DEP_MOD_GT: opr = ">"; break; default: @@ -807,14 +807,14 @@ char SYMEXPORT *alpm_dep_compute_string(const alpm_depend_t *dep) break; } - if(dep->mod != PM_DEP_MOD_ANY && dep->version) { + if(dep->mod != ALPM_DEP_MOD_ANY && dep->version) { ver = dep->version; } else { ver = ""; } /* we can always compute len and print the string like this because opr - * and ver will be empty when PM_DEP_MOD_ANY is the depend type. the + * and ver will be empty when ALPM_DEP_MOD_ANY is the depend type. the * reassignments above also ensure we do not do a strlen(NULL). */ len = strlen(name) + strlen(opr) + strlen(ver) + 1; MALLOC(str, len, return NULL); -- 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/deps.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'lib/libalpm/deps.c') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index dd08e795..874787f5 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -138,7 +138,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, return NULL; } - _alpm_log(handle, PM_LOG_DEBUG, "started sorting dependencies\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "started sorting dependencies\n"); vertices = dep_graph_init(targets); @@ -161,13 +161,13 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, alpm_pkg_t *childpkg = nextchild->data; const char *message; - _alpm_log(handle, PM_LOG_WARNING, _("dependency cycle detected:\n")); + _alpm_log(handle, ALPM_LOG_WARNING, _("dependency cycle detected:\n")); if(reverse) { message =_("%s will be removed after its %s dependency\n"); } else { message =_("%s will be installed before its %s dependency\n"); } - _alpm_log(handle, PM_LOG_WARNING, message, vertexpkg->name, childpkg->name); + _alpm_log(handle, ALPM_LOG_WARNING, message, vertexpkg->name, childpkg->name); } } if(!found) { @@ -186,7 +186,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, } } - _alpm_log(handle, PM_LOG_DEBUG, "sorting dependencies finished\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "sorting dependencies finished\n"); if(reverse) { /* reverse the order */ @@ -291,7 +291,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis /* look for unsatisfied dependencies of the upgrade list */ for(i = upgrade; i; i = i->next) { alpm_pkg_t *tp = i->data; - _alpm_log(handle, PM_LOG_DEBUG, "checkdeps: package %s-%s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "checkdeps: package %s-%s\n", alpm_pkg_get_name(tp), alpm_pkg_get_version(tp)); for(j = alpm_pkg_get_depends(tp); j; j = j->next) { @@ -304,7 +304,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis /* Unsatisfied dependency in the upgrade list */ alpm_depmissing_t *miss; char *missdepstring = alpm_dep_compute_string(depend); - _alpm_log(handle, PM_LOG_DEBUG, "checkdeps: missing dependency '%s' for package '%s'\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "checkdeps: missing dependency '%s' for package '%s'\n", missdepstring, alpm_pkg_get_name(tp)); free(missdepstring); miss = depmiss_new(alpm_pkg_get_name(tp), depend, NULL); @@ -331,7 +331,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis !find_dep_satisfier(dblist, depend)) { alpm_depmissing_t *miss; char *missdepstring = alpm_dep_compute_string(depend); - _alpm_log(handle, PM_LOG_DEBUG, "checkdeps: transaction would break '%s' dependency of '%s'\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "checkdeps: transaction would break '%s' dependency of '%s'\n", missdepstring, alpm_pkg_get_name(lp)); free(missdepstring); miss = depmiss_new(lp->name, depend, alpm_pkg_get_name(causingpkg)); @@ -484,7 +484,7 @@ static int can_remove_package(alpm_db_t *db, alpm_pkg_t *pkg, alpm_list_t *targe if(!include_explicit) { /* see if it was explicitly installed */ if(alpm_pkg_get_reason(pkg) == ALPM_PKG_REASON_EXPLICIT) { - _alpm_log(db->handle, PM_LOG_DEBUG, "excluding %s -- explicitly installed\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, "excluding %s -- explicitly installed\n", alpm_pkg_get_name(pkg)); return 0; } @@ -532,7 +532,7 @@ void _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit) alpm_pkg_t *deppkg = j->data; if(_alpm_dep_edge(pkg, deppkg) && can_remove_package(db, deppkg, targs, include_explicit)) { - _alpm_log(db->handle, PM_LOG_DEBUG, "adding '%s' to the targets\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, "adding '%s' to the targets\n", alpm_pkg_get_name(deppkg)); /* add it to the target list */ targs = alpm_list_add(targs, _alpm_pkg_dup(deppkg)); @@ -573,7 +573,7 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep, QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, pkg, NULL, NULL, &install); } else { - _alpm_log(handle, PM_LOG_WARNING, _("ignoring package %s-%s\n"), pkg->name, pkg->version); + _alpm_log(handle, ALPM_LOG_WARNING, _("ignoring package %s-%s\n"), pkg->name, pkg->version); } if(!install) { ignored = 1; @@ -595,14 +595,14 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep, QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, pkg, NULL, NULL, &install); } else { - _alpm_log(handle, PM_LOG_WARNING, _("ignoring package %s-%s\n"), pkg->name, pkg->version); + _alpm_log(handle, ALPM_LOG_WARNING, _("ignoring package %s-%s\n"), pkg->name, pkg->version); } if(!install) { ignored = 1; continue; } } - _alpm_log(handle, PM_LOG_DEBUG, "provider found (%s provides %s)\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "provider found (%s provides %s)\n", pkg->name, dep->name); providers = alpm_list_add(providers, pkg); /* keep looking for other providers in the all dbs */ @@ -710,7 +710,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t on that list */ *packages = alpm_list_add(*packages, pkg); - _alpm_log(handle, PM_LOG_DEBUG, "started resolving dependencies\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "started resolving dependencies\n"); for(i = alpm_list_last(*packages); i; i = i->next) { alpm_pkg_t *tpkg = i->data; targ = alpm_list_add(NULL, tpkg); @@ -736,7 +736,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t if(!spkg) { handle->pm_errno = PM_ERR_UNSATISFIED_DEPS; char *missdepstring = alpm_dep_compute_string(missdep); - _alpm_log(handle, PM_LOG_WARNING, + _alpm_log(handle, ALPM_LOG_WARNING, _("cannot resolve \"%s\", a dependency of \"%s\"\n"), missdepstring, tpkg->name); free(missdepstring); @@ -745,7 +745,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t } ret = -1; } else { - _alpm_log(handle, PM_LOG_DEBUG, "pulling dependency %s (needed by %s)\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "pulling dependency %s (needed by %s)\n", alpm_pkg_get_name(spkg), alpm_pkg_get_name(tpkg)); *packages = alpm_list_add(*packages, spkg); _alpm_depmiss_free(miss); @@ -760,7 +760,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t } else { alpm_list_free(packages_copy); } - _alpm_log(handle, PM_LOG_DEBUG, "finished resolving dependencies\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "finished resolving dependencies\n"); return ret; } -- 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/deps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/deps.c') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 874787f5..066f5703 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -205,7 +205,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, static int no_dep_version(alpm_handle_t *handle) { int flags = alpm_trans_get_flags(handle); - return flags != -1 && (flags & PM_TRANS_FLAG_NODEPVERSION); + return flags != -1 && (flags & ALPM_TRANS_FLAG_NODEPVERSION); } static alpm_depend_t *filtered_depend(alpm_depend_t *dep, int nodepversion) -- 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/deps.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/deps.c') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 066f5703..f06e93cd 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -570,7 +570,7 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep, if(_alpm_pkg_should_ignore(handle, pkg)) { int install = 0; if(prompt) { - QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, pkg, + QUESTION(handle->trans, ALPM_TRANS_CONV_INSTALL_IGNOREPKG, pkg, NULL, NULL, &install); } else { _alpm_log(handle, ALPM_LOG_WARNING, _("ignoring package %s-%s\n"), pkg->name, pkg->version); @@ -592,7 +592,7 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep, if(_alpm_pkg_should_ignore(handle, pkg)) { int install = 0; if(prompt) { - QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, + QUESTION(handle->trans, ALPM_TRANS_CONV_INSTALL_IGNOREPKG, pkg, NULL, NULL, &install); } else { _alpm_log(handle, ALPM_LOG_WARNING, _("ignoring package %s-%s\n"), pkg->name, pkg->version); @@ -624,7 +624,7 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep, int index = 0; if(count > 1) { /* if there is more than one provider, we ask the user */ - QUESTION(handle->trans, PM_TRANS_CONV_SELECT_PROVIDER, + QUESTION(handle->trans, ALPM_TRANS_CONV_SELECT_PROVIDER, providers, dep, NULL, &index); } if(index >= 0 && index < count) { -- 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/deps.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libalpm/deps.c') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index f06e93cd..0319d291 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -637,9 +637,9 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep, } if(ignored) { /* resolvedeps will override these */ - handle->pm_errno = PM_ERR_PKG_IGNORED; + handle->pm_errno = ALPM_ERR_PKG_IGNORED; } else { - handle->pm_errno = PM_ERR_PKG_NOT_FOUND; + handle->pm_errno = ALPM_ERR_PKG_NOT_FOUND; } return NULL; } @@ -660,7 +660,7 @@ alpm_pkg_t SYMEXPORT *alpm_find_dbs_satisfier(alpm_handle_t *handle, alpm_pkg_t *pkg; CHECK_HANDLE(handle, return NULL); - ASSERT(dbs, RET_ERR(handle, PM_ERR_WRONG_ARGS, NULL)); + ASSERT(dbs, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, NULL)); dep = _alpm_splitdep(depstring); ASSERT(dep, return NULL); @@ -734,7 +734,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t spkg = resolvedep(handle, missdep, handle->dbs_sync, *packages, 0); } if(!spkg) { - handle->pm_errno = PM_ERR_UNSATISFIED_DEPS; + handle->pm_errno = ALPM_ERR_UNSATISFIED_DEPS; char *missdepstring = alpm_dep_compute_string(missdep); _alpm_log(handle, ALPM_LOG_WARNING, _("cannot resolve \"%s\", a dependency of \"%s\"\n"), -- cgit v1.2.3