-Sqg and -Qqg

With --quiet, "pacman -Sg grp" and "pacman -Qg grp" don't list group names.

Note that "pacman -Qgq" and "pacman -Sggq" (without targets) still list
group names becuase their output would not be very useful without them.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Nagy Gabor 2008-07-16 14:42:25 +02:00 committed by Dan McGee
parent 69f00385a9
commit 075b244be2
2 changed files with 12 additions and 3 deletions

View file

@ -235,7 +235,12 @@ static int query_group(alpm_list_t *targets)
if(grp) {
const alpm_list_t *p, *packages = alpm_grp_get_pkgs(grp);
for(p = packages; p; p = alpm_list_next(p)) {
printf("%s %s\n", grpname, alpm_pkg_get_name(alpm_list_getdata(p)));
if(!config->quiet) {
printf("%s %s\n", grpname,
alpm_pkg_get_name(alpm_list_getdata(p)));
} else {
printf("%s\n", alpm_pkg_get_name(alpm_list_getdata(p)));
}
}
} else {
pm_fprintf(stderr, PM_LOG_ERROR, _("group \"%s\" was not found\n"), grpname);

View file

@ -357,8 +357,12 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets)
if(grp) {
/* get names of packages in group */
for(k = alpm_grp_get_pkgs(grp); k; k = alpm_list_next(k)) {
if(!config->quiet) {
printf("%s %s\n", grpname,
alpm_pkg_get_name(alpm_list_getdata(k)));
} else {
printf("%s\n", alpm_pkg_get_name(alpm_list_getdata(k)));
}
}
}
}