diff options
author | Allan McRae <allan@archlinux.org> | 2011-03-21 13:29:37 +1000 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-03-21 07:43:55 -0500 |
commit | b0bb4f9024712adcee5e2baf6cebe73c966d7d7f (patch) | |
tree | b8c3d653e0d18c89b5daa1a8b91ef9ccb7d9b29b | |
parent | 9cab9807e02674fd5a7efcea2a408c70c1f9d40c (diff) |
Do not query group selection when using -Sp
Remove unnecessary output when using -Sp. Fixes FS#23340.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | src/pacman/sync.c | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 29bcf540..13b65a8f 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -637,25 +637,37 @@ static int process_group(alpm_list_t *dbs, char *group) return(1); } - printf(_(":: There are %d members in group %s:\n"), count, - group); - select_display(pkgs); - char *array = malloc(count); - multiselect_question(array, count); - int n = 0; - for(i = pkgs; i; i = alpm_list_next(i)) { - if(array[n++] == 0) - continue; - pmpkg_t *pkg = alpm_list_getdata(i); - if(process_pkg(pkg) == 1) { - ret = 1; - goto cleanup; + if(config->print == 0) { + printf(_(":: There are %d members in group %s:\n"), count, + group); + select_display(pkgs); + char *array = malloc(count); + multiselect_question(array, count); + int n = 0; + for(i = pkgs; i; i = alpm_list_next(i)) { + if(array[n++] == 0) + continue; + pmpkg_t *pkg = alpm_list_getdata(i); + + if(process_pkg(pkg) == 1) { + ret = 1; + free(array); + goto cleanup; + } + } + } else { + for(i = pkgs; i; i = alpm_list_next(i)) { + pmpkg_t *pkg = alpm_list_getdata(i); + + if(process_pkg(pkg) == 1) { + ret = 1; + goto cleanup; + } } } cleanup: alpm_list_free(pkgs); - free(array); return(ret); } |