[pacman-dev] some notes + new pactest file
ngaba at petra.hos.u-szeged.hu
ngaba at petra.hos.u-szeged.hu
Mon Jun 18 10:29:56 EDT 2007
>> 2. _alpm_checkdeps doesn't really need trans param (neither in my
>> patched version nor the original imho <- its usage in cvs version
>> is messy for me)
> I would love to see patches for all of these points too :)
> (at least, if you see a clean/correct way to do it)
> Maybe at least for 5. , since you provided a testcase, and that you
> say the code could be cleaned up while fixing it.
Hi!
Here is a simple patch for 2.
alpm_splitdep (submitted today) patch fixes 5.
Bye, ngaba
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
-------------- next part --------------
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 9ffc834..8df8645 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -189,7 +189,7 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
/* look for unsatisfied dependencies */
_alpm_log(PM_LOG_DEBUG, _("looking for unsatisfied dependencies"));
- lp = _alpm_checkdeps(trans, db, trans->type, trans->packages);
+ lp = _alpm_checkdeps(db, trans->type, trans->packages);
if(lp != NULL) {
if(data) {
*data = lp;
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 66b2d77..dfb5cfb 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -225,7 +225,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode)
* @param packages an alpm_list_t* of packages to be checked
* @return an alpm_list_t* of missing_t pointers.
*/
-alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
+alpm_list_t *_alpm_checkdeps(pmdb_t *db, pmtranstype_t op,
alpm_list_t *packages)
{
alpm_list_t *i, *j, *k, *l;
@@ -592,7 +592,7 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
_alpm_log(PM_LOG_DEBUG, _("started resolving dependencies"));
targ = alpm_list_add(NULL, syncpkg);
- deps = _alpm_checkdeps(trans, local, PM_TRANS_TYPE_ADD, targ);
+ deps = _alpm_checkdeps(local, PM_TRANS_TYPE_ADD, targ);
alpm_list_free(targ);
if(deps == NULL) {
diff --git a/lib/libalpm/deps.h b/lib/libalpm/deps.h
index 132f21f..2edbb50 100644
--- a/lib/libalpm/deps.h
+++ b/lib/libalpm/deps.h
@@ -56,7 +56,7 @@ pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdeptype_t type,
const char *depversion);
int _alpm_depmiss_isin(pmdepmissing_t *needle, alpm_list_t *haystack);
alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode);
-alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
+alpm_list_t *_alpm_checkdeps(pmdb_t *db, pmtranstype_t op,
alpm_list_t *packages);
alpm_list_t *_alpm_removedeps(pmdb_t *db, alpm_list_t *targs);
int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 920739a..74d9539 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -108,7 +108,7 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL);
_alpm_log(PM_LOG_DEBUG, _("looking for unsatisfied dependencies"));
- lp = _alpm_checkdeps(trans, db, trans->type, trans->packages);
+ lp = _alpm_checkdeps(db, trans->type, trans->packages);
if(lp != NULL) {
if(trans->flags & PM_TRANS_FLAG_CASCADE) {
while(lp) {
@@ -125,7 +125,7 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
}
}
FREELIST(lp);
- lp = _alpm_checkdeps(trans, db, trans->type, trans->packages);
+ lp = _alpm_checkdeps(db, trans->type, trans->packages);
}
} else {
if(data) {
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 87da969..f60e582 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -464,7 +464,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
EVENT(trans, PM_TRANS_EVT_RESOLVEDEPS_DONE, NULL, NULL);
_alpm_log(PM_LOG_DEBUG, _("looking for unresolvable dependencies"));
- deps = _alpm_checkdeps(trans, db_local, PM_TRANS_TYPE_UPGRADE, list);
+ deps = _alpm_checkdeps(db_local, PM_TRANS_TYPE_UPGRADE, list);
if(deps) {
if(data) {
*data = deps;
@@ -675,7 +675,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
}
if(list) {
_alpm_log(PM_LOG_DEBUG, _("checking dependencies of packages designated for removal"));
- deps = _alpm_checkdeps(trans, db_local, PM_TRANS_TYPE_REMOVE, list);
+ deps = _alpm_checkdeps(db_local, PM_TRANS_TYPE_REMOVE, list);
if(deps) {
/* Check if broken dependencies are fixed by packages we are installing */
int errorout = 0;
More information about the pacman-dev
mailing list