summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-03-21 13:53:13 +0100
committerDan McGee <dan@archlinux.org>2011-03-21 13:53:13 +0100
commit0ff52b68452046d61c24649ec94886bd74faab45 (patch)
treea9960a6143d17aeedeb530f2fe57c6796966e205 /src
parentc67c864ffd50ec0e071b055897c4622eaa132fc2 (diff)
parentb0bb4f9024712adcee5e2baf6cebe73c966d7d7f (diff)
downloadpacman-0ff52b68452046d61c24649ec94886bd74faab45.tar.gz
pacman-0ff52b68452046d61c24649ec94886bd74faab45.tar.xz
Merge branch 'maint'
Conflicts due to change in return calling style. Conflicts: src/pacman/pacman.c src/pacman/sync.c
Diffstat (limited to 'src')
-rw-r--r--src/pacman/pacman.c18
-rw-r--r--src/pacman/sync.c40
2 files changed, 34 insertions, 24 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 6d377d2e..e4555c03 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -740,7 +740,8 @@ static int parseargs(int argc, char *argv[])
} else if(opt == '?') {
/* this should have failed during first pass already */
return 1;
- } else if(parsearg_op(opt, 1) == 0) { /* opt is an operation */
+ } else if(parsearg_op(opt, 1) == 0) {
+ /* opt is an operation */
continue;
}
@@ -757,18 +758,17 @@ static int parseargs(int argc, char *argv[])
case PM_OP_SYNC:
result = parsearg_sync(opt);
break;
- case PM_OP_DEPTEST:
- result = 1;
- break;
case PM_OP_UPGRADE:
result = parsearg_upgrade(opt);
break;
+ case PM_OP_DEPTEST:
default:
- pm_printf(PM_LOG_ERROR, _("no operation specified (use -h for help)\n"));
- return 1;
+ result = 1;
+ break;
}
- if (result == 0)
+ if (result == 0) {
continue;
+ }
/* fall back to global options */
result = parsearg_global(opt);
@@ -1230,9 +1230,7 @@ static int _parseconfig(const char *file, const char *givensection,
}
cleanup:
- if(fp) {
- fclose(fp);
- }
+ fclose(fp);
if(section){
free(section);
}
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 9f6c3e09..b12206c4 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;
}