This allows to use pacman completely unattended using the --noconfirm switch which automatically accepts the default answer. Fixes #1141
73 lines
2.7 KiB
Diff
73 lines
2.7 KiB
Diff
From 09ad07d05d61d3c15409eae9297493d633aaeecd Mon Sep 17 00:00:00 2001
|
|
From: Eduard Braun <eduard.braun2@gmx.de>
|
|
Date: Sat, 10 Feb 2018 22:39:35 +0100
|
|
Subject: [PATCH] Change default answer of all queries to yes
|
|
|
|
This allows to use pacman completely unattended using the
|
|
--noconfirm switch which automatically accepts the default answer.
|
|
|
|
See https://github.com/Alexpux/MSYS2-packages/issues/1141
|
|
---
|
|
src/pacman/callback.c | 6 +++---
|
|
src/pacman/remove.c | 2 +-
|
|
src/pacman/sync.c | 2 +-
|
|
3 files changed, 5 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/src/pacman/callback.c b/src/pacman/callback.c
|
|
index c1679e37..cbb01092 100644
|
|
--- a/src/pacman/callback.c
|
|
+++ b/src/pacman/callback.c
|
|
@@ -416,12 +416,12 @@ void cb_question(alpm_question_t *question)
|
|
/* print conflict only if it contains new information */
|
|
if(strcmp(q->conflict->package1, q->conflict->reason->name) == 0
|
|
|| strcmp(q->conflict->package2, q->conflict->reason->name) == 0) {
|
|
- q->remove = noyes(_("%s and %s are in conflict. Remove %s?"),
|
|
+ q->remove = yesno(_("%s and %s are in conflict. Remove %s?"),
|
|
q->conflict->package1,
|
|
q->conflict->package2,
|
|
q->conflict->package2);
|
|
} else {
|
|
- q->remove = noyes(_("%s and %s are in conflict (%s). Remove %s?"),
|
|
+ q->remove = yesno(_("%s and %s are in conflict (%s). Remove %s?"),
|
|
q->conflict->package1,
|
|
q->conflict->package2,
|
|
q->conflict->reason->name,
|
|
@@ -445,7 +445,7 @@ void cb_question(alpm_question_t *question)
|
|
count));
|
|
list_display(" ", namelist, getcols());
|
|
printf("\n");
|
|
- q->skip = noyes(_n(
|
|
+ q->skip = yesno(_n(
|
|
"Do you want to skip the above package for this upgrade?",
|
|
"Do you want to skip the above packages for this upgrade?",
|
|
count));
|
|
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
|
|
index 73b48c36..a25d73af 100644
|
|
--- a/src/pacman/remove.c
|
|
+++ b/src/pacman/remove.c
|
|
@@ -146,7 +146,7 @@ int pacman_remove(alpm_list_t *targets)
|
|
holdpkg = 1;
|
|
}
|
|
}
|
|
- if(holdpkg && (noyes(_("HoldPkg was found in target list. Do you want to continue?")) == 0)) {
|
|
+ if(holdpkg && (yesno(_("HoldPkg was found in target list. Do you want to continue?")) == 0)) {
|
|
retval = 1;
|
|
goto cleanup;
|
|
}
|
|
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
|
|
index 0f41fad9..62749aae 100644
|
|
--- a/src/pacman/sync.c
|
|
+++ b/src/pacman/sync.c
|
|
@@ -194,7 +194,7 @@ static int sync_cleancache(int level)
|
|
}
|
|
printf(_("removing old packages from cache...\n"));
|
|
} else {
|
|
- if(!noyes(_("Do you want to remove ALL files from cache?"))) {
|
|
+ if(!yesno(_("Do you want to remove ALL files from cache?"))) {
|
|
printf("\n");
|
|
continue;
|
|
}
|
|
--
|
|
2.16.1.windows.4
|
|
|