Skip to content

Commit

Permalink
Change default answer of all queries to yes
Browse files Browse the repository at this point in the history
This allows to use pacman completely unattended using the
--noconfirm switch which automatically accepts the default answer.

See msys2/MSYS2-packages#1141
  • Loading branch information
Ede123 authored and lazka committed Mar 2, 2023
1 parent d694a34 commit 864894b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/pacman/callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,12 @@ void cb_question(void *ctx, 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,
Expand All @@ -511,7 +511,7 @@ void cb_question(void *ctx, 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));
Expand Down
2 changes: 1 addition & 1 deletion src/pacman/remove.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pacman/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,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;
}
Expand Down

0 comments on commit 864894b

Please sign in to comment.