Fix for FS#15810

Skip the SyncFirst dialog, if all the -S packages are SyncFirst packages.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Nagy Gabor 2009-08-05 23:31:10 +02:00 committed by Dan McGee
parent ee43e75ed2
commit 6d00025c18

View file

@ -837,18 +837,26 @@ int pacman_sync(alpm_list_t *targets)
/* check for newer versions of packages to be upgraded first */ /* check for newer versions of packages to be upgraded first */
alpm_list_t *packages = syncfirst(); alpm_list_t *packages = syncfirst();
if(packages) { if(packages) {
printf(_(":: The following packages should be upgraded first :\n")); /* Do not ask user if all the -S targets are SyncFirst packages, see FS#15810 */
list_display(" ", packages); alpm_list_t *tmp = NULL;
if(yesno(_(":: Do you want to cancel the current operation\n" if(config->op_s_upgrade || (tmp = alpm_list_diff(targets, packages, (alpm_list_fn_cmp)strcmp))) {
":: and upgrade these packages now?"))) { alpm_list_free(tmp);
FREELIST(targs); printf(_(":: The following packages should be upgraded first :\n"));
targs = packages; list_display(" ", packages);
config->flags = 0; if(yesno(_(":: Do you want to cancel the current operation\n"
config->op_s_upgrade = 0; ":: and upgrade these packages now?"))) {
FREELIST(targs);
targs = packages;
config->flags = 0;
config->op_s_upgrade = 0;
} else {
FREELIST(packages);
}
printf("\n");
} else { } else {
pm_printf(PM_LOG_DEBUG, "skipping SyncFirst dialog\n");
FREELIST(packages); FREELIST(packages);
} }
printf("\n");
} }
} }