From 12fdce244c49133e9fce9e7356e78570dd1b4a1e Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Thu, 23 Nov 2006 02:42:50 +0000 Subject: * Move sync *after* transaction init (lock file). We don't want to stomp on the databases while another instance of pacman /could/ be reading them. --- src/pacman/sync.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/pacman/sync.c b/src/pacman/sync.c index c2313b4b..828df1fd 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -372,16 +372,6 @@ int pacman_sync(list_t *targets) return(sync_cleancache(config->op_s_clean)); } - if(config->op_s_sync) { - /* grab a fresh package list */ - MSG(NL, _(":: Synchronizing package databases...\n")); - alpm_logaction(_("synchronizing package lists")); - if(!sync_synctree(config->op_s_sync, pmc_syncs)) { - ERR(NL, _("failed to synchronize any databases")); - return(1); - } - } - if(config->op_s_search) { return(sync_search(pmc_syncs, targets)); } @@ -409,6 +399,17 @@ int pacman_sync(list_t *targets) return(1); } + if(config->op_s_sync) { + /* grab a fresh package list */ + MSG(NL, _(":: Synchronizing package databases...\n")); + alpm_logaction(_("synchronizing package lists")); + if(!sync_synctree(config->op_s_sync, pmc_syncs)) { + ERR(NL, _("failed to synchronize any databases")); + return(1); + } + } + + if(config->op_s_upgrade) { MSG(NL, _(":: Starting full system upgrade...\n")); alpm_logaction(_("starting full system upgrade")); -- cgit v1.2.3-24-g4f1b