2011-07-26 13:56:55 +00:00
|
|
|
/* apk_solver.h - Alpine Package Keeper (APK)
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005-2008 Natanael Copa <n@tanael.org>
|
2013-06-11 11:06:06 +00:00
|
|
|
* Copyright (C) 2008-2013 Timo Teräs <timo.teras@iki.fi>
|
2011-07-26 13:56:55 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 as published
|
|
|
|
* by the Free Software Foundation. See http://www.gnu.org/ for details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef APK_SOLVER_H
|
|
|
|
#define APK_SOLVER_H
|
|
|
|
|
2012-02-29 09:26:12 +00:00
|
|
|
struct apk_name;
|
|
|
|
struct apk_package;
|
|
|
|
|
2011-07-26 13:56:55 +00:00
|
|
|
struct apk_change {
|
2013-06-11 11:06:06 +00:00
|
|
|
struct apk_package *old_pkg;
|
|
|
|
struct apk_package *new_pkg;
|
|
|
|
unsigned old_repository_tag : 15;
|
|
|
|
unsigned new_repository_tag : 15;
|
2012-02-16 08:50:52 +00:00
|
|
|
unsigned reinstall : 1;
|
2011-07-26 13:56:55 +00:00
|
|
|
};
|
|
|
|
APK_ARRAY(apk_change_array, struct apk_change);
|
|
|
|
|
|
|
|
struct apk_changeset {
|
2013-06-11 11:06:06 +00:00
|
|
|
int num_install, num_remove, num_adjust;
|
|
|
|
int num_total_changes;
|
2011-07-26 13:56:55 +00:00
|
|
|
struct apk_change_array *changes;
|
|
|
|
};
|
|
|
|
|
2011-09-09 13:31:11 +00:00
|
|
|
#define APK_SOLVERF_UPGRADE 0x0001
|
|
|
|
#define APK_SOLVERF_AVAILABLE 0x0002
|
|
|
|
#define APK_SOLVERF_REINSTALL 0x0004
|
2013-06-18 13:24:48 +00:00
|
|
|
#define APK_SOLVERF_LATEST 0x0008
|
2018-06-14 17:40:05 +00:00
|
|
|
#define APK_SOLVERF_IGNORE_CONFLICT 0x0010
|
2019-12-10 01:14:49 +00:00
|
|
|
#define APK_SOLVERF_IGNORE_UPGRADE 0x0020
|
2011-09-09 13:31:11 +00:00
|
|
|
|
2011-09-13 08:47:34 +00:00
|
|
|
void apk_solver_set_name_flags(struct apk_name *name,
|
2011-09-16 14:10:50 +00:00
|
|
|
unsigned short solver_flags,
|
|
|
|
unsigned short solver_flags_inheritable);
|
2011-09-09 13:31:11 +00:00
|
|
|
int apk_solver_solve(struct apk_database *db,
|
|
|
|
unsigned short solver_flags,
|
|
|
|
struct apk_dependency_array *world,
|
|
|
|
struct apk_changeset *changeset);
|
2013-06-11 11:06:06 +00:00
|
|
|
|
2011-09-09 16:41:19 +00:00
|
|
|
int apk_solver_commit_changeset(struct apk_database *db,
|
|
|
|
struct apk_changeset *changeset,
|
|
|
|
struct apk_dependency_array *world);
|
|
|
|
void apk_solver_print_errors(struct apk_database *db,
|
2013-06-11 11:06:06 +00:00
|
|
|
struct apk_changeset *changeset,
|
|
|
|
struct apk_dependency_array *world);
|
|
|
|
|
|
|
|
int apk_solver_commit(struct apk_database *db, unsigned short solver_flags,
|
2011-09-09 13:31:11 +00:00
|
|
|
struct apk_dependency_array *world);
|
2011-07-26 13:56:55 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|