diff options
author | Fabian Groffen <grobian@gentoo.org> | 2019-05-11 09:13:06 +0200 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2019-05-11 09:13:06 +0200 |
commit | 0486e2a62cdce058a9a569940a93dae1f0442f1a (patch) | |
tree | e036d569473fb9898d54b0abf45f7d0c7bc4e647 | |
parent | libq/tree: allow reconstruction of atom in tree_get_atom (diff) | |
download | portage-utils-0486e2a6.tar.gz portage-utils-0486e2a6.tar.bz2 portage-utils-0486e2a6.zip |
libq/atom: split out SLOT and SUBSLOT for atom_format
it is a bit unclear whether SUBSLOT is part of SLOT or not, but PMS
doesn't allow '/' so probably it's supposed to be separate, hence split
them up, to format the former combo use %[SLOT]%[SUBSLOT]
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rw-r--r-- | libq/atom.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libq/atom.c b/libq/atom.c index 0eaee5c..5627415 100644 --- a/libq/atom.c +++ b/libq/atom.c @@ -609,7 +609,7 @@ atom_to_string_r(char *buf, size_t buflen, depend_atom *a) * %{keyword}: Always display the field that matches "keyword" or <unset> * %[keyword]: Only display the field when it's set (or pverbose) * The possible "keywords" are: - * CATEGORY P PN PV PVR PF PR SLOT REPO USE + * CATEGORY P PN PV PVR PF PR SLOT SUBSLOT REPO USE * - these are all the standard portage variables (so see ebuild(5)) * pfx - the version qualifier if set (e.g. > < = !) * sfx - the version qualifier if set (e.g. *) @@ -695,11 +695,16 @@ atom_format_r( CYAN, atom->PR_int, NORM); } else if (!strncmp("SLOT", fmt, len)) { if (showit || atom->SLOT) - append_buf(buf, buflen, "%s%s%s%s%s%s%s", + append_buf(buf, buflen, "%s%s%s%s", YELLOW, bracket == '[' ? ":" : "", atom->SLOT ? atom->SLOT : "<unset>", - atom->SUBSLOT ? "/" : "", + NORM); + } else if (!strncmp("SUBSLOT", fmt, len)) { + if (showit || atom->SUBSLOT) + append_buf(buf, buflen, "%s%s%s%s%s", + YELLOW, + bracket == '[' ? "/" : "", atom->SUBSLOT ? atom->SUBSLOT : "", atom_slotdep_str[atom->slotdep], NORM); |