1 |
commit: d7cf583b6be5b29e5607fe0d90b8f566baf65f34 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 26 13:49:05 2018 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 26 13:49:05 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d7cf583b |
7 |
|
8 |
depends: fix matching atoms for bug #668418 |
9 |
|
10 |
atoms in dependency strings can contain built-with-use declarations in |
11 |
bracket notation, so ensure we ignore that when feeding this into |
12 |
atom_explode. |
13 |
|
14 |
Bug: https://bugs.gentoo.org/668418 |
15 |
|
16 |
qatom.c | 3 ++- |
17 |
qdepends.c | 7 +++++-- |
18 |
2 files changed, 7 insertions(+), 3 deletions(-) |
19 |
|
20 |
diff --git a/qatom.c b/qatom.c |
21 |
index f079299..d7782ea 100644 |
22 |
--- a/qatom.c |
23 |
+++ b/qatom.c |
24 |
@@ -133,7 +133,8 @@ int qatom_main(int argc, char **argv) |
25 |
for (i = optind; i < argc; ++i) { |
26 |
switch (action) { |
27 |
case _COMPARE: |
28 |
- printf("%s %s %s\n", argv[i], booga[atom_compare_str(argv[i], argv[i+1])], argv[i+1]); |
29 |
+ printf("%s %s %s\n", argv[i], |
30 |
+ booga[atom_compare_str(argv[i], argv[i+1])], argv[i+1]); |
31 |
++i; |
32 |
break; |
33 |
case _EXPLODE: |
34 |
|
35 |
diff --git a/qdepends.c b/qdepends.c |
36 |
index e89216b..3ff0ebb 100644 |
37 |
--- a/qdepends.c |
38 |
+++ b/qdepends.c |
39 |
@@ -555,10 +555,13 @@ qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv) |
40 |
if (ret != 0) |
41 |
break; |
42 |
|
43 |
- /* find the boundaries for matched atom */ |
44 |
+ /* find the boundaries for matched atom, dep specifications can |
45 |
+ * include built-with-use deps using [xxx] notation, so ensure |
46 |
+ * we exclude that as part of the atom */ |
47 |
while (match.rm_so > 0 && !isspace(ptr[match.rm_so - 1])) |
48 |
match.rm_so--; |
49 |
- while (ptr[match.rm_eo] != '\0' && !isspace(ptr[match.rm_eo])) |
50 |
+ while (ptr[match.rm_eo] != '\0' && ptr[match.rm_eo] != '[' && |
51 |
+ !isspace(ptr[match.rm_eo])) |
52 |
match.rm_eo++; |
53 |
|
54 |
snprintf(qbuf, sizeof(qbuf), "%.*s", |