|
Packit Service |
ff689b |
/*
|
|
Packit Service |
ff689b |
* Copyright (c) 2007-2009, Novell Inc.
|
|
Packit Service |
ff689b |
*
|
|
Packit Service |
ff689b |
* This program is licensed under the BSD license, read LICENSE.BSD
|
|
Packit Service |
ff689b |
* for further information
|
|
Packit Service |
ff689b |
*/
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/*
|
|
Packit Service |
ff689b |
* transaction.h
|
|
Packit Service |
ff689b |
*
|
|
Packit Service |
ff689b |
*/
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#ifndef LIBSOLV_TRANSACTION_H
|
|
Packit Service |
ff689b |
#define LIBSOLV_TRANSACTION_H
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#include "pooltypes.h"
|
|
Packit Service |
ff689b |
#include "queue.h"
|
|
Packit Service |
ff689b |
#include "bitmap.h"
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#ifdef __cplusplus
|
|
Packit Service |
ff689b |
extern "C" {
|
|
Packit Service |
ff689b |
#endif
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
struct s_Pool;
|
|
Packit Service |
ff689b |
struct s_DUChanges;
|
|
Packit Service |
ff689b |
struct s_TransactionOrderdata;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
typedef struct s_Transaction {
|
|
Packit Service |
ff689b |
struct s_Pool *pool; /* back pointer to pool */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
Queue steps; /* the transaction steps */
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#ifdef LIBSOLV_INTERNAL
|
|
Packit Service |
ff689b |
Queue transaction_info;
|
|
Packit Service |
ff689b |
Id *transaction_installed;
|
|
Packit Service |
ff689b |
Map transactsmap;
|
|
Packit Service |
ff689b |
Map multiversionmap;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
struct s_TransactionOrderdata *orderdata;
|
|
Packit Service |
ff689b |
#endif
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
} Transaction;
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* step types */
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_IGNORE 0x00
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_ERASE 0x10
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_REINSTALLED 0x11
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_DOWNGRADED 0x12
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_CHANGED 0x13
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_UPGRADED 0x14
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_OBSOLETED 0x15
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_INSTALL 0x20
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_REINSTALL 0x21
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_DOWNGRADE 0x22
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_CHANGE 0x23
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_UPGRADE 0x24
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_OBSOLETES 0x25
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_MULTIINSTALL 0x30
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_MULTIREINSTALL 0x31
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_MAXTYPE 0x3f
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* modes */
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_SHOW_ACTIVE (1 << 0)
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_SHOW_ALL (1 << 1)
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_SHOW_OBSOLETES (1 << 2)
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_SHOW_MULTIINSTALL (1 << 3)
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_CHANGE_IS_REINSTALL (1 << 4)
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_MERGE_VENDORCHANGES (1 << 5)
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_MERGE_ARCHCHANGES (1 << 6)
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_RPM_ONLY (1 << 7)
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_KEEP_PSEUDO (1 << 8)
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE (1 << 9)
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* extra classifications */
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_ARCHCHANGE 0x100
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_VENDORCHANGE 0x101
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* order flags */
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_KEEP_ORDERDATA (1 << 0)
|
|
Packit Service |
ff689b |
#define SOLVER_TRANSACTION_KEEP_ORDERCYCLES (1 << 1)
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* cycle severities */
|
|
Packit Service |
ff689b |
#define SOLVER_ORDERCYCLE_HARMLESS 0
|
|
Packit Service |
ff689b |
#define SOLVER_ORDERCYCLE_NORMAL 1
|
|
Packit Service |
ff689b |
#define SOLVER_ORDERCYCLE_CRITICAL 2
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
extern Transaction *transaction_create(struct s_Pool *pool);
|
|
Packit Service |
ff689b |
extern Transaction *transaction_create_decisionq(struct s_Pool *pool, Queue *decisionq, Map *multiversionmap);
|
|
Packit Service |
ff689b |
extern Transaction *transaction_create_clone(Transaction *srctrans);
|
|
Packit Service |
ff689b |
extern void transaction_free(Transaction *trans);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* if p is installed, returns with pkg(s) obsolete p */
|
|
Packit Service |
ff689b |
/* if p is not installed, returns with pkg(s) we obsolete */
|
|
Packit Service |
ff689b |
extern Id transaction_obs_pkg(Transaction *trans, Id p);
|
|
Packit Service |
ff689b |
extern void transaction_all_obs_pkgs(Transaction *trans, Id p, Queue *pkgs);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* return step type of a transaction element */
|
|
Packit Service |
ff689b |
extern Id transaction_type(Transaction *trans, Id p, int mode);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* return sorted collection of all step types */
|
|
Packit Service |
ff689b |
/* classify_pkgs can be used to return all packages of a type */
|
|
Packit Service |
ff689b |
extern void transaction_classify(Transaction *trans, int mode, Queue *classes);
|
|
Packit Service |
ff689b |
extern void transaction_classify_pkgs(Transaction *trans, int mode, Id type, Id from, Id to, Queue *pkgs);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* return all packages that will be installed after the transaction is run*/
|
|
Packit Service |
ff689b |
/* The new packages are put at the head of the queue, the number of new
|
|
Packit Service |
ff689b |
packages is returned */
|
|
Packit Service |
ff689b |
extern int transaction_installedresult(Transaction *trans, Queue *installedq);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
long long transaction_calc_installsizechange(Transaction *trans);
|
|
Packit Service |
ff689b |
void transaction_calc_duchanges(Transaction *trans, struct s_DUChanges *mps, int nmps);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* order a transaction */
|
|
Packit Service |
ff689b |
extern void transaction_order(Transaction *trans, int flags);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* roll your own order funcion:
|
|
Packit Service |
ff689b |
* add pkgs free for installation to queue choices after chosen was
|
|
Packit Service |
ff689b |
* installed. start with chosen = 0
|
|
Packit Service |
ff689b |
* needs an ordered transaction created with SOLVER_TRANSACTION_KEEP_ORDERDATA */
|
|
Packit Service |
ff689b |
extern int transaction_order_add_choices(Transaction *trans, Id chosen, Queue *choices);
|
|
Packit Service |
ff689b |
/* add obsoleted packages into transaction steps */
|
|
Packit Service |
ff689b |
extern void transaction_add_obsoleted(Transaction *trans);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* debug function, report problems found in the order */
|
|
Packit Service |
ff689b |
extern void transaction_check_order(Transaction *trans);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
/* order cycle introspection */
|
|
Packit Service |
ff689b |
extern void transaction_order_get_cycleids(Transaction *trans, Queue *q, int minseverity);
|
|
Packit Service |
ff689b |
extern int transaction_order_get_cycle(Transaction *trans, Id cid, Queue *q);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
extern void transaction_free_orderdata(Transaction *trans);
|
|
Packit Service |
ff689b |
extern void transaction_clone_orderdata(Transaction *trans, Transaction *srctrans);
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#ifdef __cplusplus
|
|
Packit Service |
ff689b |
}
|
|
Packit Service |
ff689b |
#endif
|
|
Packit Service |
ff689b |
|
|
Packit Service |
ff689b |
#endif
|