summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/be_files.c4
-rw-r--r--lib/libalpm/package.c7
2 files changed, 4 insertions, 7 deletions
diff --git a/lib/libalpm/be_files.c b/lib/libalpm/be_files.c
index 724e3c8f..4cd0985e 100644
--- a/lib/libalpm/be_files.c
+++ b/lib/libalpm/be_files.c
@@ -297,10 +297,6 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
}
_alpm_strtrim(line);
if(!strcmp(line, "%FILENAME%")) {
- /* filename is _new_ - it provides the real name of the package, on the
- * server, to allow for us to not tie the name of the actual file to the
- * data of the package
- */
if(fgets(info->filename, sizeof(info->filename), fp) == NULL) {
goto error;
}
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index 937ee3e0..363cf313 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -162,11 +162,12 @@ const char SYMEXPORT *alpm_pkg_get_filename(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(!strlen(pkg->filename)) {
/* construct the file name, it's not in the desc file */
- if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) {
- _alpm_db_read(pkg->origin_data.db, pkg, INFRQ_DESC);
- }
if(pkg->arch && strlen(pkg->arch) > 0) {
snprintf(pkg->filename, PKG_FILENAME_LEN, "%s-%s-%s" PKGEXT,
pkg->name, pkg->version, pkg->arch);