Merge branch 'installed-info-to-Sg' into 'master'
Add [installed] information to -Sg/-Sgg output See merge request pacman/pacman!44
This commit is contained in:
commit
9fb7ca55bc
4 changed files with 38 additions and 14 deletions
|
@ -353,10 +353,10 @@ Query Options (apply to '-Q')[[QO]]
|
|||
pacman's output is processed in a script. Search will only show package
|
||||
names and not version, group, and description information; owns will
|
||||
only show package names instead of "file is owned by pkg" messages; group
|
||||
will only show package names and omit group names; list will only show
|
||||
files and omit package names; check will only show pairs of package names
|
||||
and missing files; a bare query will only show package names
|
||||
rather than names and versions.
|
||||
will only show package names and omit group names and package versions;
|
||||
list will only show files and omit package names; check will only show
|
||||
pairs of package names and missing files; a bare query will only show
|
||||
package names rather than names and versions.
|
||||
|
||||
*-s, \--search* <regexp>::
|
||||
Search each locally-installed package for names or descriptions that
|
||||
|
@ -436,7 +436,7 @@ linkman:pacman.conf[5].
|
|||
pacman's output is processed in a script. Search will only show package
|
||||
names and not repository, version, group, and description information; list
|
||||
will only show package names and omit databases and versions; group will
|
||||
only show package names and omit group names.
|
||||
only show package names and omit group names and package versions.
|
||||
|
||||
*-s, \--search* <regexp>::
|
||||
This will search each package in the sync databases for names or
|
||||
|
|
|
@ -322,7 +322,7 @@ _pacman_completions_all_packages() {
|
|||
_pacman_completions_installed_groups() {
|
||||
local -a cmd groups
|
||||
_pacman_get_command
|
||||
groups=(${(o)${(f)"$(_call_program groups $cmd[@] -Qg)"}% *})
|
||||
groups=(${(o)${(f)"$(_call_program groups $cmd[@] -Qg)"}%% *})
|
||||
typeset -U groups
|
||||
compadd "$@" -a groups
|
||||
}
|
||||
|
|
|
@ -352,9 +352,10 @@ static int display(alpm_pkg_t *pkg)
|
|||
static int query_group(alpm_list_t *targets)
|
||||
{
|
||||
alpm_list_t *i, *j;
|
||||
alpm_db_t *db_local = alpm_get_localdb(config->handle);
|
||||
const colstr_t *colstr = &config->colstr;
|
||||
const char *grpname = NULL;
|
||||
int ret = 0;
|
||||
alpm_db_t *db_local = alpm_get_localdb(config->handle);
|
||||
|
||||
if(targets == NULL) {
|
||||
for(j = alpm_db_get_groupcache(db_local); j; j = alpm_list_next(j)) {
|
||||
|
@ -366,7 +367,14 @@ static int query_group(alpm_list_t *targets)
|
|||
if(!filter(pkg)) {
|
||||
continue;
|
||||
}
|
||||
printf("%s %s\n", grp->name, alpm_pkg_get_name(pkg));
|
||||
if(!config->quiet) {
|
||||
printf("%s%s %s%s %s%s%s\n", colstr->groups, grp->name,
|
||||
colstr->title, alpm_pkg_get_name(pkg),
|
||||
colstr->version, alpm_pkg_get_version(pkg),
|
||||
colstr->nocolor);
|
||||
} else {
|
||||
printf("%s\n", alpm_pkg_get_name(pkg));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -381,8 +389,10 @@ static int query_group(alpm_list_t *targets)
|
|||
continue;
|
||||
}
|
||||
if(!config->quiet) {
|
||||
printf("%s %s\n", grpname,
|
||||
alpm_pkg_get_name(p->data));
|
||||
printf("%s%s %s%s %s%s%s\n", colstr->groups, grpname,
|
||||
colstr->title, alpm_pkg_get_name(p->data),
|
||||
colstr->version, alpm_pkg_get_version(p->data),
|
||||
colstr->nocolor);
|
||||
} else {
|
||||
printf("%s\n", alpm_pkg_get_name(p->data));
|
||||
}
|
||||
|
|
|
@ -339,6 +339,8 @@ 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)
|
||||
{
|
||||
alpm_list_t *i, *j, *k, *s = NULL;
|
||||
alpm_db_t *db_local = alpm_get_localdb(config->handle);
|
||||
const colstr_t *colstr = &config->colstr;
|
||||
int ret = 0;
|
||||
|
||||
if(targets) {
|
||||
|
@ -355,8 +357,12 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets)
|
|||
/* get names of packages in group */
|
||||
for(k = grp->packages; k; k = alpm_list_next(k)) {
|
||||
if(!config->quiet) {
|
||||
printf("%s %s\n", grpname,
|
||||
alpm_pkg_get_name(k->data));
|
||||
printf("%s%s %s%s %s%s%s", colstr->groups, grpname,
|
||||
colstr->title, alpm_pkg_get_name(k->data),
|
||||
colstr->version, alpm_pkg_get_version(k->data),
|
||||
colstr->nocolor);
|
||||
print_installed(db_local, k->data);
|
||||
printf("\n");
|
||||
} else {
|
||||
printf("%s\n", alpm_pkg_get_name(k->data));
|
||||
}
|
||||
|
@ -378,8 +384,16 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets)
|
|||
|
||||
if(level > 1) {
|
||||
for(k = grp->packages; k; k = alpm_list_next(k)) {
|
||||
printf("%s %s\n", grp->name,
|
||||
alpm_pkg_get_name(k->data));
|
||||
if(!config->quiet) {
|
||||
printf("%s%s %s%s %s%s%s", colstr->groups, grp->name,
|
||||
colstr->title, alpm_pkg_get_name(k->data),
|
||||
colstr->version, alpm_pkg_get_version(k->data),
|
||||
colstr->nocolor);
|
||||
print_installed(db_local, k->data);
|
||||
printf("\n");
|
||||
} else {
|
||||
printf("%s\n", alpm_pkg_get_name(k->data));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* print grp names only, no package names */
|
||||
|
|
Loading…
Add table
Reference in a new issue