query.c: simplify is_foreign
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
0c74ffd6b6
commit
53d610e0a5
1 changed files with 3 additions and 10 deletions
|
@ -343,19 +343,12 @@ static int is_foreign(alpm_pkg_t *pkg)
|
||||||
alpm_list_t *j;
|
alpm_list_t *j;
|
||||||
alpm_list_t *sync_dbs = alpm_get_syncdbs(config->handle);
|
alpm_list_t *sync_dbs = alpm_get_syncdbs(config->handle);
|
||||||
|
|
||||||
int match = 0;
|
|
||||||
for(j = sync_dbs; j; j = alpm_list_next(j)) {
|
for(j = sync_dbs; j; j = alpm_list_next(j)) {
|
||||||
alpm_db_t *db = j->data;
|
if(alpm_db_get_pkg(j->data, pkgname)) {
|
||||||
alpm_pkg_t *findpkg = alpm_db_get_pkg(db, pkgname);
|
return 0;
|
||||||
if(findpkg) {
|
|
||||||
match = 1;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(match == 0) {
|
return 1;
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int is_unrequired(alpm_pkg_t *pkg)
|
static int is_unrequired(alpm_pkg_t *pkg)
|
||||||
|
|
Loading…
Add table
Reference in a new issue