From fbf1aa653984be4a15714a0efe3acf756daf2d57 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Thu, 2 Nov 2006 02:29:10 +0000 Subject: * Fixed some alpm_get_option calls (long params were used for C99 compliance, but were used in error) * Cleaned up some output newlines * Added "local database is up to date" when no packages are upgraded --- src/pacman/sync.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/pacman/sync.c') diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 012a7604..1d1ea29d 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -173,13 +173,18 @@ static int sync_synctree(int level, list_t *syncs) } else { ERR(NL, _("failed to update %s (%s)\n"), sync->treename, alpm_strerror(pm_errno)); } - success--; } else if(ret == 1) { MSG(NL, _(" %s is up to date\n"), sync->treename); + } else { + success++; } } - return(success); + /* We should always succeed if at least one DB was upgraded - we may possibly + * fail later with unresolved deps, but that should be rare, and would be + * expected + */ + return(success > 0); } static int sync_search(list_t *syncs, list_t *targets) @@ -569,6 +574,7 @@ int pacman_sync(list_t *targets) packages = alpm_trans_getinfo(PM_TRANS_PACKAGES); if(packages == NULL) { /* nothing to do: just exit without complaining */ + MSG(NL," local database is up to date"); goto cleanup; } -- cgit v1.2.3