queue_init(&classes);
queue_init(&pkgs);
mode = 0;
- transaction_classify(trans, &classes, mode);
+ transaction_classify(trans, mode, &classes);
for (i = 0; i < classes.count; i += 4)
{
Id class = classes.elements[i];
}
if (class == SOLVER_TRANSACTION_IGNORE)
continue;
- transaction_classify_pkgs(trans, &pkgs, mode, class, classes.elements[i + 2], classes.elements[i + 3]);
+ transaction_classify_pkgs(trans, mode, class, classes.elements[i + 2], classes.elements[i + 3], &pkgs);
*line = 0;
linel = 0;
for (j = 0; j < pkgs.count; j++)
}
void
-transaction_classify(Transaction *trans, Queue *classes, int mode)
+transaction_classify(Transaction *trans, int mode, Queue *classes)
{
Pool *pool = trans->pool;
int ntypes[SOLVER_TRANSACTION_MAXTYPE];
}
void
-transaction_classify_pkgs(Transaction *trans, Queue *pkgs, int mode, Id class, Id from, Id to)
+transaction_classify_pkgs(Transaction *trans, int mode, Id class, Id from, Id to, Queue *pkgs)
{
Pool *pool = trans->pool;
int i;
int
-transaction_order_add_choices(Transaction *trans, Queue *choices, Id chosen)
+transaction_order_add_choices(Transaction *trans, Id chosen, Queue *choices)
{
int i, j;
struct _TransactionOrderdata *od = trans->orderdata;
#define SOLVER_TRANSACTION_MAXTYPE 0x3f
-/* show modes */
+/* modes */
#define SOLVER_TRANSACTION_SHOW_ACTIVE (1 << 0)
#define SOLVER_TRANSACTION_SHOW_ALL (1 << 1)
#define SOLVER_TRANSACTION_SHOW_OBSOLETES (1 << 2)
#define SOLVER_TRANSACTION_ARCHCHANGE 0x100
#define SOLVER_TRANSACTION_VENDORCHANGE 0x101
+/* order flags */
+#define SOLVER_TRANSACTION_KEEP_ORDERDATA (1 << 0)
+
extern void transaction_init(Transaction *trans, struct _Pool *pool);
extern void transaction_free(Transaction *trans);
extern void transaction_calculate(Transaction *trans, Queue *decisionq, Map *noobsmap);
-extern void transaction_all_obs_pkgs(Transaction *trans, Id p, Queue *pkgs);
+
+/* if p is installed, returns with pkg(s) obsolete p */
+/* if p is not installed, returns with pkg(s) we obsolete */
extern Id transaction_obs_pkg(Transaction *trans, Id p);
+extern void transaction_all_obs_pkgs(Transaction *trans, Id p, Queue *pkgs);
+
+/* return step type of a transaction element */
extern Id transaction_type(Transaction *trans, Id p, int mode);
-extern void transaction_classify(Transaction *trans, Queue *classes, int mode);
-extern void transaction_classify_pkgs(Transaction *trans, Queue *pkgs, int mode, Id class, Id from, Id to);
+/* return sorted collection of all step types */
+/* classify_pkgs can be used to return all packages of a type */
+extern void transaction_classify(Transaction *trans, int mode, Queue *classes);
+extern void transaction_classify_pkgs(Transaction *trans, int mode, Id type, Id from, Id to, Queue *pkgs);
+
+/* order a transaction */
extern void transaction_order(Transaction *trans, int flags);
-extern int transaction_order_add_choices(Transaction *trans, Queue *choices, Id chosen);
+
+/* roll your own order funcion:
+ * add pkgs free for installation to queue choices after chosen was
+ * installed. start with chosen = 0
+ * needs an ordered transaction created with SOLVER_TRANSACTION_KEEP_ORDERDATA */
+extern int transaction_order_add_choices(Transaction *trans, Id chosen, Queue *choices);
+
+/* debug function, report problems found in the order */
extern void transaction_check_order(Transaction *trans);
-/* order flags */
-#define SOLVER_TRANSACTION_KEEP_ORDERDATA (1 << 0)
#ifdef __cplusplus
}