FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 06-16-2011, 05:01 PM
Dan McGee
 
Default Make struct pmconflict_t public

Signed-off-by: Dan McGee <dan@archlinux.org>
---
lib/libalpm/alpm.h | 12 +++++++-----
lib/libalpm/conflict.c | 18 ------------------
lib/libalpm/conflict.h | 6 ------
src/pacman/sync.c | 12 ++++++------
src/pacman/upgrade.c | 13 ++++++-------
src/util/testdb.c | 4 ++--
6 files changed, 21 insertions(+), 44 deletions(-)

diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 4c44a36..0fd6f37 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -92,7 +92,13 @@ typedef struct __pmgrp_t pmgrp_t;
typedef struct __pmtrans_t pmtrans_t;
typedef struct __pmdepend_t pmdepend_t;
typedef struct __pmdepmissing_t pmdepmissing_t;
-typedef struct __pmconflict_t pmconflict_t;
+
+/** Conflict */
+typedef struct _pmconflict_t {
+ char *package1;
+ char *package2;
+ char *reason;
+} pmconflict_t;

/** File conflict */
typedef struct _pmfileconflict_t {
@@ -928,10 +934,6 @@ const char *alpm_miss_get_causingpkg(const pmdepmissing_t *miss);

alpm_list_t *alpm_checkconflicts(pmhandle_t *handle, alpm_list_t *pkglist);

-const char *alpm_conflict_get_package1(pmconflict_t *conflict);
-const char *alpm_conflict_get_package2(pmconflict_t *conflict);
-const char *alpm_conflict_get_reason(pmconflict_t *conflict);
-
/** Returns the type of version constraint.
* @param dep a dependency info structure
* @return the type of version constraint (PM_DEP_MOD_ANY if no version
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index d9a0b7c..39f42bf 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -547,22 +547,4 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmhandle_t *handle,
return conflicts;
}

-const char SYMEXPORT *alpm_conflict_get_package1(pmconflict_t *conflict)
-{
- ASSERT(conflict != NULL, return NULL);
- return conflict->package1;
-}
-
-const char SYMEXPORT *alpm_conflict_get_package2(pmconflict_t *conflict)
-{
- ASSERT(conflict != NULL, return NULL);
- return conflict->package2;
-}
-
-const char SYMEXPORT *alpm_conflict_get_reason(pmconflict_t *conflict)
-{
- ASSERT(conflict != NULL, return NULL);
- return conflict->reason;
-}
-
/* vim: set ts=2 sw=2 noet: */
diff --git a/lib/libalpm/conflict.h b/lib/libalpm/conflict.h
index a9d3e27..546a282 100644
--- a/lib/libalpm/conflict.h
+++ b/lib/libalpm/conflict.h
@@ -24,12 +24,6 @@
#include "db.h"
#include "package.h"

-struct __pmconflict_t {
- char *package1;
- char *package2;
- char *reason;
-};
-
pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict);
void _alpm_conflict_free(pmconflict_t *conflict);
alpm_list_t *_alpm_innerconflicts(pmhandle_t *handle, alpm_list_t *packages);
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 2c21d57..254117a 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -795,14 +795,14 @@ static int sync_trans(alpm_list_t *targets)
case PM_ERR_CONFLICTING_DEPS:
for(i = data; i; i = alpm_list_next(i)) {
pmconflict_t *conflict = alpm_list_getdata(i);
- const char *package1 = alpm_conflict_get_package1(conflict);
- const char *package2 = alpm_conflict_get_package2(conflict);
- const char *reason = alpm_conflict_get_reason(conflict);
/* only print reason if it contains new information */
- if(strcmp(package1, reason) == 0 || strcmp(package2, reason) == 0) {
- printf(_(":: %s and %s are in conflict
"), package1, package2);
+ if(strcmp(conflict->package1, conflict->reason) == 0 ||
+ strcmp(conflict->package2, conflict->reason) == 0) {
+ printf(_(":: %s and %s are in conflict
"),
+ conflict->package1, conflict->package2);
} else {
- printf(_(":: %s and %s are in conflict (%s)
"), package1, package2, reason);
+ printf(_(":: %s and %s are in conflict (%s)
"),
+ conflict->package1, conflict->package2, conflict->reason);
}
}
break;
diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c
index 37cf700..0abcbe4 100644
--- a/src/pacman/upgrade.c
+++ b/src/pacman/upgrade.c
@@ -121,14 +121,13 @@ int pacman_upgrade(alpm_list_t *targets)
case PM_ERR_CONFLICTING_DEPS:
for(i = data; i; i = alpm_list_next(i)) {
pmconflict_t *conflict = alpm_list_getdata(i);
- const char *package1 = alpm_conflict_get_package1(conflict);
- const char *package2 = alpm_conflict_get_package2(conflict);
- const char *reason = alpm_conflict_get_reason(conflict);
- /* only print reason if it contains new information */
- if(strcmp(package1, reason) == 0 || strcmp(package2, reason) == 0) {
- printf(_(":: %s and %s are in conflict
"), package1, package2);
+ if(strcmp(conflict->package1, conflict->reason) == 0 ||
+ strcmp(conflict->package2, conflict->reason) == 0) {
+ printf(_(":: %s and %s are in conflict
"),
+ conflict->package1, conflict->package2);
} else {
- printf(_(":: %s and %s are in conflict (%s)
"), package1, package2, reason);
+ printf(_(":: %s and %s are in conflict (%s)
"),
+ conflict->package1, conflict->package2, conflict->reason);
}
}
break;
diff --git a/src/util/testdb.c b/src/util/testdb.c
index 0bd7820..aeccdb7 100644
--- a/src/util/testdb.c
+++ b/src/util/testdb.c
@@ -120,8 +120,8 @@ static int checkconflicts(alpm_list_t *pkglist)
data = alpm_checkconflicts(handle, pkglist);
for(i = data; i; i = i->next) {
pmconflict_t *conflict = alpm_list_getdata(i);
- printf("%s conflicts with %s
", alpm_conflict_get_package1(conflict),
- alpm_conflict_get_package2(conflict));
+ printf("%s conflicts with %s
",
+ conflict->package1, conflict->package2);
ret++;
}
FREELIST(data);
--
1.7.5.4
 

Thread Tools




All times are GMT. The time now is 04:06 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org