From 0c2cc108d332837de4a33ca9cabe717bd414c407 Mon Sep 17 00:00:00 2001 From: Nathan Jones Date: Fri, 19 Oct 2007 13:17:51 -0400 Subject: Add pmdelta_t structure and functions to libalpm. Signed-off-by: Nathan Jones Signed-off-by: Dan McGee --- lib/libalpm/be_files.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/libalpm/be_files.c') 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); -- cgit v1.2.3-54-g00ecf