summaryrefslogtreecommitdiffstats
path: root/src/apk_state.h
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-04-14 18:48:02 +0300
committerTimo Teras <timo.teras@iki.fi>2009-04-14 18:48:02 +0300
commita23f6f4afb0f819c6c478975df41e235e8d0953a (patch)
tree41e30626def437dc13ecea54afbb2cb6765f5d37 /src/apk_state.h
parent7cef96c30d2f2d585aa2edd7b6ab22e9e007cddc (diff)
state: rework changeset calculation algorithm
Calculate changesets directly by stabilizating the package graph instead of recalculating the whole graph and then diffing (similar approach as seen in 'smart' package manager). The algorithm is not complete: defferred search space forking is missing. So you don't always get a solution on complex graphs. Benefits: - usually the search state tree is smaller (less memory used) - speed relational to changeset size, not database size (usually faster) - touch only packages related to users request (can work on partitially broken state; upgrades only necessary packages, fixes #7) Also implemented: - command prompt to confirm operation if packages are deleted or downgraded - requesting deletion of package suggests removal of all packages depending on the package being removed (you'll get list of packages that also get removed if you want package X removed) - option --simulate to see what would have been done (mainly for testing) - an untested implementation of versioned dependencies and conflicts A lot has changed, so expect new bugs too.
Diffstat (limited to 'src/apk_state.h')
-rw-r--r--src/apk_state.h38
1 files changed, 6 insertions, 32 deletions
diff --git a/src/apk_state.h b/src/apk_state.h
index d89af98..d065411 100644
--- a/src/apk_state.h
+++ b/src/apk_state.h
@@ -14,43 +14,17 @@
#include "apk_database.h"
-#define APK_STATE_NOT_CONSIDERED 0
-#define APK_STATE_INSTALL 1
-#define APK_STATE_NO_INSTALL 2
-
-struct apk_change {
- struct list_head change_list;
- struct apk_package *oldpkg;
- struct apk_package *newpkg;
-};
-
-struct apk_state {
- int refs;
- struct list_head change_list_head;
- unsigned char bitarray[];
-};
-
-struct apk_deferred_state {
- unsigned int preference;
- struct apk_package *deferred_install;
- /* struct apk_pkg_name_queue *install_queue; */
- struct apk_state *state;
-};
+struct apk_state;
struct apk_state *apk_state_new(struct apk_database *db);
struct apk_state *apk_state_dup(struct apk_state *state);
void apk_state_unref(struct apk_state *state);
int apk_state_commit(struct apk_state *state, struct apk_database *db);
-
-int apk_state_satisfy_deps(struct apk_state *state,
- struct apk_dependency_array *deps);
-int apk_state_purge_unneeded(struct apk_state *state,
- struct apk_database *db);
-
-int apk_state_pkg_install(struct apk_state *state,
- struct apk_package *pkg);
-int apk_state_pkg_is_installed(struct apk_state *state,
- struct apk_package *pkg);
+int apk_state_lock_dependency(struct apk_state *state,
+ struct apk_dependency *dep);
+int apk_state_lock_name(struct apk_state *state,
+ struct apk_name *name,
+ struct apk_package *newpkg);
#endif