Do not use awk's inplace feature

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
epel9
Igor Gnatenko 6 years ago
parent a71632f5f7
commit 700f417672
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C

@ -0,0 +1,30 @@
From fac21ad662a14a4f901b3365a25749b516918554 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date: Mon, 24 Jun 2019 20:27:20 +0200
Subject: [PATCH] macros: Do not use awk's inplace feature
gawk 5.x changed variable name to `inplace::suffix` but gawk 4.x does
not like that name so we can't set both.
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
---
data/macros.cargo | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/data/macros.cargo b/data/macros.cargo
index 1182850..5066587 100644
--- a/data/macros.cargo
+++ b/data/macros.cargo
@@ -89,7 +89,8 @@ if %__cargo_is_lib; then \
# Drop all dependency/features information \
# so that cargo doesn't fail resolving dependencies: \
# https://github.com/rust-lang/cargo/pull/6729 \
- %{__awk} -i inplace -v INPLACE_SUFFIX=.deps '/^\\\[((.+\\\.)?((dev|build)-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \
+ mv Cargo.toml{,.deps} \
+ awk '/^\\\[((.+\\\.)?((dev|build)-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml.deps > Cargo.toml \
%{__cargo} package -l | xargs -d '\\\n' %{__cp} --parents -a -t $REG_DIR \
%{__mv} Cargo.toml{.deps,} \
%{__cp} -a Cargo.toml $REG_DIR/Cargo.toml \
--
2.22.0

@ -5,17 +5,19 @@
Name: rust-packaging Name: rust-packaging
Version: 10 Version: 10
Release: 1%{?dist} Release: 2%{?dist}
Summary: RPM macros for building Rust packages on various architectures Summary: RPM macros for building Rust packages on various architectures
License: MIT License: MIT
URL: https://pagure.io/fedora-rust/rust2rpm URL: https://pagure.io/fedora-rust/rust2rpm
Source: https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz Source: https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
# TODO: See if we can manage to keep using inplace feature
Patch0001: 0001-macros-Do-not-use-awk-s-inplace-feature.patch
ExclusiveArch: %{rust_arches} ExclusiveArch: %{rust_arches}
# gawk is needed for stripping dev-deps in macro, 4.1.0 is needed for inplace feature # gawk is needed for stripping dev-deps in macro
Requires: gawk >= 4.1.0 Requires: gawk
Requires: python3-rust2rpm = %{?epoch:%{epoch}:}%{version}-%{release} Requires: python3-rust2rpm = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: rust-srpm-macros = %{version} Requires: rust-srpm-macros = %{version}
Requires: rust Requires: rust
@ -71,6 +73,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/ %{python3_sitelib}/rust2rpm/
%changelog %changelog
* Mon Jun 24 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 10-2
- Do not use awk's inplace feature
* Sun Jun 16 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 10-1 * Sun Jun 16 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 10-1
- Update to 10 - Update to 10

Loading…
Cancel
Save