diff options
author | Aurelien Foret <aurelien@archlinux.org> | 2005-10-08 21:32:14 +0000 |
---|---|---|
committer | Aurelien Foret <aurelien@archlinux.org> | 2005-10-08 21:32:14 +0000 |
commit | 05ab859eab8dbe14f1957d0a4e64b3f005630d45 (patch) | |
tree | ac53d2941e0f924384bb7986052baa858155a767 /lib/libalpm/db.c | |
parent | 0d6a2edaa8e39f9d7b77f0a023e8a2bfdab7a16d (diff) | |
download | pacman-05ab859eab8dbe14f1957d0a4e64b3f005630d45.tar.xz |
Reworked the cache handling to only load DEPENDS info by default
Diffstat (limited to 'lib/libalpm/db.c')
-rw-r--r-- | lib/libalpm/db.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 7052d132..60850489 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -266,6 +266,12 @@ int db_read(pmdb_t *db, char *name, unsigned int inforeq, pmpkg_t *info) return(-1); } + if(info->name[0] == 0) { + if(pkg_splitname(name, info->name, info->version) == -1) { + return(-1); + } + } + /* DESC */ if(inforeq & INFRQ_DESC) { snprintf(path, PATH_MAX, "%s/%s/desc", db->path, name); @@ -279,17 +285,7 @@ int db_read(pmdb_t *db, char *name, unsigned int inforeq, pmpkg_t *info) break; } _alpm_strtrim(line); - if(!strcmp(line, "%NAME%")) { - if(fgets(info->name, sizeof(info->name), fp) == NULL) { - return(-1); - } - _alpm_strtrim(info->name); - } else if(!strcmp(line, "%VERSION%")) { - if(fgets(info->version, sizeof(info->version), fp) == NULL) { - return(-1); - } - _alpm_strtrim(info->version); - } else if(!strcmp(line, "%DESC%")) { + if(!strcmp(line, "%DESC%")) { if(fgets(info->desc, sizeof(info->desc), fp) == NULL) { return(-1); } |