mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 15:58:50 -05:00
Rename pmconflict_t to alpm_conflict_t
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
6d876f9b6b
commit
220842b37b
@ -122,11 +122,11 @@ typedef struct _alpm_depmissing_t {
|
||||
} alpm_depmissing_t;
|
||||
|
||||
/** Conflict */
|
||||
typedef struct _pmconflict_t {
|
||||
typedef struct _alpm_conflict_t {
|
||||
char *package1;
|
||||
char *package2;
|
||||
char *reason;
|
||||
} pmconflict_t;
|
||||
} alpm_conflict_t;
|
||||
|
||||
/** File conflict */
|
||||
typedef struct _pmfileconflict_t {
|
||||
|
@ -40,12 +40,12 @@
|
||||
#include "log.h"
|
||||
#include "deps.h"
|
||||
|
||||
static pmconflict_t *conflict_new(const char *package1, const char *package2,
|
||||
static alpm_conflict_t *conflict_new(const char *package1, const char *package2,
|
||||
const char *reason)
|
||||
{
|
||||
pmconflict_t *conflict;
|
||||
alpm_conflict_t *conflict;
|
||||
|
||||
MALLOC(conflict, sizeof(pmconflict_t), return NULL);
|
||||
MALLOC(conflict, sizeof(alpm_conflict_t), return NULL);
|
||||
|
||||
STRDUP(conflict->package1, package1, return NULL);
|
||||
STRDUP(conflict->package2, package2, return NULL);
|
||||
@ -54,7 +54,7 @@ static pmconflict_t *conflict_new(const char *package1, const char *package2,
|
||||
return conflict;
|
||||
}
|
||||
|
||||
void _alpm_conflict_free(pmconflict_t *conflict)
|
||||
void _alpm_conflict_free(alpm_conflict_t *conflict)
|
||||
{
|
||||
FREE(conflict->package2);
|
||||
FREE(conflict->package1);
|
||||
@ -62,10 +62,10 @@ void _alpm_conflict_free(pmconflict_t *conflict)
|
||||
FREE(conflict);
|
||||
}
|
||||
|
||||
pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict)
|
||||
alpm_conflict_t *_alpm_conflict_dup(const alpm_conflict_t *conflict)
|
||||
{
|
||||
pmconflict_t *newconflict;
|
||||
CALLOC(newconflict, 1, sizeof(pmconflict_t), );
|
||||
alpm_conflict_t *newconflict;
|
||||
CALLOC(newconflict, 1, sizeof(alpm_conflict_t), );
|
||||
|
||||
STRDUP(newconflict->package1, conflict->package1, return NULL);
|
||||
STRDUP(newconflict->package2, conflict->package2, return NULL);
|
||||
@ -74,14 +74,14 @@ pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict)
|
||||
return newconflict;
|
||||
}
|
||||
|
||||
static int conflict_isin(pmconflict_t *needle, alpm_list_t *haystack)
|
||||
static int conflict_isin(alpm_conflict_t *needle, alpm_list_t *haystack)
|
||||
{
|
||||
alpm_list_t *i;
|
||||
const char *npkg1 = needle->package1;
|
||||
const char *npkg2 = needle->package2;
|
||||
|
||||
for(i = haystack; i; i = i->next) {
|
||||
pmconflict_t *conflict = i->data;
|
||||
alpm_conflict_t *conflict = i->data;
|
||||
const char *cpkg1 = conflict->package1;
|
||||
const char *cpkg2 = conflict->package2;
|
||||
if((strcmp(cpkg1, npkg1) == 0 && strcmp(cpkg2, npkg2) == 0)
|
||||
@ -103,7 +103,7 @@ static int conflict_isin(pmconflict_t *needle, alpm_list_t *haystack)
|
||||
static int add_conflict(alpm_handle_t *handle, alpm_list_t **baddeps,
|
||||
const char *pkg1, const char *pkg2, const char *reason)
|
||||
{
|
||||
pmconflict_t *conflict = conflict_new(pkg1, pkg2, reason);
|
||||
alpm_conflict_t *conflict = conflict_new(pkg1, pkg2, reason);
|
||||
if(!conflict) {
|
||||
return -1;
|
||||
}
|
||||
@ -209,7 +209,7 @@ alpm_list_t *_alpm_outerconflicts(alpm_db_t *db, alpm_list_t *packages)
|
||||
*
|
||||
* @param handle the context handle
|
||||
* @param pkglist the list of packages to check
|
||||
* @return an alpm_list_t of pmconflict_t
|
||||
* @return an alpm_list_t of alpm_conflict_t
|
||||
*/
|
||||
alpm_list_t SYMEXPORT *alpm_checkconflicts(alpm_handle_t *handle,
|
||||
alpm_list_t *pkglist)
|
||||
|
@ -24,8 +24,8 @@
|
||||
#include "db.h"
|
||||
#include "package.h"
|
||||
|
||||
pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict);
|
||||
void _alpm_conflict_free(pmconflict_t *conflict);
|
||||
alpm_conflict_t *_alpm_conflict_dup(const alpm_conflict_t *conflict);
|
||||
void _alpm_conflict_free(alpm_conflict_t *conflict);
|
||||
alpm_list_t *_alpm_innerconflicts(alpm_handle_t *handle, alpm_list_t *packages);
|
||||
alpm_list_t *_alpm_outerconflicts(alpm_db_t *db, alpm_list_t *packages);
|
||||
alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
|
||||
|
@ -405,7 +405,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
|
||||
deps = _alpm_innerconflicts(handle, trans->add);
|
||||
|
||||
for(i = deps; i; i = i->next) {
|
||||
pmconflict_t *conflict = i->data;
|
||||
alpm_conflict_t *conflict = i->data;
|
||||
alpm_pkg_t *rsync, *sync, *sync1, *sync2;
|
||||
|
||||
/* have we already removed one of the conflicting targets? */
|
||||
@ -432,7 +432,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
|
||||
handle->pm_errno = PM_ERR_CONFLICTING_DEPS;
|
||||
ret = -1;
|
||||
if(data) {
|
||||
pmconflict_t *newconflict = _alpm_conflict_dup(conflict);
|
||||
alpm_conflict_t *newconflict = _alpm_conflict_dup(conflict);
|
||||
if(newconflict) {
|
||||
*data = alpm_list_add(*data, newconflict);
|
||||
}
|
||||
@ -464,7 +464,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
|
||||
deps = _alpm_outerconflicts(handle->db_local, trans->add);
|
||||
|
||||
for(i = deps; i; i = i->next) {
|
||||
pmconflict_t *conflict = i->data;
|
||||
alpm_conflict_t *conflict = i->data;
|
||||
|
||||
/* if conflict->package2 (the local package) is not elected for removal,
|
||||
we ask the user */
|
||||
@ -496,7 +496,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
|
||||
handle->pm_errno = PM_ERR_CONFLICTING_DEPS;
|
||||
ret = -1;
|
||||
if(data) {
|
||||
pmconflict_t *newconflict = _alpm_conflict_dup(conflict);
|
||||
alpm_conflict_t *newconflict = _alpm_conflict_dup(conflict);
|
||||
if(newconflict) {
|
||||
*data = alpm_list_add(*data, newconflict);
|
||||
}
|
||||
|
@ -783,7 +783,7 @@ static int sync_trans(alpm_list_t *targets)
|
||||
break;
|
||||
case PM_ERR_CONFLICTING_DEPS:
|
||||
for(i = data; i; i = alpm_list_next(i)) {
|
||||
pmconflict_t *conflict = alpm_list_getdata(i);
|
||||
alpm_conflict_t *conflict = alpm_list_getdata(i);
|
||||
/* only print reason if it contains new information */
|
||||
if(strcmp(conflict->package1, conflict->reason) == 0 ||
|
||||
strcmp(conflict->package2, conflict->reason) == 0) {
|
||||
|
@ -118,7 +118,7 @@ int pacman_upgrade(alpm_list_t *targets)
|
||||
break;
|
||||
case PM_ERR_CONFLICTING_DEPS:
|
||||
for(i = data; i; i = alpm_list_next(i)) {
|
||||
pmconflict_t *conflict = alpm_list_getdata(i);
|
||||
alpm_conflict_t *conflict = alpm_list_getdata(i);
|
||||
if(strcmp(conflict->package1, conflict->reason) == 0 ||
|
||||
strcmp(conflict->package2, conflict->reason) == 0) {
|
||||
printf(_(":: %s and %s are in conflict\n"),
|
||||
|
@ -118,7 +118,7 @@ static int checkconflicts(alpm_list_t *pkglist)
|
||||
/* check conflicts */
|
||||
data = alpm_checkconflicts(handle, pkglist);
|
||||
for(i = data; i; i = i->next) {
|
||||
pmconflict_t *conflict = alpm_list_getdata(i);
|
||||
alpm_conflict_t *conflict = alpm_list_getdata(i);
|
||||
printf("%s conflicts with %s\n",
|
||||
conflict->package1, conflict->package2);
|
||||
ret++;
|
||||
|
Loading…
Reference in New Issue
Block a user