util.c: extend --print-format with "%H"
Add a new print attribute "%H" which shows conflicts. Signed-off-by: Jelle van der Waa <jelle@archlinux.org>
This commit is contained in:
parent
909f2e86c3
commit
06db927a1a
2 changed files with 11 additions and 2 deletions
|
@ -240,8 +240,8 @@ 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,
|
||||||
"%L" for licenses, and "%M" for makedepends, "%O" for optional depends,
|
"%H" for conflicts, "%L" for licenses, "%M" for makedepends, "%O" for
|
||||||
"%P" for provides and "%R" for replaces.
|
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;
|
||||||
}
|
}
|
||||||
|
/* %H : conflicts */
|
||||||
|
if(strstr(temp, "%H")) {
|
||||||
|
alpm_list_t *lst = alpm_pkg_get_conflicts(pkg);
|
||||||
|
char *depends = concat_list(lst, (formatfn)alpm_dep_compute_string);
|
||||||
|
string = strreplace(temp, "%H", depends);
|
||||||
|
free(depends);
|
||||||
|
free(temp);
|
||||||
|
temp = string;
|
||||||
|
}
|
||||||
/* %M : makedepends */
|
/* %M : makedepends */
|
||||||
if(strstr(temp, "%M")) {
|
if(strstr(temp, "%M")) {
|
||||||
alpm_list_t *lst = alpm_pkg_get_makedepends(pkg);
|
alpm_list_t *lst = alpm_pkg_get_makedepends(pkg);
|
||||||
|
|
Loading…
Add table
Reference in a new issue