1 |
vapier 13/09/29 10:10:51 |
2 |
|
3 |
Modified: TODO qdepends.c |
4 |
Log: |
5 |
revert accidental revert |
6 |
|
7 |
Revision Changes Path |
8 |
1.15 portage-utils/TODO |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/TODO?rev=1.15&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/TODO?rev=1.15&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/TODO?r1=1.14&r2=1.15 |
13 |
|
14 |
Index: TODO |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-projects/portage-utils/TODO,v |
17 |
retrieving revision 1.14 |
18 |
retrieving revision 1.15 |
19 |
diff -u -r1.14 -r1.15 |
20 |
--- TODO 29 Sep 2013 10:07:28 -0000 1.14 |
21 |
+++ TODO 29 Sep 2013 10:10:51 -0000 1.15 |
22 |
@@ -34,6 +34,7 @@ |
23 |
- only 64bit values are supported in any individual version component |
24 |
foo-(1234)_alpha(56789) |
25 |
- these limits should not be an issue for all practical purposes |
26 |
+ - need to handle USE deps like: cat/pkg-123[foo(+)] |
27 |
|
28 |
- env vars only get expanded once, so this fails: |
29 |
ACCEPT_LICENSE="foo" |
30 |
|
31 |
|
32 |
|
33 |
1.64 portage-utils/qdepends.c |
34 |
|
35 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qdepends.c?rev=1.64&view=markup |
36 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qdepends.c?rev=1.64&content-type=text/plain |
37 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qdepends.c?r1=1.63&r2=1.64 |
38 |
|
39 |
Index: qdepends.c |
40 |
=================================================================== |
41 |
RCS file: /var/cvsroot/gentoo-projects/portage-utils/qdepends.c,v |
42 |
retrieving revision 1.63 |
43 |
retrieving revision 1.64 |
44 |
diff -u -r1.63 -r1.64 |
45 |
--- qdepends.c 29 Sep 2013 10:07:28 -0000 1.63 |
46 |
+++ qdepends.c 29 Sep 2013 10:10:51 -0000 1.64 |
47 |
@@ -1,7 +1,7 @@ |
48 |
/* |
49 |
* Copyright 2005-2013 Gentoo Foundation |
50 |
* Distributed under the terms of the GNU General Public License v2 |
51 |
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qdepends.c,v 1.63 2013/09/29 10:07:28 vapier Exp $ |
52 |
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qdepends.c,v 1.64 2013/09/29 10:10:51 vapier Exp $ |
53 |
* |
54 |
* Copyright 2005-2010 Ned Ludd - <solar@g.o> |
55 |
* Copyright 2005-2013 Mike Frysinger - <vapier@g.o> |
56 |
@@ -32,7 +32,7 @@ |
57 |
"Pretty format specified depend strings", |
58 |
COMMON_OPTS_HELP |
59 |
}; |
60 |
-static const char qdepends_rcsid[] = "$Id: qdepends.c,v 1.63 2013/09/29 10:07:28 vapier Exp $"; |
61 |
+static const char qdepends_rcsid[] = "$Id: qdepends.c,v 1.64 2013/09/29 10:10:51 vapier Exp $"; |
62 |
#define qdepends_usage(ret) usage(ret, QDEPENDS_FLAGS, qdepends_long_opts, qdepends_opts_help, lookup_applet_idx("qdepends")) |
63 |
|
64 |
static char qdep_name_only = 0; |
65 |
@@ -146,6 +146,7 @@ |
66 |
|
67 |
_q_static dep_node *dep_grow_tree(const char *depend) |
68 |
{ |
69 |
+ bool saw_whitespace; |
70 |
signed long paren_balanced; |
71 |
const char *ptr, *word; |
72 |
int curr_attach; |
73 |
@@ -175,8 +176,10 @@ |
74 |
word = NULL; \ |
75 |
} while (0) |
76 |
|
77 |
+ saw_whitespace = true; |
78 |
for (ptr = depend; *ptr; ++ptr) { |
79 |
if (isspace(*ptr)) { |
80 |
+ saw_whitespace = true; |
81 |
_maybe_consume_word(DEP_NORM); |
82 |
continue; |
83 |
} |
84 |
@@ -192,6 +195,8 @@ |
85 |
continue; |
86 |
} |
87 |
case '|': { |
88 |
+ if (!saw_whitespace) |
89 |
+ break; |
90 |
if (ptr[1] != '|') { |
91 |
warnf("Found a | but not ||"); |
92 |
goto error_out; |
93 |
@@ -203,6 +208,8 @@ |
94 |
} |
95 |
case '(': { |
96 |
++paren_balanced; |
97 |
+ if (!saw_whitespace) |
98 |
+ break; |
99 |
if (prev_type == DEP_OR || prev_type == DEP_USE) { |
100 |
_maybe_consume_word(DEP_NORM); |
101 |
prev_type = DEP_NULL; |
102 |
@@ -219,6 +226,8 @@ |
103 |
} |
104 |
case ')': { |
105 |
--paren_balanced; |
106 |
+ if (!saw_whitespace) |
107 |
+ break; |
108 |
_maybe_consume_word(DEP_NORM); |
109 |
|
110 |
if (curr_node->parent == NULL) { |
111 |
@@ -233,6 +242,7 @@ |
112 |
if (!word) |
113 |
word = ptr; |
114 |
} |
115 |
+ saw_whitespace = false; |
116 |
|
117 |
/* fall through to the paren failure below */ |
118 |
if (paren_balanced < 0) |