mirror of
https://github.com/moparisthebest/pacman
synced 2024-11-15 13:55:09 -05:00
reworked transaction prototypes
This commit is contained in:
parent
31da982deb
commit
89f0ccc3cc
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
extern pmhandle_t *handle;
|
extern pmhandle_t *handle;
|
||||||
|
|
||||||
int add_loadtarget(pmdb_t *db, pmtrans_t *trans, char *name)
|
int add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
|
||||||
{
|
{
|
||||||
pmpkg_t *info, *dummy;
|
pmpkg_t *info, *dummy;
|
||||||
PMList *j;
|
PMList *j;
|
||||||
@ -116,7 +116,7 @@ error:
|
|||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int add_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data)
|
int add_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data)
|
||||||
{
|
{
|
||||||
PMList *lp;
|
PMList *lp;
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ int add_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int add_commit(pmdb_t *db, pmtrans_t *trans)
|
int add_commit(pmtrans_t *trans, pmdb_t *db)
|
||||||
{
|
{
|
||||||
int i, ret = 0, errors = 0;
|
int i, ret = 0, errors = 0;
|
||||||
TAR *tar = NULL;
|
TAR *tar = NULL;
|
||||||
@ -277,11 +277,11 @@ int add_commit(pmdb_t *db, pmtrans_t *trans)
|
|||||||
/* copy over the install reason */
|
/* copy over the install reason */
|
||||||
/* ORE?
|
/* ORE?
|
||||||
info->reason = oldpkg->reason; */
|
info->reason = oldpkg->reason; */
|
||||||
if(remove_loadtarget(db, tr, info->name) == -1) {
|
if(remove_loadtarget(tr, db, info->name) == -1) {
|
||||||
FREETRANS(tr);
|
FREETRANS(tr);
|
||||||
RET_ERR(PM_ERR_TRANS_ABORT, -1);
|
RET_ERR(PM_ERR_TRANS_ABORT, -1);
|
||||||
}
|
}
|
||||||
if(remove_commit(db, tr) == -1) {
|
if(remove_commit(tr, db) == -1) {
|
||||||
FREETRANS(tr);
|
FREETRANS(tr);
|
||||||
RET_ERR(PM_ERR_TRANS_ABORT, -1);
|
RET_ERR(PM_ERR_TRANS_ABORT, -1);
|
||||||
}
|
}
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "trans.h"
|
#include "trans.h"
|
||||||
|
|
||||||
int add_loadtarget(pmdb_t *db, pmtrans_t *trans, char *name);
|
int add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name);
|
||||||
int add_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data);
|
int add_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data);
|
||||||
int add_commit(pmdb_t *db, pmtrans_t *trans);
|
int add_commit(pmtrans_t *trans, pmdb_t *db);
|
||||||
|
|
||||||
#endif /* _ALPM_ADD_H */
|
#endif /* _ALPM_ADD_H */
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
extern pmhandle_t *handle;
|
extern pmhandle_t *handle;
|
||||||
|
|
||||||
int remove_loadtarget(pmdb_t *db, pmtrans_t *trans, char *name)
|
int remove_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
|
||||||
{
|
{
|
||||||
pmpkg_t *info;
|
pmpkg_t *info;
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ int remove_loadtarget(pmdb_t *db, pmtrans_t *trans, char *name)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int remove_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data)
|
int remove_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data)
|
||||||
{
|
{
|
||||||
pmpkg_t *info;
|
pmpkg_t *info;
|
||||||
PMList *lp;
|
PMList *lp;
|
||||||
@ -118,7 +118,7 @@ int remove_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int remove_commit(pmdb_t *db, pmtrans_t *trans)
|
int remove_commit(pmtrans_t *trans, pmdb_t *db)
|
||||||
{
|
{
|
||||||
pmpkg_t *info;
|
pmpkg_t *info;
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "trans.h"
|
#include "trans.h"
|
||||||
|
|
||||||
int remove_loadtarget(pmdb_t *db, pmtrans_t *trans, char *name);
|
int remove_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name);
|
||||||
int remove_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data);
|
int remove_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data);
|
||||||
int remove_commit(pmdb_t *db, pmtrans_t *trans);
|
int remove_commit(pmtrans_t *trans, pmdb_t *db);
|
||||||
|
|
||||||
#endif /* _ALPM_REMOVE_H */
|
#endif /* _ALPM_REMOVE_H */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user