1 |
commit: 0486e2a62cdce058a9a569940a93dae1f0442f1a |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat May 11 07:13:06 2019 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat May 11 07:13:06 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=0486e2a6 |
7 |
|
8 |
libq/atom: split out SLOT and SUBSLOT for atom_format |
9 |
|
10 |
it is a bit unclear whether SUBSLOT is part of SLOT or not, but PMS |
11 |
doesn't allow '/' so probably it's supposed to be separate, hence split |
12 |
them up, to format the former combo use %[SLOT]%[SUBSLOT] |
13 |
|
14 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
15 |
|
16 |
libq/atom.c | 11 ++++++++--- |
17 |
1 file changed, 8 insertions(+), 3 deletions(-) |
18 |
|
19 |
diff --git a/libq/atom.c b/libq/atom.c |
20 |
index 0eaee5c..5627415 100644 |
21 |
--- a/libq/atom.c |
22 |
+++ b/libq/atom.c |
23 |
@@ -609,7 +609,7 @@ atom_to_string_r(char *buf, size_t buflen, depend_atom *a) |
24 |
* %{keyword}: Always display the field that matches "keyword" or <unset> |
25 |
* %[keyword]: Only display the field when it's set (or pverbose) |
26 |
* The possible "keywords" are: |
27 |
- * CATEGORY P PN PV PVR PF PR SLOT REPO USE |
28 |
+ * CATEGORY P PN PV PVR PF PR SLOT SUBSLOT REPO USE |
29 |
* - these are all the standard portage variables (so see ebuild(5)) |
30 |
* pfx - the version qualifier if set (e.g. > < = !) |
31 |
* sfx - the version qualifier if set (e.g. *) |
32 |
@@ -695,11 +695,16 @@ atom_format_r( |
33 |
CYAN, atom->PR_int, NORM); |
34 |
} else if (!strncmp("SLOT", fmt, len)) { |
35 |
if (showit || atom->SLOT) |
36 |
- append_buf(buf, buflen, "%s%s%s%s%s%s%s", |
37 |
+ append_buf(buf, buflen, "%s%s%s%s", |
38 |
YELLOW, |
39 |
bracket == '[' ? ":" : "", |
40 |
atom->SLOT ? atom->SLOT : "<unset>", |
41 |
- atom->SUBSLOT ? "/" : "", |
42 |
+ NORM); |
43 |
+ } else if (!strncmp("SUBSLOT", fmt, len)) { |
44 |
+ if (showit || atom->SUBSLOT) |
45 |
+ append_buf(buf, buflen, "%s%s%s%s%s", |
46 |
+ YELLOW, |
47 |
+ bracket == '[' ? "/" : "", |
48 |
atom->SUBSLOT ? atom->SUBSLOT : "", |
49 |
atom_slotdep_str[atom->slotdep], |
50 |
NORM); |