1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-01-04 02:18:00 -05:00

updated structure names (PM_SYNCPKG), and added transaction queues (install & remove)

This commit is contained in:
Aurelien Foret 2005-04-06 18:29:17 +00:00
parent 04e054f3cb
commit 3b49720e39
4 changed files with 19 additions and 26 deletions

View File

@ -443,7 +443,7 @@ void *alpm_grp_getinfo(PM_GRP *grp, unsigned char parm)
* Sync operations * Sync operations
*/ */
void *alpm_sync_getinfo(PM_SYNC *sync, unsigned char parm) void *alpm_sync_getinfo(PM_SYNCPKG *sync, unsigned char parm)
{ {
void *data; 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_TYPE: data = (void *)(int)sync->type; break;
case PM_SYNC_LOCALPKG: data = sync->lpkg; break; case PM_SYNC_LOCALPKG: data = sync->lpkg; break;
case PM_SYNC_SYNCPKG: data = sync->spkg; break; case PM_SYNC_SYNCPKG: data = sync->spkg; break;
case PM_SYNC_REPLACES: data = sync->replaces; break;
default: default:
data = NULL; data = NULL;
break; 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_TYPE: data = (void *)(int)trans->type; break;
case PM_TRANS_FLAGS: data = (void *)(int)trans->flags; break; case PM_TRANS_FLAGS: data = (void *)(int)trans->flags; break;
case PM_TRANS_TARGETS: data = trans->targets; 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: default:
data = NULL; data = NULL;
break; break;

View File

@ -36,7 +36,7 @@ typedef struct __pmlist_t PM_LIST;
typedef struct __pmdb_t PM_DB; typedef struct __pmdb_t PM_DB;
typedef struct __pmpkg_t PM_PKG; typedef struct __pmpkg_t PM_PKG;
typedef struct __pmgrp_t PM_GRP; 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 __pmtrans_t PM_TRANS;
typedef struct __pmdepmissing_t PM_DEPMISS; typedef struct __pmdepmissing_t PM_DEPMISS;
@ -174,19 +174,19 @@ void *alpm_grp_getinfo(PM_GRP *grp, unsigned char parm);
/* Types */ /* Types */
enum { enum {
PM_SYSUPG_REPLACE = 1, PM_SYNC_TYPE_REPLACE = 1,
PM_SYSUPG_UPGRADE, PM_SYNC_TYPE_UPGRADE,
PM_SYSUPG_DEPEND PM_SYNC_TYPE_DEPEND
}; };
/* Info parameters */ /* Info parameters */
enum { enum {
PM_SYNC_TYPE = 1, PM_SYNC_TYPE = 1,
PM_SYNC_LOCALPKG, PM_SYNC_LOCALPKG,
PM_SYNC_SYNCPKG PM_SYNC_SYNCPKG,
PM_SYNC_REPLACES
}; };
void *alpm_sync_getinfo(PM_SYNC *sync, unsigned char parm); void *alpm_sync_getinfo(PM_SYNCPKG *sync, unsigned char parm);
int alpm_sync_sysupgrade(PM_LIST **data);
/* /*
* Transactions * Transactions
@ -234,7 +234,8 @@ enum {
PM_TRANS_TYPE = 1, PM_TRANS_TYPE = 1,
PM_TRANS_FLAGS, PM_TRANS_FLAGS,
PM_TRANS_TARGETS, PM_TRANS_TARGETS,
PM_TRANS_PACKAGES PM_TRANS_INSTALLQ,
PM_TRANS_REMOVEQ
}; };
void *alpm_trans_getinfo(unsigned char parm); void *alpm_trans_getinfo(unsigned char parm);

View File

@ -538,7 +538,7 @@ PMList* removedeps(pmdb_t *db, PMList *targs)
} }
/* populates *list with packages that need to be installed to satisfy all /* 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 * make sure *list and *trail are already initialized
*/ */

View File

@ -26,28 +26,18 @@
#include "trans.h" #include "trans.h"
#include "alpm.h" #include "alpm.h"
typedef struct __syncpkg_t { /* ORE: not used for now */ typedef struct __pmsyncpkg_t {
pmpkg_t *pkg;
pmdb_t *db;
} pmsyncpkg_t;
typedef struct __pmsync_t {
unsigned char type; unsigned char type;
pmpkg_t *lpkg; pmpkg_t *lpkg;
pmpkg_t *spkg; pmpkg_t *spkg;
pmdb_t *dbs; /* ORE: not used for now */ PMList *replaces;
} pmsync_t; } 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); 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_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_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data);
int sync_commit(pmdb_t *db, pmtrans_t *trans); int sync_commit(pmdb_t *db, pmtrans_t *trans);