diff --git a/lib/libalpm/be_files.c b/lib/libalpm/be_files.c index d09d72a..a6087bd 100644 --- a/lib/libalpm/be_files.c +++ b/lib/libalpm/be_files.c @@ -460,12 +460,6 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) goto error; } STRDUP(info->md5sum, _alpm_strtrim(line), goto error); - } else if(strcmp(line, "%REPLACES%") == 0) { - while(fgets(line, sline, fp) && strlen(_alpm_strtrim(line))) { - char *linedup; - STRDUP(linedup, _alpm_strtrim(line), goto error); - info->replaces = alpm_list_add(info->replaces, linedup); - } } else if(strcmp(line, "%FORCE%") == 0) { info->force = 1; } @@ -528,6 +522,12 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) STRDUP(linedup, _alpm_strtrim(line), goto error); info->conflicts = alpm_list_add(info->conflicts, linedup); } + } else if(strcmp(line, "%REPLACES%") == 0) { + while(fgets(line, sline, fp) && strlen(_alpm_strtrim(line))) { + char *linedup; + STRDUP(linedup, _alpm_strtrim(line), goto error); + info->replaces = alpm_list_add(info->replaces, linedup); + } } else if(strcmp(line, "%PROVIDES%") == 0) { while(fgets(line, sline, fp) && strlen(_alpm_strtrim(line))) { char *linedup; diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 83a2fb8..387cb1b 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -387,8 +387,8 @@ alpm_list_t SYMEXPORT *alpm_pkg_get_replaces(pmpkg_t *pkg) ASSERT(handle != NULL, return(NULL)); ASSERT(pkg != NULL, return(NULL)); - if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) { - _alpm_db_read(pkg->origin_data.db, pkg, INFRQ_DESC); + if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DEPENDS)) { + _alpm_db_read(pkg->origin_data.db, pkg, INFRQ_DEPENDS); } return pkg->replaces; }