diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bee1df3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/version-sync-0.8.1.crate diff --git a/0001-chore-Update-pulldown-cmark-to-0.7.patch b/0001-chore-Update-pulldown-cmark-to-0.7.patch new file mode 100644 index 0000000..d53747d --- /dev/null +++ b/0001-chore-Update-pulldown-cmark-to-0.7.patch @@ -0,0 +1,32 @@ +From 4f9abc6a9c2f4918a445f8217a07849eb42f4bca Mon Sep 17 00:00:00 2001 +From: Igor Raits +Date: Sat, 22 Feb 2020 19:11:32 +0100 +Subject: [PATCH] chore: Update pulldown-cmark to 0.7 + +Signed-off-by: Igor Raits +--- + src/markdown_deps.rs | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/markdown_deps.rs b/src/markdown_deps.rs +index a557c1c..01c45b3 100644 +--- a/src/markdown_deps.rs ++++ b/src/markdown_deps.rs +@@ -1,4 +1,4 @@ +-use pulldown_cmark::{Event, Parser, Tag}; ++use pulldown_cmark::{CodeBlockKind, Event, Parser, Tag}; + use semver_parser::range::parse as parse_request; + use semver_parser::range::VersionReq; + use semver_parser::version::parse as parse_version; +@@ -63,7 +63,7 @@ fn find_toml_blocks(text: &str) -> Vec> { + let mut code_blocks = Vec::new(); + for (event, range) in parser.into_offset_iter() { + match event { +- Event::Start(Tag::CodeBlock(ref lang)) if is_toml_block(lang) => { ++ Event::Start(Tag::CodeBlock(CodeBlockKind::Fenced(ref lang))) if is_toml_block(lang) => { + let line_count = text[..range.start].lines().count(); + let code_block = &text[range]; + let start = 1 + code_block.find('\n').unwrap_or(0); +-- +2.25.0 + diff --git a/0001-markdown_deps-handle-test-output-from-toml-0.5.3.patch b/0001-markdown_deps-handle-test-output-from-toml-0.5.3.patch new file mode 100644 index 0000000..ace2d1b --- /dev/null +++ b/0001-markdown_deps-handle-test-output-from-toml-0.5.3.patch @@ -0,0 +1,34 @@ +From 33dc77fda8c5d993abee4e6c31c7526408877003 Mon Sep 17 00:00:00 2001 +From: Martin Geisler +Date: Wed, 11 Sep 2019 11:17:36 +0100 +Subject: [PATCH] markdown_deps: handle test output from toml 0.5.3 + +The latest minor version of the toml crate seems to give more detailed +error output. +--- + src/markdown_deps.rs | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/src/markdown_deps.rs b/src/markdown_deps.rs +index 00ca12b..a557c1c 100644 +--- a/src/markdown_deps.rs ++++ b/src/markdown_deps.rs +@@ -276,10 +276,11 @@ mod tests { + let block = "[dependencies]\n\ + foobar = 1.5.8"; + let request = extract_version_request("foobar", block); +- assert_eq!( +- request.unwrap_err(), +- "TOML parse error: expected newline, found a period at line 2" +- ); ++ // toml 0.5.3 returns "found a period at line 2 column 13. ++ // Update the test when we bump the toml crate dependency. ++ assert!(request ++ .unwrap_err() ++ .contains("TOML parse error: expected newline, found a period at line 2")); + } + + #[test] +-- +2.24.0 + diff --git a/rust-version-sync0.8.spec b/rust-version-sync0.8.spec new file mode 100644 index 0000000..5bcb537 --- /dev/null +++ b/rust-version-sync0.8.spec @@ -0,0 +1,81 @@ +# Generated by rust2rpm 15 +%bcond_with check +%global debug_package %{nil} + +%global crate version-sync + +Name: rust-%{crate}0.8 +Version: 0.8.1 +Release: 1%{?dist} +Summary: Simple crate for ensuring that version numbers in README files are updated + +# Upstream license specification: MIT +License: MIT +URL: https://crates.io/crates/version-sync +Source: %{crates_source} +# Initial patched metadata +# * Update pulldown-cmark to 0.7 +Patch0: version-sync-fix-metadata.diff +# * Fix tests with toml 0.5.3+, https://github.com/mgeisler/version-sync/commit/33dc77fda8c5d993abee4e6c31c7526408877003 +Patch0001: 0001-markdown_deps-handle-test-output-from-toml-0.5.3.patch +Patch0002: 0001-chore-Update-pulldown-cmark-to-0.7.patch + +ExclusiveArch: %{rust_arches} +%if %{__cargo_skip_build} +BuildArch: noarch +%endif + +BuildRequires: rust-packaging + +%global _description %{expand: +Simple crate for ensuring that version numbers in README files are updated when +the crate version changes.} + +%description %{_description} + +%package devel +Summary: %{summary} +BuildArch: noarch + +%description devel %{_description} + +This package contains library source intended for building other packages +which use "%{crate}" crate. + +%files devel +%doc README.md +%{cargo_registry}/%{crate}-%{version_no_tilde}/ + +%package -n %{name}+default-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+default-devel %{_description} + +This package contains library source intended for building other packages +which use "default" feature of "%{crate}" crate. + +%files -n %{name}+default-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +* Sat Aug 29 19:44:45 CEST 2020 Igor Raits - 0.8.1-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..2e105a2 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (version-sync-0.8.1.crate) = 5ffa425b2d0f545867a40f57ca98a7db09189302a718cc04979c762bd45b5ec6ce2344d8b8ba0e3799fb4ba169c479837c5890ea7cdb960b9127ec5563957f84 diff --git a/version-sync-fix-metadata.diff b/version-sync-fix-metadata.diff new file mode 100644 index 0000000..e9350ba --- /dev/null +++ b/version-sync-fix-metadata.diff @@ -0,0 +1,11 @@ +--- version-sync-0.8.1/Cargo.toml 1970-01-01T00:00:00+00:00 ++++ version-sync-0.8.1/Cargo.toml 2020-08-29T17:44:45.287439+00:00 +@@ -31,7 +31,7 @@ + features = ["span-locations"] + + [dependencies.pulldown-cmark] +-version = "0.4" ++version = "0.7" + default-features = false + + [dependencies.regex]