util.c: extend --print-format with "%G"
Add a new print attribute "%G" which prints groups. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
06db927a1a
commit
6968f77026
2 changed files with 12 additions and 2 deletions
|
@ -240,8 +240,9 @@ Transaction Options (apply to '-S', '-R' and '-U')
|
||||||
"%g" for base64 encoded PGP signature, "%h" for sha256sum, "%n" for
|
"%g" for base64 encoded PGP signature, "%h" for sha256sum, "%n" for
|
||||||
pkgname, "%p" for packager, "%v" for pkgver, "%l" for location, "%r"
|
pkgname, "%p" for packager, "%v" for pkgver, "%l" for location, "%r"
|
||||||
for repository, "%s" for size, "%C" for checkdepends, "%D" for depends,
|
for repository, "%s" for size, "%C" for checkdepends, "%D" for depends,
|
||||||
"%H" for conflicts, "%L" for licenses, "%M" for makedepends, "%O" for
|
"%G" for groups, "%H" for conflicts, "%L" for licenses, "%M" for
|
||||||
optional depends, "%P" for provides and "%R" for replaces.
|
makedepends, "%O" for optional depends, "%P" for provides and "%R" for
|
||||||
|
replaces.
|
||||||
Implies '\--print'.
|
Implies '\--print'.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1270,6 +1270,15 @@ void print_packages(const alpm_list_t *packages)
|
||||||
free(temp);
|
free(temp);
|
||||||
temp = string;
|
temp = string;
|
||||||
}
|
}
|
||||||
|
/* %G : groups */
|
||||||
|
if(strstr(temp, "%G")) {
|
||||||
|
alpm_list_t *lst = alpm_pkg_get_groups(pkg);
|
||||||
|
char *depends = concat_list(lst, NULL);
|
||||||
|
string = strreplace(temp, "%G", depends);
|
||||||
|
free(depends);
|
||||||
|
free(temp);
|
||||||
|
temp = string;
|
||||||
|
}
|
||||||
/* %H : conflicts */
|
/* %H : conflicts */
|
||||||
if(strstr(temp, "%H")) {
|
if(strstr(temp, "%H")) {
|
||||||
alpm_list_t *lst = alpm_pkg_get_conflicts(pkg);
|
alpm_list_t *lst = alpm_pkg_get_conflicts(pkg);
|
||||||
|
|
Loading…
Add table
Reference in a new issue