#123 Parse features with `+` in their name
Merged 3 years ago by zbyszek. Opened 3 years ago by jstanek.
fedora-rust/ jstanek/rust2rpm master  into  master

file modified
+1 -1
@@ -112,7 +112,7 @@ 

  

  %__cargo_feature_from_name(n:) %{lua:

  local name = rpm.expand("%{-n*}")

- local feature = string.match(name, "^.+%+(.+)-devel$")

+ local feature = string.match(name, "^[^+]+%+(.+)-devel$")

  if feature == nil then

    print()

  else

If a crate has a feature with + in it's name, the %__cargo_feature_from_name macro fails to correctly parse it.
For example, the cxxbridge-flags crate declares (among others) the c++20 feature; that is currently parsed as follows:

> string.match("cxxbridge-flags+c++20-devel", "^.+%+(.+)-devel$")
20

The adjusted regex matches the first + as feature name separator:

> string.match("cxxbridge-flags+c++20-devel", "^[^+]+%+(.+)-devel$")
c++20

Pull-Request has been merged by zbyszek

3 years ago
Metadata