aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2018-10-26 15:49:05 +0200
committerFabian Groffen <grobian@gentoo.org>2018-10-26 15:49:05 +0200
commitd7cf583b6be5b29e5607fe0d90b8f566baf65f34 (patch)
tree326e38074f94d8e3a2147b0af734b570f45ef17c
parentbuildsys: properly disable qglsa applet (diff)
downloadportage-utils-d7cf583b.tar.gz
portage-utils-d7cf583b.tar.bz2
portage-utils-d7cf583b.zip
depends: fix matching atoms for bug #668418
atoms in dependency strings can contain built-with-use declarations in bracket notation, so ensure we ignore that when feeding this into atom_explode. Bug: https://bugs.gentoo.org/668418
-rw-r--r--qatom.c3
-rw-r--r--qdepends.c7
2 files changed, 7 insertions, 3 deletions
diff --git a/qatom.c b/qatom.c
index f079299..d7782ea 100644
--- a/qatom.c
+++ b/qatom.c
@@ -133,7 +133,8 @@ int qatom_main(int argc, char **argv)
for (i = optind; i < argc; ++i) {
switch (action) {
case _COMPARE:
- printf("%s %s %s\n", argv[i], booga[atom_compare_str(argv[i], argv[i+1])], argv[i+1]);
+ printf("%s %s %s\n", argv[i],
+ booga[atom_compare_str(argv[i], argv[i+1])], argv[i+1]);
++i;
break;
case _EXPLODE:
diff --git a/qdepends.c b/qdepends.c
index e89216b..3ff0ebb 100644
--- a/qdepends.c
+++ b/qdepends.c
@@ -555,10 +555,13 @@ qdepends_vdb_deep_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
if (ret != 0)
break;
- /* find the boundaries for matched atom */
+ /* find the boundaries for matched atom, dep specifications can
+ * include built-with-use deps using [xxx] notation, so ensure
+ * we exclude that as part of the atom */
while (match.rm_so > 0 && !isspace(ptr[match.rm_so - 1]))
match.rm_so--;
- while (ptr[match.rm_eo] != '\0' && !isspace(ptr[match.rm_eo]))
+ while (ptr[match.rm_eo] != '\0' && ptr[match.rm_eo] != '[' &&
+ !isspace(ptr[match.rm_eo]))
match.rm_eo++;
snprintf(qbuf, sizeof(qbuf), "%.*s",