summaryrefslogtreecommitdiff
path: root/lib/libalpm/be_local.c
diff options
context:
space:
mode:
authorBenedikt Morbach <benedikt.morbach@googlemail.com>2011-07-18 01:54:06 +0200
committerDan McGee <dan@archlinux.org>2012-03-08 17:26:46 -0600
commite85e77e6f9f0979a16d69cd93ee6ea35583e9bfb (patch)
tree9620ed6fb2efcd866dd1cff1b7e7cdfc1846e3ea /lib/libalpm/be_local.c
parent00f29cbc14ec24f1e432eadaf35742857285a01a (diff)
downloadpacman-e85e77e6f9f0979a16d69cd93ee6ea35583e9bfb.tar.xz
Hook new optdepend structures up
No new behaviour introduced, everything should work exactly as before. Dan: refactored to use the single alpm_depend_t structure. Signed-off-by: Benedikt Morbach <benedikt.morbach@googlemail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/be_local.c')
-rw-r--r--lib/libalpm/be_local.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c
index 20b7895c..0d423fa7 100644
--- a/lib/libalpm/be_local.c
+++ b/lib/libalpm/be_local.c
@@ -611,7 +611,7 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
} else if(strcmp(line, "%DEPENDS%") == 0) {
READ_AND_SPLITDEP(info->depends);
} else if(strcmp(line, "%OPTDEPENDS%") == 0) {
- READ_AND_STORE_ALL(info->optdepends);
+ READ_AND_SPLITDEP(info->optdepends);
} else if(strcmp(line, "%CONFLICTS%") == 0) {
READ_AND_SPLITDEP(info->conflicts);
} else if(strcmp(line, "%PROVIDES%") == 0) {
@@ -829,7 +829,9 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq
if(info->optdepends) {
fputs("%OPTDEPENDS%\n", fp);
for(lp = info->optdepends; lp; lp = lp->next) {
- fprintf(fp, "%s\n", (char *)lp->data);
+ char *optstring = alpm_dep_compute_string(lp->data);
+ fprintf(fp, "%s\n", optstring);
+ free(optstring);
}
fprintf(fp, "\n");
}