Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/be_files.c
diff options
context:
space:
mode:
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);