#16 respect %crate_version macro in both %crates_source and %crate_instdir
Merged by decathorpe. Opened by decathorpe.
Unknown source main

Download 16.patch

This PR contains two commits that change two macros to respect the %crate_version macro set by recent versions of rust2rpm:

  • %crates_source: respect %crate_version without having to supply it as an argument manually, and simplify code (the %real_crate macro is not used anywhere in the Rust RPM macros or in Fedora packages)
  • %crate_instdir: rely on %crate_version if it is defined, fall back to %version if it is not defined. This removes the last usage of the %version_no_tilde macro in the Rust macros, in preparation to have rust2rpm no longer use it when generating spec files for Rust crates, and for the macro definition to be moved to another project.

Fixes https://pagure.io/fedora-rust/rust-packaging/issue/15

-     version = version:gsub('~', '-')

looks like a breaking change. Packages that have a %{version} with the - replaced with a ~ and don't set %cargo_version will break.

It is, but recent versions of rust2rpm no longer generate specs that rely on this behavior. I intended to regenerate any packages that would be affected (the number should be quite small, since this only affects pre-releases, and we don't package pre-releases unless absolutely necessary).

I mean, I can keep the replacement for backwards compatibility, it is a noop in 99.9% of cases ...

2 new commits added

  • %crates_source: respect %crate_version if defined and simplify lua code
  • %crate_instdir: stop depending on the version_no_tilde macro

Pull-Request has been merged by decathorpe

Metadata