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

commit a1f7eb03da197a20251d794c14e0bc16198140de
Author: Michel Hermier <[email protected]>
Date:   Sun May 11 09:26:36 2014 +0200

libpacman: s/_pacman_trans_add/__pmtrans_t::add/

diff --git a/lib/libpacman/sync.cpp b/lib/libpacman/sync.cpp
index 382cdea..97a0fee 100644
--- a/lib/libpacman/sync.cpp
+++ b/lib/libpacman/sync.cpp
@@ -188,7 +188,7 @@ int _pacman_sync_addtarget(pmtrans_t *trans, const char 
*name)
delete dummy;
RET_ERR(PM_ERR_MEMORY, -1);
}
-               _pacman_trans_add(trans, ps, 0);
+               trans->add(ps, 0);
}

return(0);
diff --git a/lib/libpacman/trans.cpp b/lib/libpacman/trans.cpp
index 0f6bec4..f9bb6e2 100644
--- a/lib/libpacman/trans.cpp
+++ b/lib/libpacman/trans.cpp
@@ -243,26 +243,25 @@ int _pacman_trans_set_state(pmtrans_t *trans, int 
new_state)
return(0);
}

-pmsyncpkg_t *_pacman_trans_add(pmtrans_t *trans, pmsyncpkg_t *syncpkg, int 
flags)
+pmsyncpkg_t *__pmtrans_t::add(pmsyncpkg_t *syncpkg, int flags)
{
pmsyncpkg_t *syncpkg_queued;

-       ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, NULL));
ASSERT(syncpkg != NULL, RET_ERR(PM_ERR_TRANS_NULL, NULL));
ASSERT(syncpkg->pkg != NULL || syncpkg->pkg_local != NULL, 
RET_ERR(PM_ERR_WRONG_ARGS, NULL));

if(syncpkg->pkg != NULL && syncpkg->pkg_local == NULL) {
-               Database *db_local = trans->handle->db_local;
+               Database *db_local = handle->db_local;

syncpkg->pkg_local = _pacman_db_get_pkgfromcache(db_local, 
syncpkg->pkg->name());
}

-       if((syncpkg_queued = trans->find(syncpkg->pkg_name)) != NULL) {
+       if((syncpkg_queued = find(syncpkg->pkg_name)) != NULL) {
/* FIXME: Try to compress syncpkg in syncpkg_queued more */
return NULL;
}
_pacman_log(PM_LOG_FLOW2, _("adding target '%s' to the transaction set"), 
syncpkg->pkg_name);
-       trans->syncpkgs = _pacman_list_add(trans->syncpkgs, syncpkg);
+       syncpkgs = _pacman_list_add(syncpkgs, syncpkg);
return syncpkg;
}

diff --git a/lib/libpacman/trans.h b/lib/libpacman/trans.h
index 169e77e..6d991f8 100644
--- a/lib/libpacman/trans.h
+++ b/lib/libpacman/trans.h
@@ -70,6 +70,8 @@ struct __pmtrans_t
int prepare(pmlist_t **data);
int commit(pmlist_t **data);

+       pmsyncpkg_t *add(pmsyncpkg_t *syncpkg, int flags);
+
const pmtrans_ops_t *ops;
int (*set_state)(pmtrans_t *trans, int new_state);
libpacman::Handle *handle;
@@ -103,7 +105,6 @@ do { \

int _pacman_trans_event(pmtrans_t *trans, unsigned char, void *, void *);

-pmsyncpkg_t *_pacman_trans_add(pmtrans_t *trans, pmsyncpkg_t *syncpkg, int 
flags);
int _pacman_trans_add_package(pmtrans_t *trans, pmpkg_t *pkg, pmtranstype_t 
type, int flags);
pmsyncpkg_t *_pacman_trans_add_target(pmtrans_t *trans, const char *target, 
pmtranstype_t type, int flags);
int _pacman_trans_addtarget(pmtrans_t *trans, const char *target);
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to