diff options
author | Fabian Groffen <grobian@gentoo.org> | 2018-10-26 15:49:05 +0200 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2018-10-26 15:49:05 +0200 |
commit | d7cf583b6be5b29e5607fe0d90b8f566baf65f34 (patch) | |
tree | 326e38074f94d8e3a2147b0af734b570f45ef17c | |
parent | buildsys: properly disable qglsa applet (diff) | |
download | portage-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.c | 3 | ||||
-rw-r--r-- | qdepends.c | 7 |
2 files changed, 7 insertions, 3 deletions
@@ -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: @@ -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", |