@@ -87,9 +87,16 @@ int pacman_remove(alpm_list_t *targets)
}
/* Step 0: create a new transaction */
- if(trans_init(config->flags, 0) == -1) {
- return 1;
- }
+ while(1) {
+ if(trans_init(config->flags, 1) == -1) {
+ if(yesno(_("Retry?")) == 0) {
+ return 1;
+ }
+ /* Try again */
+ continue;
+ }
+ break;
+ }
/* Step 1: add targets to the created transaction */
for(i = targets; i; i = alpm_list_next(i)) {
@@ -694,9 +694,16 @@ static int sync_trans(alpm_list_t *targets)
alpm_list_t *i;
/* Step 1: create a new transaction... */
- if(trans_init(config->flags, 1) == -1) {
- return 1;
- }
+ while(1) {
+ if(trans_init(config->flags, 1) == -1) {
+ if(yesno(_("Retry?")) == 0) {
+ return 1;
+ }
+ /* Try again */
+ continue;
+ }
+ break;
+ }
/* process targets */
for(i = targets; i; i = alpm_list_next(i)) {
@@ -79,9 +79,16 @@ int pacman_upgrade(alpm_list_t *targets)
}
/* Step 1: create a new transaction */
- if(trans_init(config->flags, 1) == -1) {
- retval = 1;
- goto fail_free;
+ while(1) {
+ if(trans_init(config->flags, 1) == -1) {
+ if(yesno(_("Retry?")) == 0) {
+ retval = 1;
+ goto fail_free;
+ }
+ /* Try again */
+ continue;
+ }
+ break;
}
printf(_("loading packages...\n"));
Signed-off-by: Pedro <pedrocga1@gmail.com> --- src/pacman/remove.c | 13 ++++++++++--- src/pacman/sync.c | 13 ++++++++++--- src/pacman/upgrade.c | 13 ++++++++++--- 3 files changed, 30 insertions(+), 9 deletions(-)