summaryrefslogtreecommitdiffstats
path: root/src/pacman/query.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-06-13 06:34:43 +0200
committerDan McGee <dan@archlinux.org>2007-06-13 07:09:02 +0200
commit620a811f9136feb332a0f196a6f9a8818368c908 (patch)
tree925bb9db310110f6d5c18009da04b6944b7f0e86 /src/pacman/query.c
parent5e774d72b0ac7777aada8271e2162d764d4f0db4 (diff)
downloadpacman-620a811f9136feb332a0f196a6f9a8818368c908.tar.gz
pacman-620a811f9136feb332a0f196a6f9a8818368c908.tar.xz
Clean up pacman/sync.c and organize it a bit
Re-add some checks for a valid target list. In addition, move variable declarations to the most local scope possible, which should help in finding errors that were previously uncaught. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/query.c')
-rw-r--r--src/pacman/query.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pacman/query.c b/src/pacman/query.c
index 0a8d8f1b..98dfc074 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -288,9 +288,10 @@ static int query_foreign(void)
alpm_list_t *sync_dbs = NULL;
alpm_list_t *i;
+ /* ensure we have at least one valid sync db set up */
sync_dbs = alpm_option_get_syncdbs();
if(sync_dbs == NULL || alpm_list_count(sync_dbs) == 0) {
- fprintf(stderr, _("error: no usable package repositories configured.\n"));
+ pm_printf(PM_LOG_ERROR, _("no usable package repositories configured.\n"));
return(1);
}