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 May 5, 2024
1 parent 8bdcffb commit bb871d9
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 @@ -467,7 +467,7 @@ void cb_question(void *ctx, alpm_question_t *question)
/* print conflict only if it contains new information */
if(strcmp(alpm_pkg_get_name(q->conflict->package1), q->conflict->reason->name) == 0
|| strcmp(alpm_pkg_get_name(q->conflict->package2), q->conflict->reason->name) == 0) {
q->remove = noyes(_("%s-%s%s%s and %s-%s%s%s are in conflict. Remove %s?"),
q->remove = yesno(_("%s-%s%s%s and %s-%s%s%s are in conflict. Remove %s?"),
alpm_pkg_get_name(q->conflict->package1),
colstr->faint,
alpm_pkg_get_version(q->conflict->package1),
Expand All @@ -478,7 +478,7 @@ void cb_question(void *ctx, alpm_question_t *question)
colstr->nocolor,
alpm_pkg_get_name(q->conflict->package2));
} else {
q->remove = noyes(_("%s-%s%s%s and %s-%s%s%s are in conflict (%s). Remove %s?"),
q->remove = yesno(_("%s-%s%s%s and %s-%s%s%s are in conflict (%s). Remove %s?"),
alpm_pkg_get_name(q->conflict->package1),
colstr->faint,
alpm_pkg_get_version(q->conflict->package1),
Expand Down Expand Up @@ -508,7 +508,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 @@ -199,7 +199,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 bb871d9

Please sign in to comment.