summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-04-06 18:29:17 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-04-06 18:29:17 +0000
commit3b49720e397b1c8042cf262547f6e8a0590dc078 (patch)
tree1138eda94df1c169c95a2b3d3dbe2b706ba6fe3c /lib
parent04e054f3cbc9ddda9d99e4891055ae2743b3b8ff (diff)
updated structure names (PM_SYNCPKG), and added transaction queues (install & remove)
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/alpm.c6
-rw-r--r--lib/libalpm/alpm.h17
-rw-r--r--lib/libalpm/deps.c2
-rw-r--r--lib/libalpm/sync.h20
4 files changed, 19 insertions, 26 deletions
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index 16e103ea..e2646975 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -443,7 +443,7 @@ void *alpm_grp_getinfo(PM_GRP *grp, unsigned char parm)
* Sync operations
*/
-void *alpm_sync_getinfo(PM_SYNC *sync, unsigned char parm)
+void *alpm_sync_getinfo(PM_SYNCPKG *sync, unsigned char parm)
{
void *data;
@@ -454,6 +454,7 @@ void *alpm_sync_getinfo(PM_SYNC *sync, unsigned char parm)
case PM_SYNC_TYPE: data = (void *)(int)sync->type; break;
case PM_SYNC_LOCALPKG: data = sync->lpkg; break;
case PM_SYNC_SYNCPKG: data = sync->spkg; break;
+ case PM_SYNC_REPLACES: data = sync->replaces; break;
default:
data = NULL;
break;
@@ -488,7 +489,8 @@ void *alpm_trans_getinfo(unsigned char parm)
case PM_TRANS_TYPE: data = (void *)(int)trans->type; break;
case PM_TRANS_FLAGS: data = (void *)(int)trans->flags; break;
case PM_TRANS_TARGETS: data = trans->targets; break;
- case PM_TRANS_PACKAGES: data = trans->packages; break;
+ case PM_TRANS_INSTALLQ: data = trans->install_q; break;
+ case PM_TRANS_REMOVEQ: data = trans->remove_q; break;
default:
data = NULL;
break;
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 6962d380..7eaddb07 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -36,7 +36,7 @@ typedef struct __pmlist_t PM_LIST;
typedef struct __pmdb_t PM_DB;
typedef struct __pmpkg_t PM_PKG;
typedef struct __pmgrp_t PM_GRP;
-typedef struct __pmsync_t PM_SYNC;
+typedef struct __pmsyncpkg_t PM_SYNCPKG;
typedef struct __pmtrans_t PM_TRANS;
typedef struct __pmdepmissing_t PM_DEPMISS;
@@ -174,19 +174,19 @@ void *alpm_grp_getinfo(PM_GRP *grp, unsigned char parm);
/* Types */
enum {
- PM_SYSUPG_REPLACE = 1,
- PM_SYSUPG_UPGRADE,
- PM_SYSUPG_DEPEND
+ PM_SYNC_TYPE_REPLACE = 1,
+ PM_SYNC_TYPE_UPGRADE,
+ PM_SYNC_TYPE_DEPEND
};
/* Info parameters */
enum {
PM_SYNC_TYPE = 1,
PM_SYNC_LOCALPKG,
- PM_SYNC_SYNCPKG
+ PM_SYNC_SYNCPKG,
+ PM_SYNC_REPLACES
};
-void *alpm_sync_getinfo(PM_SYNC *sync, unsigned char parm);
-int alpm_sync_sysupgrade(PM_LIST **data);
+void *alpm_sync_getinfo(PM_SYNCPKG *sync, unsigned char parm);
/*
* Transactions
@@ -234,7 +234,8 @@ enum {
PM_TRANS_TYPE = 1,
PM_TRANS_FLAGS,
PM_TRANS_TARGETS,
- PM_TRANS_PACKAGES
+ PM_TRANS_INSTALLQ,
+ PM_TRANS_REMOVEQ
};
void *alpm_trans_getinfo(unsigned char parm);
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 41e061bf..602e8d6c 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -538,7 +538,7 @@ PMList* removedeps(pmdb_t *db, PMList *targs)
}
/* populates *list with packages that need to be installed to satisfy all
- * dependencies (recursive) for *syncpkg->pkg
+ * dependencies (recursive) for syncpkg
*
* make sure *list and *trail are already initialized
*/
diff --git a/lib/libalpm/sync.h b/lib/libalpm/sync.h
index 51e0dd3d..94a70189 100644
--- a/lib/libalpm/sync.h
+++ b/lib/libalpm/sync.h
@@ -26,28 +26,18 @@
#include "trans.h"
#include "alpm.h"
-typedef struct __syncpkg_t { /* ORE: not used for now */
- pmpkg_t *pkg;
- pmdb_t *db;
-} pmsyncpkg_t;
-
-typedef struct __pmsync_t {
+typedef struct __pmsyncpkg_t {
unsigned char type;
pmpkg_t *lpkg;
pmpkg_t *spkg;
- pmdb_t *dbs; /* ORE: not used for now */
-} pmsync_t;
+ PMList *replaces;
+} pmsyncpkg_t;
-pmsync_t *sync_new(int type, pmpkg_t *lpkg, pmpkg_t *spkg);
+pmsyncpkg_t *sync_new(int type, pmpkg_t *lpkg, pmpkg_t *spkg);
+void sync_free(pmsyncpkg_t *sync);
PMList *sync_load_archive(char *archive);
-/*int sync_findpkg(char *name, PMList *dbs, pmsyncpkg_t **sync);
-pmsyncpkg_t *find_pkginsync(char *needle, PMList *haystack);
-PMList *rm_pkginsync(char *needle, PMList *haystack);*/
-
-int sync_sysupgrade(PMList **data);
-
int sync_addtarget(pmdb_t *db, PMList *dbs_sync, pmtrans_t *trans, char *name);
int sync_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data);
int sync_commit(pmdb_t *db, pmtrans_t *trans);