(r_expr, r_name, r_version) = \
util.parse_pkgconfig_expr(requires.requires)
+ # If we get an invalid expression with no name, we
+ # do not provide this.
+ if not r_name:
+ return False
+
for provides in self.provides:
if not provides.startswith("pkgconfig("):
continue
(name, exp, version) = (None, None, None)
- m = re.match(r"^([A-Za-z0-9\-\+]+)(=|\<|\>|\>=|\<=)?([A-Za-z0-9\.\-]+)?", s)
+ m = re.match(r"^pkgconfig\(([A-Za-z0-9\.\-\+]+)\)(=|\<|\>|\>=|\<=)?([A-Za-z0-9\.\-]+)?", s)
if m:
(name, exp, version) = m.groups()
return (exp, name, version)
+def test_parse_pkgconfig_expr():
+ strings = (
+ "pkgconfig(libxml-2.0)",
+ "pkgconfig(libxml-2.0)=1.2.3",
+ "pkgconfig(libxml-2.0)>=1.2.3",
+ )
+
+ for s in strings:
+ print s, parse_pkgconfig_expr(s)
+
if __name__ == "__main__":
test_parse_pkg_expr()
+ test_parse_pkgconfig_expr()