summaryrefslogtreecommitdiff
path: root/lib/libalpm/delta.h
diff options
context:
space:
mode:
authorChantry Xavier <shiningxc@gmail.com>2008-02-16 10:47:22 -0600
committerDan McGee <dan@archlinux.org>2008-04-26 11:36:01 -0500
commit701a03dcdb113e92b4f8de52a7a427dfdfc3dd27 (patch)
tree670bae62f1dce6ea8c22a7afa9f5ba79aa4f1573 /lib/libalpm/delta.h
parent30bdf94c2b444ff475a32e7b0c569e8c3cf05797 (diff)
downloadpacman-701a03dcdb113e92b4f8de52a7a427dfdfc3dd27.tar.xz
Completely rework delta algorithm
Using the graph structures that Nagy set up for dependency sorting, we now do a similar process for deltas. Load up all of the deltas into a graph object on which we can then apply Dijkstra's algorithm, using the new weight field of graph struct. We initialize the nodes weight using the base files that we can use in our filecache (both filename and md5sum must match). The algorithm then picks the best path among those that can be resolved. Note that this algorithm has a few advantages over the old one: 1. It is completely file agnostic. These delta chains do not have to consist of package files- this could be adopted to do delta-fied DBs. 2. It does not use the local_db anymore, or even care if a package or file is currently installed. Instead, it only looks in the filecache for files and packages that match delta chain entries. Original-work-by: Dan McGee <dan@archlinux.org> Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Diffstat (limited to 'lib/libalpm/delta.h')
-rw-r--r--lib/libalpm/delta.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libalpm/delta.h b/lib/libalpm/delta.h
index a2ac5f05..33d47e1e 100644
--- a/lib/libalpm/delta.h
+++ b/lib/libalpm/delta.h
@@ -36,14 +36,14 @@ struct __pmdelta_t {
char *delta_md5;
/** filesize of the delta file */
unsigned long delta_size;
+ /** download filesize of the delta file */
+ unsigned long download_size;
};
-unsigned long _alpm_delta_path_size(alpm_list_t *deltas);
-unsigned long _alpm_delta_path_size_uncached(alpm_list_t *deltas);
pmdelta_t *_alpm_delta_parse(char *line);
void _alpm_delta_free(pmdelta_t *delta);
-alpm_list_t *_alpm_shortest_delta_path(alpm_list_t *deltas,
- const char *from, const char *to);
+unsigned long _alpm_shortest_delta_path(alpm_list_t *deltas,
+ const char *to, const char *to_md5, alpm_list_t **path);
#endif /* _ALPM_DELTA_H */