index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-06-16 13:15:11 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-06-22 12:31:12 -0500 |
commit | 54ef162a1a9e27e362732d873f0739bc0a2cf1bf (patch) | |
tree | e4ec6ba0ab94965c754a40d52a680f9fd69c4e37 /lib/libalpm/be_local.c | |
parent | 886a31ef205923fd5b29012ee75932a2e2dec4bd (diff) |
-rw-r--r-- | lib/libalpm/be_local.c | 12 |
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index ee28db5a..4b2a3017 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -625,9 +625,12 @@ int _alpm_local_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) } } else if(strcmp(line, "%BACKUP%") == 0) { while(fgets(line, sizeof(line), fp) && strlen(_alpm_strtrim(line))) { - char *linedup; - STRDUP(linedup, line, goto error); - info->backup = alpm_list_add(info->backup, linedup); + pmbackup_t *backup; + CALLOC(backup, 1, sizeof(pmbackup_t), goto error); + if(_alpm_split_backup(line, &backup)) { + goto error; + } + info->backup = alpm_list_add(info->backup, backup); } } } @@ -826,7 +829,8 @@ int _alpm_local_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) if(info->backup) { fprintf(fp, "%%BACKUP%%\n"); for(lp = info->backup; lp; lp = lp->next) { - fprintf(fp, "%s\n", (char *)lp->data); + pmbackup_t *backup = lp->data; + fprintf(fp, "%s\t%s\n", backup->name, backup->hash); } fprintf(fp, "\n"); } |