summaryrefslogtreecommitdiff
path: root/lib/libalpm/be_files.c
diff options
context:
space:
mode:
authorNathan Jones <nathanj@insightbb.com>2007-10-19 13:17:51 -0400
committerDan McGee <dan@archlinux.org>2007-10-19 19:21:44 -0500
commit0c2cc108d332837de4a33ca9cabe717bd414c407 (patch)
tree78e7901eedf2bf0c0d27ea3d77dff8ac9580875d /lib/libalpm/be_files.c
parent1118e00fe91125e464e8c3487f58f6000e0036b2 (diff)
downloadpacman-0c2cc108d332837de4a33ca9cabe717bd414c407.tar.xz
Add pmdelta_t structure and functions to libalpm.
Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/be_files.c')
-rw-r--r--lib/libalpm/be_files.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/libalpm/be_files.c b/lib/libalpm/be_files.c
index 2bfdb956..59155cfe 100644
--- a/lib/libalpm/be_files.c
+++ b/lib/libalpm/be_files.c
@@ -44,6 +44,7 @@
#include "error.h"
#include "handle.h"
#include "package.h"
+#include "delta.h"
/* This function is used to convert the downloaded db file to the proper backend
@@ -484,6 +485,24 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
fp = NULL;
}
+ /* DELTAS */
+ if(inforeq & INFRQ_DELTAS) {
+ snprintf(path, PATH_MAX, "%s/%s-%s/deltas", db->path, info->name, info->version);
+ if((fp = fopen(path, "r"))) {
+ while(!feof(fp)) {
+ fgets(line, 255, fp);
+ _alpm_strtrim(line);
+ if(!strcmp(line, "%DELTAS%")) {
+ while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
+ info->deltas = alpm_list_add(info->deltas, _alpm_delta_parse(line));
+ }
+ }
+ }
+ fclose(fp);
+ fp = NULL;
+ }
+ }
+
/* INSTALL */
if(inforeq & INFRQ_SCRIPTLET) {
snprintf(path, PATH_MAX, "%s/%s-%s/install", db->path, info->name, info->version);