pacman: show groups once with -Sg
Only displays groups that haven't appeared yet.. Previously 'pacman -Sg' iterated over syncs, printed every group. This change does not affect '-Sgg' which still orders by sync first. To reproduce, on a current Arch Linux with [extra] and [community]: $ pacman -Sg|sort|uniq -c|sort -n [...] 1 xorg-fonts 2 vim-plugins 2 xfce4-goodies Signed-off-by: Pierre <pierre@spotify.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
b5b9860a2e
commit
0145604728
1 changed files with 6 additions and 2 deletions
|
@ -420,7 +420,7 @@ static int sync_search(alpm_list_t *syncs, alpm_list_t *targets)
|
||||||
|
|
||||||
static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets)
|
static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets)
|
||||||
{
|
{
|
||||||
alpm_list_t *i, *j, *k;
|
alpm_list_t *i, *j, *k, *s = NULL;
|
||||||
|
|
||||||
if(targets) {
|
if(targets) {
|
||||||
for(i = targets; i; i = alpm_list_next(i)) {
|
for(i = targets; i; i = alpm_list_next(i)) {
|
||||||
|
@ -456,11 +456,15 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* print grp names only, no package names */
|
/* print grp names only, no package names */
|
||||||
|
if(!alpm_list_find_str (s, grp->name)) {
|
||||||
|
s = alpm_list_add (s, grp->name);
|
||||||
printf("%s\n", grp->name);
|
printf("%s\n", grp->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
alpm_list_free(s);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue