From 98bcd1f5b1023b9eb219589c809fb2505079965d Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Thu, 4 Oct 2007 18:13:09 -0500 Subject: Fix -Sy and -Sp operations. When the -Sy operation failed, the lock wasn't removed because alpm_trans_release wasn't called. This is fixed now. Also, after my last change in commit 52e7e6d74733f7a431376a9e528c4fe4d3732068 , Sp didn't do anything anymore. That's because needs_transaction returned false for -Sp, so the sync transaction wasn't run. However, the current implementation of -Sp requires a sync transaction. Also, since a transaction creates the lock file at the beginning, and releases it at the end, this mean that -Sp requires root access anyway.. I think I understand now why Aaron found that the current -Sp implementation is hackish :) Signed-off-by: Chantry Xavier Signed-off-by: Aaron Griffin --- src/pacman/sync.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/pacman/sync.c') diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 78ce9b71..6a7d50e7 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -414,7 +414,8 @@ int sync_trans(alpm_list_t *targets, int sync_only) alpm_logaction("synchronizing package lists"); if(!sync_synctree(config->op_s_sync, sync_dbs)) { fprintf(stderr, _("error: failed to synchronize any databases\n")); - return(1); + retval = 1; + goto cleanup; } if(sync_only) { goto cleanup; -- cgit v1.2.3