035e458
@@ -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:
+
%__cargo_feature_from_name
cxxbridge-flags
c++20
> 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
LGTM.
Pull-Request has been merged by zbyszek
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) thec++20
feature; that is currently parsed as follows:The adjusted regex matches the first
+
as feature name separator: