summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2012-12-01 00:40:46 -0500
committerAllan McRae <allan@archlinux.org>2012-12-14 12:35:34 +1000
commit53d610e0a5d39e544812c85d77a7049d6578c148 (patch)
tree180ac7d068e1c8baa8b60aabb05e3d3a1262ea37
parent0c74ffd6b6e8f96d388c1e8219902beb369bf1b8 (diff)
downloadpacman-53d610e0a5d39e544812c85d77a7049d6578c148.tar.xz
query.c: simplify is_foreign
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--src/pacman/query.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/pacman/query.c b/src/pacman/query.c
index 2736672c..72891200 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -343,19 +343,12 @@ static int is_foreign(alpm_pkg_t *pkg)
alpm_list_t *j;
alpm_list_t *sync_dbs = alpm_get_syncdbs(config->handle);
- int match = 0;
for(j = sync_dbs; j; j = alpm_list_next(j)) {
- alpm_db_t *db = j->data;
- alpm_pkg_t *findpkg = alpm_db_get_pkg(db, pkgname);
- if(findpkg) {
- match = 1;
- break;
+ if(alpm_db_get_pkg(j->data, pkgname)) {
+ return 0;
}
}
- if(match == 0) {
- return 1;
- }
- return 0;
+ return 1;
}
static int is_unrequired(alpm_pkg_t *pkg)