summaryrefslogtreecommitdiff
path: root/src/apk_solver.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-07-26 16:56:55 +0300
committerTimo Teräs <timo.teras@iki.fi>2011-07-26 17:08:43 +0300
commit79b53d4d76bbbb4235eaf709a6f07247f47316de (patch)
tree295502ba11139d40fd1621d653b3ac43753590a9 /src/apk_solver.h
parent169cb3a97e2ef61b2087278484c8934e0d62cf3d (diff)
downloadapk-tools-79b53d4d76bbbb4235eaf709a6f07247f47316de.tar.gz
apk-tools-79b53d4d76bbbb4235eaf709a6f07247f47316de.tar.bz2
apk-tools-79b53d4d76bbbb4235eaf709a6f07247f47316de.tar.xz
apk-tools-79b53d4d76bbbb4235eaf709a6f07247f47316de.zip
solver: new package selection logic (which is not yet used)
* basic code for a backtracking, forward checking dependency satisfier * works better when there are tricky dependencies to solve (when can't just upgrade everything to most preferred versions) * the new code always evaluates all of 'world' constraints (old code just does incremental updates based on heuristics) * is probably somewhat slower than old code (probably unnoticeable difference in most cases) * makes easier to write support for provides and repository pinning * test applet and a bunch of test cases added which uses the new code * from the old feature set install_if is not yet implemented
Diffstat (limited to 'src/apk_solver.h')
-rw-r--r--src/apk_solver.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/apk_solver.h b/src/apk_solver.h
new file mode 100644
index 0000000..27e3b93
--- /dev/null
+++ b/src/apk_solver.h
@@ -0,0 +1,33 @@
+/* apk_solver.h - Alpine Package Keeper (APK)
+ *
+ * Copyright (C) 2005-2008 Natanael Copa <n@tanael.org>
+ * Copyright (C) 2008 Timo Teräs <timo.teras@iki.fi>
+ * 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
+
+struct apk_change {
+ struct apk_package *oldpkg;
+ struct apk_package *newpkg;
+};
+APK_ARRAY(apk_change_array, struct apk_change);
+
+struct apk_changeset {
+ struct apk_change_array *changes;
+};
+
+void apk_solver_sort(struct apk_database *db);
+int apk_solver_solve(struct apk_database *db, struct apk_dependency_array *world,
+ struct apk_package_array **solution);
+int apk_solver_generate_changeset(struct apk_database *db,
+ struct apk_package_array *solution,
+ struct apk_changeset *changeset);
+
+#endif
+