summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2009-08-08 11:23:38 -0500
committerDan McGee <dan@archlinux.org>2009-08-08 11:23:38 -0500
commit7bb9c4098b29d7bcc82ff9e9a823d2adc44cc881 (patch)
tree29ecf1b7b8762426bfcf8c1e2b36d8181c0d1605 /src
parente8806748ec6efdf62fd1210873dc2fd38cccdf2a (diff)
parent6d00025c18e837f57a4f78ee232fe3d8f244f143 (diff)
downloadpacman-7bb9c4098b29d7bcc82ff9e9a823d2adc44cc881.tar.xz
Merge branch 'maint'
Diffstat (limited to 'src')
-rw-r--r--src/pacman/sync.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 4da65400..7bfe454b 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -837,18 +837,26 @@ int pacman_sync(alpm_list_t *targets)
/* check for newer versions of packages to be upgraded first */
alpm_list_t *packages = syncfirst();
if(packages) {
- printf(_(":: The following packages should be upgraded first :\n"));
- list_display(" ", packages);
- if(yesno(_(":: Do you want to cancel the current operation\n"
- ":: and upgrade these packages now?"))) {
- FREELIST(targs);
- targs = packages;
- config->flags = 0;
- config->op_s_upgrade = 0;
+ /* Do not ask user if all the -S targets are SyncFirst packages, see FS#15810 */
+ alpm_list_t *tmp = NULL;
+ if(config->op_s_upgrade || (tmp = alpm_list_diff(targets, packages, (alpm_list_fn_cmp)strcmp))) {
+ alpm_list_free(tmp);
+ printf(_(":: The following packages should be upgraded first :\n"));
+ list_display(" ", packages);
+ if(yesno(_(":: Do you want to cancel the current operation\n"
+ ":: and upgrade these packages now?"))) {
+ FREELIST(targs);
+ targs = packages;
+ config->flags = 0;
+ config->op_s_upgrade = 0;
+ } else {
+ FREELIST(packages);
+ }
+ printf("\n");
} else {
+ pm_printf(PM_LOG_DEBUG, "skipping SyncFirst dialog\n");
FREELIST(packages);
}
- printf("\n");
}
}