summaryrefslogtreecommitdiff
path: root/src/apk_solver_data.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-06-11 14:06:06 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-06-13 18:22:00 +0300
commitb8c44536ca911418fee1c9ab4eecbb913a1ca852 (patch)
treea89e68b12f4d3daf089c475beeb71c53ffb8cc3a /src/apk_solver_data.h
parentf292a858677ae0e1af8910ffbd4b338f4b36c18b (diff)
downloadapk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.tar.gz
apk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.tar.bz2
apk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.tar.xz
apk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.zip
solver: rewrite as deductive solver -- core features
Implementing basic dependency handling, install_if and awareness of pinning.
Diffstat (limited to 'src/apk_solver_data.h')
-rw-r--r--src/apk_solver_data.h48
1 files changed, 21 insertions, 27 deletions
diff --git a/src/apk_solver_data.h b/src/apk_solver_data.h
index 8076a08..913829f 100644
--- a/src/apk_solver_data.h
+++ b/src/apk_solver_data.h
@@ -16,39 +16,33 @@
#include "apk_defines.h"
#include "apk_provider_data.h"
-struct apk_score {
- uint32_t unsatisfied;
- uint32_t non_preferred_actions;
- uint32_t non_preferred_pinnings;
- uint32_t preference;
-};
-
struct apk_solver_name_state {
- /* dynamic */
- struct list_head unsolved_list;
- struct apk_score minimum_penalty;
+ struct list_head dirty_list;
+ struct list_head unresolved_list;
struct apk_provider chosen;
- unsigned int last_touched_decision;
- unsigned short requirers;
- unsigned short install_ifs;
- unsigned short preferred_pinning;
- unsigned short locked;
+ unsigned int preferred_pinning;
- /* one time prepare/finish flags */
- unsigned solver_flags_local : 4;
- unsigned solver_flags_inheritable : 4;
-
- unsigned decision_counted : 1;
- unsigned originally_installed : 1;
- unsigned has_available_pkgs : 1;
- unsigned in_changeset : 1;
+ unsigned short requirers;
+ unsigned short merge_index;
+ unsigned short max_dep_chain;
+ unsigned seen : 1;
unsigned in_world_dependency : 1;
+ unsigned in_changeset : 1;
+ unsigned reevaluate_deps : 1;
+ unsigned reevaluate_iif : 1;
+ unsigned locked : 1;
+ unsigned has_iif : 1;
+ unsigned has_options : 1;
+};
- /* dynamic state flags */
- unsigned none_excluded : 1;
- unsigned name_touched : 1;
- unsigned preferred_chosen : 1;
+struct apk_solver_package_state {
+ unsigned short conflicts;
+ unsigned seen : 1;
+ unsigned available : 1;
+ unsigned in_changeset : 1;
+ unsigned iif_triggered : 1;
+ unsigned max_dep_chain : 10;
};
#endif