From aefb4e0fa54ad5b4140d6991f389b5a6fb4ead6d Mon Sep 17 00:00:00 2001 From: Nagy Gabor Date: Sat, 7 Mar 2009 19:44:34 +0100 Subject: Remove pmsyncpkg_t pmsyncpkg_t data sructure was removed: 1. pmpkg_t.reason is used instead of pmsyncpkg_t.newreason. (The target packages come from sync repos, so we can use this field without any problems. Upgrade transaction also uses this field to store this info.) 2. pmsyncpkg_t.removes was moved to pmpkg_t.removes. This step requires careful programming, because we don't duplicate packages when we add them to trans->packages. So we modify sync pkgcache when we add this transaction-only info to our package. Hence it is important to free this list when we remove any package from the target list (remove_unresolvable, remove_conflicts, trans_free), otherwise this could confuse the new sync transactions (with non-pacman GUI). Overall, our code became ~100 line shorter, and we can call our helper functions directly on trans->packages in sync.c, we don't need to maintain parallel package lists. Signed-off-by: Nagy Gabor Signed-off-by: Dan McGee --- lib/libalpm/sync.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'lib/libalpm/sync.h') diff --git a/lib/libalpm/sync.h b/lib/libalpm/sync.h index b6a4bbff..00985b6f 100644 --- a/lib/libalpm/sync.h +++ b/lib/libalpm/sync.h @@ -23,25 +23,12 @@ #include "alpm.h" -/* Sync package */ -struct __pmsyncpkg_t { - pmpkgreason_t newreason; - pmpkg_t *pkg; - alpm_list_t *removes; -}; - -pmsyncpkg_t *_alpm_sync_new(pmpkgreason_t newreason, pmpkg_t *spkg, alpm_list_t *removes); -void _alpm_sync_free(pmsyncpkg_t *data); - int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync); int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync, char *name); int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync, alpm_list_t **data); int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data); -/* typically trans->packages */ -pmsyncpkg_t *_alpm_sync_find(alpm_list_t *syncpkgs, const char* pkgname); - #endif /* _ALPM_SYNC_H */ /* vim: set ts=2 sw=2 noet: */ -- cgit v1.2.3-24-g4f1b