1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-10 11:35:00 -05:00

turned pmdepmissing_t into an opaque structure

This commit is contained in:
Aurelien Foret 2005-03-29 20:32:10 +00:00
parent 95ea99e197
commit d16c8be8a0
4 changed files with 22 additions and 21 deletions

View File

@ -83,13 +83,14 @@ int pacman_add(list_t *targets)
switch(pm_errno) { switch(pm_errno) {
case PM_ERR_UNSATISFIED_DEPS: case PM_ERR_UNSATISFIED_DEPS:
for(i = alpm_list_first(data); i; i = alpm_list_next(i)) { for(i = alpm_list_first(data); i; i = alpm_list_next(i)) {
pmdepmissing_t *miss = alpm_list_getdata(i); PM_DEPMISS *miss = alpm_list_getdata(i);
MSG(NL, ":: %s: requires %s", miss->target, miss->depend.name); MSG(NL, ":: %s: requires %s", alpm_dep_getinfo(miss, PM_DEP_TARGET),
switch(miss->depend.mod) { alpm_dep_getinfo(miss, PM_DEP_NAME));
case PM_DEP_EQ: MSG(CL, "=%s", miss->depend.version); break; switch((int)alpm_dep_getinfo(miss, PM_DEP_MOD)) {
case PM_DEP_GE: MSG(CL, ">=%s", miss->depend.version); break; case PM_DEP_MOD_EQ: MSG(CL, "=%s", alpm_dep_getinfo(miss, PM_DEP_VERSION)); break;
case PM_DEP_LE: MSG(CL, "<=%s", miss->depend.version); break; case PM_DEP_MOD_GE: MSG(CL, ">=%s", alpm_dep_getinfo(miss, PM_DEP_VERSION)); break;
case PM_DEP_MOD_LE: MSG(CL, "<=%s", alpm_dep_getinfo(miss, PM_DEP_VERSION)); break;
} }
MSG(CL, "\n"); MSG(CL, "\n");
} }
@ -97,10 +98,10 @@ int pacman_add(list_t *targets)
break; break;
case PM_ERR_CONFLICTING_DEPS: case PM_ERR_CONFLICTING_DEPS:
for(i = alpm_list_first(data); i; i = alpm_list_next(i)) { for(i = alpm_list_first(data); i; i = alpm_list_next(i)) {
pmdepmissing_t *miss = alpm_list_getdata(i); PM_DEPMISS *miss = alpm_list_getdata(i);
MSG(NL, ":: %s: conflicts with %s", MSG(NL, ":: %s: conflicts with %s",
miss->target, miss->depend.name, miss->depend.name); alpm_dep_getinfo(miss, PM_DEP_TARGET), alpm_dep_getinfo(miss, PM_DEP_NAME));
} }
alpm_list_free(data); alpm_list_free(data);
break; break;

View File

@ -283,25 +283,25 @@ int pacman_deptest(list_t *targets)
switch(pm_errno) { switch(pm_errno) {
case PM_ERR_UNSATISFIED_DEPS: case PM_ERR_UNSATISFIED_DEPS:
for(lp = alpm_list_first(data); lp; lp = alpm_list_next(lp)) { for(lp = alpm_list_first(data); lp; lp = alpm_list_next(lp)) {
pmdepmissing_t *miss = alpm_list_getdata(lp); PM_DEPMISS *miss = alpm_list_getdata(lp);
if(!pmo_d_resolve) { if(!pmo_d_resolve) {
MSG(NL, "requires: %s", miss->depend.name); MSG(NL, "requires: %s", alpm_dep_getinfo(miss, PM_DEP_NAME));
switch(miss->depend.mod) { switch((int)alpm_dep_getinfo(miss, PM_DEP_MOD)) {
case PM_DEP_EQ: MSG(CL, "=%s", miss->depend.version); break; case PM_DEP_MOD_EQ: MSG(CL, "=%s", alpm_dep_getinfo(miss, PM_DEP_VERSION)); break;
case PM_DEP_GE: MSG(CL, ">=%s", miss->depend.version); break; case PM_DEP_MOD_GE: MSG(CL, ">=%s", alpm_dep_getinfo(miss, PM_DEP_VERSION)); break;
case PM_DEP_LE: MSG(CL, "<=%s", miss->depend.version); break; case PM_DEP_MOD_LE: MSG(CL, "<=%s", alpm_dep_getinfo(miss, PM_DEP_VERSION)); break;
} }
MSG(CL, "\n"); MSG(CL, "\n");
} }
synctargs = list_add(synctargs, strdup(miss->depend.name)); synctargs = list_add(synctargs, alpm_dep_getinfo(miss, PM_DEP_NAME));
} }
alpm_list_free(data); alpm_list_free(data);
break; break;
case PM_ERR_CONFLICTING_DEPS: case PM_ERR_CONFLICTING_DEPS:
/* we can't auto-resolve conflicts */ /* we can't auto-resolve conflicts */
for(lp = alpm_list_first(data); lp; lp = alpm_list_next(lp)) { for(lp = alpm_list_first(data); lp; lp = alpm_list_next(lp)) {
pmdepmissing_t *miss = alpm_list_getdata(lp); PM_DEPMISS *miss = alpm_list_getdata(lp);
MSG(NL, "conflict: %s", miss->depend.name); MSG(NL, "conflict: %s", alpm_dep_getinfo(miss, PM_DEP_NAME));
} }
ret = 127; ret = 127;
alpm_list_free(data); alpm_list_free(data);

View File

@ -93,8 +93,8 @@ int pacman_remove(list_t *targets)
switch(pm_errno) { switch(pm_errno) {
case PM_ERR_UNSATISFIED_DEPS: case PM_ERR_UNSATISFIED_DEPS:
for(i = alpm_list_first(data); i; i = alpm_list_next(i)) { for(i = alpm_list_first(data); i; i = alpm_list_next(i)) {
pmdepmissing_t *miss = alpm_list_getdata(i); PM_DEPMISS *miss = alpm_list_getdata(i);
MSG(NL, " %s: is required by %s\n", miss->target, miss->depend.name); MSG(NL, " %s: is required by %s\n", alpm_dep_getinfo(miss, PM_DEP_TARGET), alpm_dep_getinfo(miss, PM_DEP_NAME));
} }
alpm_list_free(data); alpm_list_free(data);
break; break;

View File

@ -425,8 +425,8 @@ int pacman_sync(list_t *targets)
if(pm_errno == PM_ERR_UNRESOLVABLE_DEPS) { if(pm_errno == PM_ERR_UNRESOLVABLE_DEPS) {
ERR(NL, "cannot resolve dependencies\n"); ERR(NL, "cannot resolve dependencies\n");
for(lp = alpm_list_first(data); lp; lp = alpm_list_next(lp)) { for(lp = alpm_list_first(data); lp; lp = alpm_list_next(lp)) {
pmdepmissing_t *miss = alpm_list_getdata(lp); PM_DEPMISS *miss = alpm_list_getdata(lp);
ERR(NL, " %s: \"%s\" is not in the package set\n", miss->target, miss->depend.name); ERR(NL, " %s: \"%s\" is not in the package set\n", alpm_dep_getinfo(miss, PM_DEP_TARGET), alpm_dep_getinfo(miss, PM_DEP_NAME));
} }
alpm_list_free(data); alpm_list_free(data);
} else { } else {