Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-04-13 21:01:28 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-04-13 21:01:28 +0000
commitc78bcae4019a94820bb01d6c88dbc4b2cae3d0ea (patch)
tree1a13ad32e7c4cb804dda289b82d68fa4c8d65df9
parent2669dfeb609a62b8d958af4cd4b2156e11100e1d (diff)
-fixed 2 logs
- some sync_commit() rework
-rw-r--r--lib/libalpm/sync.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index bf5df89c..4415e355 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -270,14 +270,14 @@ int sync_addtarget(pmdb_t *db, PMList *dbs_sync, pmtrans_t *trans, char *name)
/* ORE
if(!yesno(":: %s-%s: local version is newer. Upgrade anyway? [Y/n] ", lpkgname, lpkgver)) {
}*/
- _alpm_log(PM_LOG_WARNING, "%s-%s: local version is newer -- skipping");
+ _alpm_log(PM_LOG_WARNING, "%s-%s: local version is newer -- skipping", local->name, local->version);
return(0);
} else if(cmp == 0) {
/* versions are identical */
/* ORE
if(!yesno(":: %s-%s: is up to date. Upgrade anyway? [Y/n] ", lpkgname, lpkgver)) {
}*/
- _alpm_log(PM_LOG_WARNING, "%s-%s: is up to date -- skipping");
+ _alpm_log(PM_LOG_WARNING, "%s-%s: is up to date -- skipping", local->name, local->version);
return(0);
}
}
@@ -388,6 +388,7 @@ int sync_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data)
we won't be breaking anything by removing them.
If a broken dep is detected, make sure it's not from a
package that's in our final (upgrade) list. */
+ _alpm_log(PM_LOG_DEBUG, "checking dependencies of packages designated for removal");
return(0);
@@ -400,7 +401,7 @@ error:
int sync_commit(pmdb_t *db, pmtrans_t *trans)
{
- PMList *i, *j, *files = NULL;
+ PMList *i, *j = NULL;
PMList *final = NULL;
PMList *rmtargs = NULL;
PMList *data;
@@ -410,7 +411,7 @@ int sync_commit(pmdb_t *db, pmtrans_t *trans)
/* ORE - alpm does not handle removal of conflicting pkgs for now */
/* remove to-be-replaced packages */
- for(i = final; i; i = i->next) {
+ for(i = trans->packages; i; i = i->next) {
pmsyncpkg_t *sync = i->data;
for(j = sync->replaces; j; j = j->next) {
pmpkg_t *pkg = j->data;
@@ -420,12 +421,18 @@ int sync_commit(pmdb_t *db, pmtrans_t *trans)
/* install targets */
/* ORE - need for a flag specifying that deps have already been checked */
- tr = trans_new(PM_TRANS_TYPE_UPGRADE, 0);
- for(i = files; i; i = i->next) {
- trans_addtarget(tr, i->data);
+ tr = trans_new(PM_TRANS_TYPE_UPGRADE, PM_TRANS_FLAG_NODEPS);
+ for(i = trans->packages; i; i = i->next) {
+ if(trans_addtarget(tr, i->data) == -1) {
+ goto error;
+ }
+ }
+ if(trans_prepare(tr, &data) == -1) {
+ goto error;
+ }
+ if(trans_commit(tr) == -1) {
+ goto error;
}
- trans_prepare(tr, &data);
- trans_commit(tr);
trans_free(tr);
/* propagate replaced packages' requiredby fields to their new owners */
@@ -463,6 +470,9 @@ int sync_commit(pmdb_t *db, pmtrans_t *trans)
db_free_pkgcache(db);
return(0);
+
+error:
+ return(-1);
}
/* vim: set ts=2 sw=2 noet: */