From 6087084fa04e3c2cbf650c6585b6cf53f5298023 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Tue, 3 Oct 2023 23:43:10 +0200 Subject: [PATCH] templates: don't use %version_no_tilde macro when %version will do This is already guarded by a check for crate version == package version, so the version string cannot contain "~" characters at this point. --- rust2rpm/templates/crate.spec | 2 +- rust2rpm/tests/samples/cxx-build-1.0.71.fedora.spec | 2 +- rust2rpm/tests/samples/cxx-build-1.0.71.mageia.spec | 2 +- rust2rpm/tests/samples/cxx-build-1.0.71.opensuse.spec | 2 +- rust2rpm/tests/samples/cxx-build-1.0.71.plain.spec | 2 +- rust2rpm/tests/samples/dotenvy-0.15.6.fedora.spec | 2 +- rust2rpm/tests/samples/dotenvy-0.15.6.mageia.spec | 2 +- rust2rpm/tests/samples/dotenvy-0.15.6.opensuse.spec | 2 +- rust2rpm/tests/samples/dotenvy-0.15.6.plain.spec | 2 +- rust2rpm/tests/samples/nix-0.24.1.fedora.spec | 2 +- rust2rpm/tests/samples/nix-0.24.1.mageia.spec | 2 +- rust2rpm/tests/samples/nix-0.24.1.opensuse.spec | 2 +- rust2rpm/tests/samples/nix-0.24.1.plain.spec | 2 +- rust2rpm/tests/samples/tokio-1.19.2.fedora.spec | 2 +- rust2rpm/tests/samples/tokio-1.19.2.mageia.spec | 2 +- rust2rpm/tests/samples/tokio-1.19.2.opensuse.spec | 2 +- rust2rpm/tests/samples/tokio-1.19.2.plain.spec | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/rust2rpm/templates/crate.spec b/rust2rpm/templates/crate.spec index 8208b3c..89d86f2 100644 --- a/rust2rpm/templates/crate.spec +++ b/rust2rpm/templates/crate.spec @@ -182,7 +182,7 @@ use {% if feature is not none %}the "{{ feature }}" feature of {% endif %}the "% %prep {% if crate_version == rpm_version %} -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 {% else %} %autosetup -n %{crate}-%{crate_version} -p1 {% endif %} diff --git a/rust2rpm/tests/samples/cxx-build-1.0.71.fedora.spec b/rust2rpm/tests/samples/cxx-build-1.0.71.fedora.spec index 98ed871..0bf486a 100644 --- a/rust2rpm/tests/samples/cxx-build-1.0.71.fedora.spec +++ b/rust2rpm/tests/samples/cxx-build-1.0.71.fedora.spec @@ -77,7 +77,7 @@ use the "parallel" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %generate_buildrequires diff --git a/rust2rpm/tests/samples/cxx-build-1.0.71.mageia.spec b/rust2rpm/tests/samples/cxx-build-1.0.71.mageia.spec index ce23fc9..347e198 100644 --- a/rust2rpm/tests/samples/cxx-build-1.0.71.mageia.spec +++ b/rust2rpm/tests/samples/cxx-build-1.0.71.mageia.spec @@ -102,7 +102,7 @@ use the "parallel" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %build diff --git a/rust2rpm/tests/samples/cxx-build-1.0.71.opensuse.spec b/rust2rpm/tests/samples/cxx-build-1.0.71.opensuse.spec index 26c9eae..0262f83 100644 --- a/rust2rpm/tests/samples/cxx-build-1.0.71.opensuse.spec +++ b/rust2rpm/tests/samples/cxx-build-1.0.71.opensuse.spec @@ -118,7 +118,7 @@ use the "parallel" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %build diff --git a/rust2rpm/tests/samples/cxx-build-1.0.71.plain.spec b/rust2rpm/tests/samples/cxx-build-1.0.71.plain.spec index e1755a8..334eb00 100644 --- a/rust2rpm/tests/samples/cxx-build-1.0.71.plain.spec +++ b/rust2rpm/tests/samples/cxx-build-1.0.71.plain.spec @@ -121,7 +121,7 @@ use the "parallel" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %build diff --git a/rust2rpm/tests/samples/dotenvy-0.15.6.fedora.spec b/rust2rpm/tests/samples/dotenvy-0.15.6.fedora.spec index 670b203..9b4da28 100644 --- a/rust2rpm/tests/samples/dotenvy-0.15.6.fedora.spec +++ b/rust2rpm/tests/samples/dotenvy-0.15.6.fedora.spec @@ -92,7 +92,7 @@ use the "cli" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %generate_buildrequires diff --git a/rust2rpm/tests/samples/dotenvy-0.15.6.mageia.spec b/rust2rpm/tests/samples/dotenvy-0.15.6.mageia.spec index 599a455..7087551 100644 --- a/rust2rpm/tests/samples/dotenvy-0.15.6.mageia.spec +++ b/rust2rpm/tests/samples/dotenvy-0.15.6.mageia.spec @@ -104,7 +104,7 @@ use the "cli" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %build diff --git a/rust2rpm/tests/samples/dotenvy-0.15.6.opensuse.spec b/rust2rpm/tests/samples/dotenvy-0.15.6.opensuse.spec index 7fdaf15..87ddb89 100644 --- a/rust2rpm/tests/samples/dotenvy-0.15.6.opensuse.spec +++ b/rust2rpm/tests/samples/dotenvy-0.15.6.opensuse.spec @@ -121,7 +121,7 @@ use the "cli" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %build diff --git a/rust2rpm/tests/samples/dotenvy-0.15.6.plain.spec b/rust2rpm/tests/samples/dotenvy-0.15.6.plain.spec index d30938f..baf843f 100644 --- a/rust2rpm/tests/samples/dotenvy-0.15.6.plain.spec +++ b/rust2rpm/tests/samples/dotenvy-0.15.6.plain.spec @@ -111,7 +111,7 @@ use the "cli" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %build diff --git a/rust2rpm/tests/samples/nix-0.24.1.fedora.spec b/rust2rpm/tests/samples/nix-0.24.1.fedora.spec index 3a28e3e..7687875 100644 --- a/rust2rpm/tests/samples/nix-0.24.1.fedora.spec +++ b/rust2rpm/tests/samples/nix-0.24.1.fedora.spec @@ -449,7 +449,7 @@ use the "zerocopy" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %generate_buildrequires diff --git a/rust2rpm/tests/samples/nix-0.24.1.mageia.spec b/rust2rpm/tests/samples/nix-0.24.1.mageia.spec index 27834e0..5fddecf 100644 --- a/rust2rpm/tests/samples/nix-0.24.1.mageia.spec +++ b/rust2rpm/tests/samples/nix-0.24.1.mageia.spec @@ -503,7 +503,7 @@ use the "zerocopy" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %build diff --git a/rust2rpm/tests/samples/nix-0.24.1.opensuse.spec b/rust2rpm/tests/samples/nix-0.24.1.opensuse.spec index f11ddc7..54a3c7d 100644 --- a/rust2rpm/tests/samples/nix-0.24.1.opensuse.spec +++ b/rust2rpm/tests/samples/nix-0.24.1.opensuse.spec @@ -520,7 +520,7 @@ use the "zerocopy" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %build diff --git a/rust2rpm/tests/samples/nix-0.24.1.plain.spec b/rust2rpm/tests/samples/nix-0.24.1.plain.spec index c61a3dd..8aad9cd 100644 --- a/rust2rpm/tests/samples/nix-0.24.1.plain.spec +++ b/rust2rpm/tests/samples/nix-0.24.1.plain.spec @@ -621,7 +621,7 @@ use the "zerocopy" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %build diff --git a/rust2rpm/tests/samples/tokio-1.19.2.fedora.spec b/rust2rpm/tests/samples/tokio-1.19.2.fedora.spec index b694b15..2217b74 100644 --- a/rust2rpm/tests/samples/tokio-1.19.2.fedora.spec +++ b/rust2rpm/tests/samples/tokio-1.19.2.fedora.spec @@ -366,7 +366,7 @@ use the "winapi" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %generate_buildrequires diff --git a/rust2rpm/tests/samples/tokio-1.19.2.mageia.spec b/rust2rpm/tests/samples/tokio-1.19.2.mageia.spec index 92fe585..5530012 100644 --- a/rust2rpm/tests/samples/tokio-1.19.2.mageia.spec +++ b/rust2rpm/tests/samples/tokio-1.19.2.mageia.spec @@ -422,7 +422,7 @@ use the "winapi" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %build diff --git a/rust2rpm/tests/samples/tokio-1.19.2.opensuse.spec b/rust2rpm/tests/samples/tokio-1.19.2.opensuse.spec index 49ccf1d..d8a3d18 100644 --- a/rust2rpm/tests/samples/tokio-1.19.2.opensuse.spec +++ b/rust2rpm/tests/samples/tokio-1.19.2.opensuse.spec @@ -439,7 +439,7 @@ use the "winapi" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %build diff --git a/rust2rpm/tests/samples/tokio-1.19.2.plain.spec b/rust2rpm/tests/samples/tokio-1.19.2.plain.spec index 6dac738..e21fc3c 100644 --- a/rust2rpm/tests/samples/tokio-1.19.2.plain.spec +++ b/rust2rpm/tests/samples/tokio-1.19.2.plain.spec @@ -540,7 +540,7 @@ use the "winapi" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %build