mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-01 17:08:08 -05:00
updated structure names (PM_SYNCPKG), and added transaction queues (install & remove)
This commit is contained in:
parent
04e054f3cb
commit
3b49720e39
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user