summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Scarpino <andrea@archlinux.org>2011-03-29 17:43:07 +0200
committerDan McGee <dan@archlinux.org>2011-03-29 11:01:43 -0500
commitb6ecb2329be53ad394a33e732ee923d85a278911 (patch)
treeb1c57b4b04dcd42ad2f2f9ce29ee24b4dad9e746
parent1a8c792e8fb8ec2098553112bf02a97fdc96e06e (diff)
call alpm_option_get_localdb once in syncfirst()
Signed-off-by: Andrea Scarpino <andrea@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--src/pacman/sync.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 13b65a8f..c56934b6 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -578,10 +578,11 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets)
static alpm_list_t *syncfirst(void) {
alpm_list_t *i, *res = NULL;
+ pmdb_t *db_local = alpm_option_get_localdb();
for(i = config->syncfirst; i; i = alpm_list_next(i)) {
char *pkgname = alpm_list_getdata(i);
- pmpkg_t *pkg = alpm_db_get_pkg(alpm_option_get_localdb(), pkgname);
+ pmpkg_t *pkg = alpm_db_get_pkg(db_local, pkgname);
if(pkg == NULL) {
continue;
}