index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Aurelien Foret <aurelien@archlinux.org> | 2006-01-18 22:37:16 +0000 |
---|---|---|
committer | Aurelien Foret <aurelien@archlinux.org> | 2006-01-18 22:37:16 +0000 |
commit | cf94007aed7eb87a38090a62b9ddf606ea1343c9 (patch) | |
tree | 828390f91f1e8510522c63d97d9c61cf443bbc24 /lib/libalpm/cache.c | |
parent | c7bcaeb7e82b9b74ab9734863827ff98db2b1fdd (diff) |
-rw-r--r-- | lib/libalpm/cache.c | 14 |
diff --git a/lib/libalpm/cache.c b/lib/libalpm/cache.c index 8c8e7669..709ba383 100644 --- a/lib/libalpm/cache.c +++ b/lib/libalpm/cache.c @@ -145,21 +145,11 @@ int db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg) pmpkg_t *db_get_pkgfromcache(pmdb_t *db, char *target) { - PMList *i; - - if(db == NULL || target == NULL || strlen(target) == 0) { + if(db == NULL) { return(NULL); } - for(i = db_get_pkgcache(db); i; i = i->next) { - pmpkg_t *info = i->data; - - if(strcmp(info->name, target) == 0) { - return(info); - } - } - - return(NULL); + return(pkg_isin(target, db_get_pkgcache(db))); } /* Returns a new group cache from db. |