Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=5ad0f9f02f5f670d48124c2366e4e4cbb140066b

commit 5ad0f9f02f5f670d48124c2366e4e4cbb140066b
Author: Michel Hermier <[email protected]>
Date:   Sat Aug 9 12:45:27 2014 +0200

libpacman: More f_stringlistitem_to_str use.

diff --git a/lib/libpacman/conflict.cpp b/lib/libpacman/conflict.cpp
index 840e39f..8b7de2a 100644
--- a/lib/libpacman/conflict.cpp
+++ b/lib/libpacman/conflict.cpp
@@ -269,7 +269,7 @@ pmlist_t *_pacman_db_find_conflicts(pmtrans_t *trans)
}
conflict->type = PM_CONFLICT_TYPE_TARGET;
STRNCPY(conflict->target, p1->name(), PKG_NAME_LEN);
-                                               STRNCPY(conflict->file, 
k->data, CONFLICT_FILE_LEN);
+                                               STRNCPY(conflict->file, 
f_stringlistitem_to_str(k), CONFLICT_FILE_LEN);
STRNCPY(conflict->ctarget, p2->name(), PKG_NAME_LEN);
conflicts = _pacman_list_add(conflicts, conflict);
}
diff --git a/lib/libpacman/db.cpp b/lib/libpacman/db.cpp
index 2380d50..8a8a813 100644
--- a/lib/libpacman/db.cpp
+++ b/lib/libpacman/db.cpp
@@ -97,7 +97,7 @@ pmlist_t *Database::search(pmlist_t *needles)
for(i = needles; i; i = i->next) {
FStrMatcher strmatcher = { NULL };
FMatcher packagestrmatcher;
-               const char *targ = i->data;
+               const char *targ = f_stringlistitem_to_str(i);

if(f_strempty(targ)) {
continue;
diff --git a/lib/libpacman/deps.cpp b/lib/libpacman/deps.cpp
index 53fdedb..78726a5 100644
--- a/lib/libpacman/deps.cpp
+++ b/lib/libpacman/deps.cpp
@@ -242,7 +242,7 @@ pmlist_t *_pacman_checkdeps(pmtrans_t *trans, unsigned char 
op, pmlist_t *packag
//char *ver;
Package *p;
found = 0;
-                               if((p = _pacman_db_get_pkgfromcache(db_local, 
j->data)) == NULL) {
+                               if((p = _pacman_db_get_pkgfromcache(db_local, 
f_stringlistitem_to_str(j))) == NULL) {
/* hmmm... package isn't installed.. */
continue;
}
@@ -532,7 +532,7 @@ pmlist_t *_pacman_removedeps(Database *db, pmlist_t *targs)

/* see if other packages need it */
for(k = dep->requiredby(); k && !needed; k = k->next) {
-                               Package *dummy = 
_pacman_db_get_pkgfromcache(db, k->data);
+                               Package *dummy = 
_pacman_db_get_pkgfromcache(db, f_stringlistitem_to_str(k));
if(!_pacman_pkg_isin(dummy->name(), targs)) {
needed = 1;
}
diff --git a/lib/libpacman/package.cpp b/lib/libpacman/package.cpp
index 72b998f..8836d11 100644
--- a/lib/libpacman/package.cpp
+++ b/lib/libpacman/package.cpp
@@ -259,7 +259,7 @@ char *Package::fileneedbackup(const char *file) const

/* run through the backup list and parse out the md5 or sha1 hash for our file 
*/
for(lp = m_backup; lp; lp = lp->next) {
-               char *str = strdup(lp->data);
+               char *str = strdup(f_stringlistitem_to_str(lp));
char *ptr;

/* tab delimiter */
diff --git a/lib/libpacman/packages_transaction.cpp 
b/lib/libpacman/packages_transaction.cpp
index 97b0428..70fc3c9 100644
--- a/lib/libpacman/packages_transaction.cpp
+++ b/lib/libpacman/packages_transaction.cpp
@@ -56,7 +56,7 @@ _pacman_packages_transaction_set_state(pmtrans_t *trans, int 
new_state)

_pacman_log(PM_LOG_FLOW2, _("executing %s triggers..."), trigger_function);
for(lp = trans->triggers; lp; lp = lp->next) {
-               const char *trigger = lp->data;
+               const char *trigger = f_stringlistitem_to_str(lp);
char buf[PATH_MAX];

snprintf(buf, sizeof(buf), "%s/%s/%s", root, triggersdir, trigger);
diff --git a/lib/libpacman/trans.cpp b/lib/libpacman/trans.cpp
index 97e8e94..03e8972 100644
--- a/lib/libpacman/trans.cpp
+++ b/lib/libpacman/trans.cpp
@@ -342,8 +342,8 @@ int __pmtrans_t::add(const char *target, pmtranstype_t 
type, int flags)
if(p == NULL) {
RET_ERR(PM_ERR_PKG_NOT_FOUND, -1);
}
-                                       _pacman_log(PM_LOG_DEBUG, _("found '%s' 
as a provision for '%s'"), p->data, targ);
-                                       spkg = _pacman_db_get_pkgfromcache(dbs, 
p->data);
+                                       _pacman_log(PM_LOG_DEBUG, _("found '%s' 
as a provision for '%s'"), f_stringlistitem_to_str(p), targ);
+                                       spkg = _pacman_db_get_pkgfromcache(dbs, 
f_stringlistitem_to_str(p));
FREELISTPTR(p);
}
}
@@ -361,8 +361,8 @@ int __pmtrans_t::add(const char *target, pmtranstype_t 
type, int flags)
Database *dbs = i->data;
pmlist_t *p = _pacman_db_whatprovides(dbs, targ);
if(p) {
-                                       _pacman_log(PM_LOG_DEBUG, _("found '%s' 
as a provision for '%s'"), p->data, targ);
-                                       spkg = _pacman_db_get_pkgfromcache(dbs, 
p->data);
+                                       _pacman_log(PM_LOG_DEBUG, _("found '%s' 
as a provision for '%s'"), f_stringlistitem_to_str(p), targ);
+                                       spkg = _pacman_db_get_pkgfromcache(dbs, 
f_stringlistitem_to_str(p));
FREELISTPTR(p);
}
}
@@ -817,7 +817,7 @@ int __pmtrans_t::prepare(pmlist_t **data)
for(k = conflictp->depends(); k && !pfound; k = k->next) {
pmlist_t *m;
for(m = leavingp->provides(); m && !pfound; m = m->next) {
-                                                               
if(!strcmp(k->data, m->data)) {
+                                                               
if(!strcmp(f_stringlistitem_to_str(k), f_stringlistitem_to_str(m))) {
/* Found a match -- now look through final for a package that
* provides the same thing.  If none are found, then it truly
* is an unresolvable conflict. */
@@ -825,7 +825,7 @@ int __pmtrans_t::prepare(pmlist_t **data)
for(n = syncpkgs; n && !pfound; n = n->next) {
pmsyncpkg_t *sp = n->data;
for(o = sp->pkg_new->provides(); o && !pfound; o = o->next) {
-                                                                               
        if(!strcmp(m->data, o->data)) {
+                                                                               
        if(!strcmp(f_stringlistitem_to_str(m), f_stringlistitem_to_str(o))) {
/* found matching provisio -- we're good to go */
_pacman_log(PM_LOG_FLOW2, _("found '%s' as a provision for '%s' -- conflict 
aborted"),
sp->pkg_name, (char *)o->data);
@@ -1637,10 +1637,10 @@ int __pmtrans_t::commit(pmlist_t **data)
Package *old = j->data;
/* merge lists */
for(k = old->requiredby(); k; k = k->next) {
-                                               
if(!_pacman_list_is_strin(k->data, pkg_new->requiredby())) {
+                                               
if(!_pacman_list_is_strin(f_stringlistitem_to_str(k), pkg_new->requiredby())) {
/* replace old's name with new's name in the requiredby's dependency list */
pmlist_t *m;
-                                                       Package *depender = 
_pacman_db_get_pkgfromcache(db_local, k->data);
+                                                       Package *depender = 
_pacman_db_get_pkgfromcache(db_local, f_stringlistitem_to_str(k));
if(depender == NULL) {
/* If the depending package no longer exists in the local db,
* then it must have ALSO conflicted with ps->pkg.  If
@@ -1649,7 +1649,7 @@ int __pmtrans_t::commit(pmlist_t **data)
continue;
}
for(m = depender->depends(); m; m = m->next) {
-                                                               
if(!strcmp(m->data, old->name())) {
+                                                               
if(!strcmp(f_stringlistitem_to_str(m), old->name())) {
FREE(m->data);
m->data = strdup(pkg_new->name());
}
@@ -1659,7 +1659,7 @@ int __pmtrans_t::commit(pmlist_t **data)
pkg_new->name(), pkg_new->version());
}
/* add the new requiredby */
-                                                       pkg_new->m_requiredby = 
_pacman_stringlist_append(pkg_new->m_requiredby, k->data);
+                                                       pkg_new->m_requiredby = 
_pacman_stringlist_append(pkg_new->m_requiredby, f_stringlistitem_to_str(k));
}
}
}
@@ -1680,7 +1680,7 @@ int __pmtrans_t::commit(pmlist_t **data)
if(!varcache && !(flags & PM_TRANS_FLAG_DOWNLOADONLY)) {
/* delete packages */
for(i = files; i; i = i->next) {
-                       unlink(i->data);
+                       unlink(f_stringlistitem_to_str(i));
}
}
return(retval);
diff --git a/lib/libpacman/trans_sysupgrade.cpp 
b/lib/libpacman/trans_sysupgrade.cpp
index 5b58f2d..0a7ca1c 100644
--- a/lib/libpacman/trans_sysupgrade.cpp
+++ b/lib/libpacman/trans_sysupgrade.cpp
@@ -92,7 +92,7 @@ int _pacman_trans_sysupgrade(pmtrans_t *trans)
pmlist_t *m;
for(m = _pacman_db_get_pkgcache(db_local); m; m = m->next) {
Package *lpkg = m->data;
-                                       if(!strcmp(k->data, lpkg->name())) {
+                                       if(!strcmp(f_stringlistitem_to_str(k), 
lpkg->name())) {
_pacman_log(PM_LOG_DEBUG, _("checking replacement '%s' for package '%s'"), 
k->data, spkg->name());
if(_pacman_list_is_strin(lpkg->name(), handle->ignorepkg)) {
_pacman_log(PM_LOG_WARNING, _("%s-%s: ignoring package upgrade (to be replaced 
by %s-%s)"),
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to