From: "Fabian Groffen" <grobian@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/, /
Date: Wed, 1 Jan 2020 19:52:30 +0000 (UTC) [thread overview]
Message-ID: <1577908321.6d6c6c1c7c066ce642b58190c4d6df5a6e5e1a40.grobian@gentoo> (raw)
commit: 6d6c6c1c7c066ce642b58190c4d6df5a6e5e1a40
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 1 19:52:01 2020 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Jan 1 19:52:01 2020 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=6d6c6c1c
libq/dep: fix parsing of USE-deps
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
TODO.md | 3 ---
libq/dep.c | 14 +++++++++++---
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/TODO.md b/TODO.md
index cd4f2b2..191e91c 100644
--- a/TODO.md
+++ b/TODO.md
@@ -48,9 +48,6 @@
# qdepends
-- add -S/-v/-R behavior like qlist #574934
-- bring back -k? (but seems solved by using qlist -IF%{SLOT} pkg)
-- -Qt acts weird (if not, incorrect)
- -v should lookup whether packages are installed for || cases/colouring
# qpkg
diff --git a/libq/dep.c b/libq/dep.c
index 49edf10..0507326 100644
--- a/libq/dep.c
+++ b/libq/dep.c
@@ -110,7 +110,8 @@ dep_grow_tree(const char *depend)
#define _maybe_consume_word(t) \
do { \
- if (!word) break; \
+ if (word == NULL) \
+ break; \
new_node = _dep_grow_node(t, word, ptr-word); \
if (!ret) \
ret = curr_node = new_node; \
@@ -124,8 +125,8 @@ dep_grow_tree(const char *depend)
} while (0)
saw_whitespace = true;
- for (ptr = depend; *ptr; ++ptr) {
- if (isspace(*ptr)) {
+ for (ptr = depend; *ptr != '\0'; ptr++) {
+ if (isspace((int)*ptr)) {
saw_whitespace = true;
_maybe_consume_word(DEP_NORM);
continue;
@@ -185,6 +186,13 @@ dep_grow_tree(const char *depend)
curr_attach = _DEP_NEIGH;
break;
}
+ case '[': {
+ /* USE-dep, seek to matching ']', since they cannot be
+ * nested, this is simple */
+ while (*ptr != '\0' && *ptr != ']')
+ ptr++;
+ break;
+ }
default:
if (!word)
word = ptr;
next reply other threads:[~2020-01-01 19:52 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-01 19:52 Fabian Groffen [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-06-27 19:19 [gentoo-commits] proj/portage-utils:master commit in: libq/, / Fabian Groffen
2024-03-29 10:57 Fabian Groffen
2024-01-02 7:57 Fabian Groffen
2023-02-07 8:25 Fabian Groffen
2023-02-07 8:10 Fabian Groffen
2021-08-16 13:23 Fabian Groffen
2020-02-21 8:18 Fabian Groffen
2020-01-05 13:28 Fabian Groffen
2020-01-02 11:19 Fabian Groffen
2019-12-31 9:05 Fabian Groffen
2019-12-30 17:24 Fabian Groffen
2019-12-29 13:26 Fabian Groffen
2019-12-27 16:57 Fabian Groffen
2019-07-13 10:04 Fabian Groffen
2019-06-19 10:44 Fabian Groffen
2019-06-05 9:15 Fabian Groffen
2019-05-09 20:19 Fabian Groffen
2019-05-05 18:13 Fabian Groffen
2019-04-28 15:20 Fabian Groffen
2019-03-27 20:18 Fabian Groffen
2019-03-27 10:55 Fabian Groffen
2019-03-22 9:57 Fabian Groffen
2019-03-19 20:32 Fabian Groffen
2019-03-19 20:32 Fabian Groffen
2019-03-09 18:58 Fabian Groffen
2018-03-23 11:56 Fabian Groffen
2016-12-29 2:25 Mike Frysinger
2016-11-26 23:17 Mike Frysinger
2015-11-28 2:44 Mike Frysinger
2015-02-24 1:26 Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1577908321.6d6c6c1c7c066ce642b58190c4d6df5a6e5e1a40.grobian@gentoo \
--to=grobian@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox