From a6dfa54484c9154f1ba48a5788b535031ba8b644 Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Sat, 22 Feb 2020 19:23:59 +0100 Subject: [PATCH] Update pulldown-cmark to 0.7 Signed-off-by: Igor Raits --- 0001-Bump-cargo_metadata-to-0.8.patch | 67 ----------------- 0001-Bump-pulldown-cmark-to-0.6.patch | 18 +++-- ...and-cargo_metadata-to-latest-version.patch | 9 ++- 0002-chore-Update-pulldown-cmark-to-0.7.patch | 71 +++++++++++++++++++ rust-skeptic.spec | 24 ++++--- skeptic-fix-metadata.diff | 6 +- 6 files changed, 102 insertions(+), 93 deletions(-) delete mode 100644 0001-Bump-cargo_metadata-to-0.8.patch create mode 100644 0002-chore-Update-pulldown-cmark-to-0.7.patch diff --git a/0001-Bump-cargo_metadata-to-0.8.patch b/0001-Bump-cargo_metadata-to-0.8.patch deleted file mode 100644 index 152b43e..0000000 --- a/0001-Bump-cargo_metadata-to-0.8.patch +++ /dev/null @@ -1,67 +0,0 @@ -From f6a22b95f36f4918ed2f53a2920690ad8aec5bff Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= -Date: Wed, 31 Jul 2019 22:11:03 +0200 -Subject: [PATCH] Bump cargo_metadata to 0.8 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Robert-André Mauchin ---- - Cargo.toml | 3 ++- - lib.rs | 14 +++++++++----- - 2 files changed, 11 insertions(+), 6 deletions(-) - -diff --git a/Cargo.toml b/Cargo.toml -index 57a07f4..33341a1 100644 ---- a/Cargo.toml -+++ b/Cargo.toml -@@ -36,6 +36,9 @@ version = "0.8" - version = "0.12" - default-features = false - -+[dependencies.failure] -+version = "0.1" -+ - [dependencies.glob] - version = "0.3" - -diff --git a/lib.rs b/lib.rs -index 08c0066..de24c98 100644 ---- a/lib.rs -+++ b/lib.rs -@@ -1,5 +1,6 @@ - #[macro_use] - extern crate error_chain; -+extern crate failure; - extern crate pulldown_cmark as cmark; - extern crate tempdir; - extern crate glob; -@@ -533,12 +534,14 @@ pub mod rt { - - use self::walkdir::WalkDir; - use self::serde_json::Value; -+ -+ use failure::ResultExt as _; - - error_chain! { - errors { Fingerprint } - foreign_links { - Io(std::io::Error); -- Metadata(cargo_metadata::Error); -+ Metadata(failure::Compat); - Json(serde_json::Error); - } - } -@@ -556,7 +559,7 @@ pub mod rt { - } - - fn get_cargo_meta>(pth: P) -> Result { -- Ok(cargo_metadata::MetadataCommand::new().manifest_path(&pth).exec()?) -+ Ok(cargo_metadata::MetadataCommand::new().manifest_path(&pth).exec().compat()?) - } - - impl LockedDeps { --- -2.21.0 - diff --git a/0001-Bump-pulldown-cmark-to-0.6.patch b/0001-Bump-pulldown-cmark-to-0.6.patch index 4561986..fe55417 100644 --- a/0001-Bump-pulldown-cmark-to-0.6.patch +++ b/0001-Bump-pulldown-cmark-to-0.6.patch @@ -1,18 +1,18 @@ -From 22423be7b62af427d062f09068c7a42af35b1fb2 Mon Sep 17 00:00:00 2001 +From 5464c90b9c083dab4dae89adf06f38fe3f3d8755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Thu, 1 Aug 2019 00:18:55 +0200 -Subject: [PATCH] Bump pulldown-cmark to 0.6 +Subject: [PATCH 1/2] Bump pulldown-cmark to 0.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- - lib.rs | 28 ++++++++++------------------ - 2 files changed, 10 insertions(+), 18 deletions(-) + lib.rs | 26 +++++++++----------------- + 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/lib.rs b/lib.rs -index 08c0066..c6d23f8 100644 +index 08c0066..bcf59bd 100644 --- a/lib.rs +++ b/lib.rs @@ -169,7 +169,7 @@ fn extract_tests(config: &Config) -> Result { @@ -24,11 +24,10 @@ index 08c0066..c6d23f8 100644 } fn extract_tests_from_file(path: &Path) -> Result { -@@ -199,24 +199,16 @@ fn extract_tests_from_string(s: &str, file_stem: &str) -> (Vec, Option (Vec, Option Date: Thu, 14 Mar 2019 10:23:11 +0100 Subject: [PATCH] Bumped glob and cargo_metadata to latest version bumped minimal rust version to 1.26 due to usage of underscore lifetimes in cargo_metadata --- - lib.rs | 19 ++++++++++--------- - 1 files changed, 10 insertions(+), 9 deletions(-) + lib.rs | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib.rs b/lib.rs index b24c5a2..2f47049 100644 @@ -62,3 +62,6 @@ index b24c5a2..2f47049 100644 .map(|package| &package.edition) .max_by_key(|edition| u64::from_str(edition).unwrap()) .unwrap() +-- +2.25.0 + diff --git a/0002-chore-Update-pulldown-cmark-to-0.7.patch b/0002-chore-Update-pulldown-cmark-to-0.7.patch new file mode 100644 index 0000000..0603ebb --- /dev/null +++ b/0002-chore-Update-pulldown-cmark-to-0.7.patch @@ -0,0 +1,71 @@ +From 4c58547f971776f63db9f8735c67ca4178596449 Mon Sep 17 00:00:00 2001 +From: Igor Raits +Date: Sat, 22 Feb 2020 19:03:02 +0100 +Subject: [PATCH 2/2] chore: Update pulldown-cmark to 0.7 + +Signed-off-by: Igor Raits +--- + lib.rs | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/lib.rs b/lib.rs +index bcf59bd..f8d1295 100644 +--- a/lib.rs ++++ b/lib.rs +@@ -11,7 +11,7 @@ use std::io::{self, Read, Write, Error as IoError}; + use std::mem; + use std::path::{PathBuf, Path}; + use std::collections::HashMap; +-use cmark::{Parser, Event, Tag}; ++use cmark::{Parser, Event, Tag, CodeBlockKind}; + + /// Returns a list of markdown files under a directory. + /// +@@ -194,7 +194,7 @@ fn extract_tests_from_file(path: &Path) -> Result { + fn extract_tests_from_string(s: &str, file_stem: &str) -> (Vec, Option) { + let mut tests = Vec::new(); + let mut buffer = Buffer::None; +- let mut parser = Parser::new(s); ++ let parser = Parser::new(s); + let mut section = None; + let mut code_block_start = 0; + // Oh this isn't actually a test but a legacy template +@@ -212,7 +212,7 @@ fn extract_tests_from_string(s: &str, file_stem: &str) -> (Vec, Option { ++ Event::Start(Tag::CodeBlock(CodeBlockKind::Fenced(ref info))) => { + let code_block_info = parse_code_block_info(info); + if code_block_info.is_rust { + buffer = Buffer::Code(Vec::new()); +@@ -228,7 +228,7 @@ fn extract_tests_from_string(s: &str, file_stem: &str) -> (Vec, Option { ++ Event::End(Tag::CodeBlock(CodeBlockKind::Fenced(ref info))) => { + let code_block_info = parse_code_block_info(info); + if let Buffer::Code(buf) = mem::replace(&mut buffer, Buffer::None) { + if code_block_info.is_old_template { +@@ -277,7 +277,7 @@ fn load_templates(path: &Path) -> Result, IoError> { + + for event in parser { + match event { +- Event::Start(Tag::CodeBlock(ref info)) => { ++ Event::Start(Tag::CodeBlock(CodeBlockKind::Fenced(ref info))) => { + let code_block_info = parse_code_block_info(info); + if code_block_info.is_rust { + code_buffer = Some(Vec::new()); +@@ -288,7 +288,7 @@ fn load_templates(path: &Path) -> Result, IoError> { + buf.push(text.to_string()); + } + } +- Event::End(Tag::CodeBlock(ref info)) => { ++ Event::End(Tag::CodeBlock(CodeBlockKind::Fenced(ref info))) => { + let code_block_info = parse_code_block_info(info); + if let Some(buf) = code_buffer.take() { + if let Some(t) = code_block_info.template { +-- +2.25.0 + diff --git a/rust-skeptic.spec b/rust-skeptic.spec index 85943ee..bfc079c 100644 --- a/rust-skeptic.spec +++ b/rust-skeptic.spec @@ -1,5 +1,5 @@ -# Generated by rust2rpm 10 -# Needs test files not provided in the crate +# Generated by rust2rpm 13 +# * Needs test files not provided in the crate %bcond_with check %global debug_package %{nil} @@ -7,22 +7,23 @@ Name: rust-%{crate} Version: 0.13.4 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Test your Rust markdown documentation via Cargo # Upstream license specification: MIT/Apache-2.0 +# https://github.com/budziq/rust-skeptic/pull/98 License: MIT or ASL 2.0 URL: https://crates.io/crates/skeptic Source: %{crates_source} # Initial patched metadata -# - Bump bytecount to 0.6 https://github.com/budziq/rust-skeptic/pull/109 +# - Bump bytecount to 0.6 (upstreamed) # - Bump cargo_metadata to 0.9 https://github.com/budziq/rust-skeptic/pull/107 # - Bump glob to 0.3 (upstreamed) -# - Bump pulldown-cmark to 0.6 https://github.com/budziq/rust-skeptic/pull/108 +# * Bump pulldown-cmark to 0.7, https://github.com/budziq/rust-skeptic/pull/116 Patch0: skeptic-fix-metadata.diff -Patch1: 0001-Bumped-glob-and-cargo_metadata-to-latest-version.patch -Patch2: 0001-Bump-cargo_metadata-to-0.8.patch -Patch3: 0001-Bump-pulldown-cmark-to-0.6.patch +Patch0001: 0001-Bumped-glob-and-cargo_metadata-to-latest-version.patch +Patch0002: 0001-Bump-pulldown-cmark-to-0.6.patch +Patch0003: 0002-chore-Update-pulldown-cmark-to-0.7.patch ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build} @@ -47,7 +48,7 @@ which use "%{crate}" crate. %files devel %doc README.md -%{cargo_registry}/%{crate}-%{version}/ +%{cargo_registry}/%{crate}-%{version_no_tilde}/ %package -n %{name}+default-devel Summary: %{summary} @@ -59,7 +60,7 @@ 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}/Cargo.toml +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml %prep %autosetup -n %{crate}-%{version_no_tilde} -p1 @@ -80,6 +81,9 @@ which use "default" feature of "%{crate}" crate. %endif %changelog +* Sat Feb 22 19:15:34 CET 2020 Igor Raits - 0.13.4-8 +- Update pulldown-cmark to 0.7 + * Thu Jan 30 2020 Fedora Release Engineering - 0.13.4-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild diff --git a/skeptic-fix-metadata.diff b/skeptic-fix-metadata.diff index 260d86b..eadd720 100644 --- a/skeptic-fix-metadata.diff +++ b/skeptic-fix-metadata.diff @@ -1,5 +1,5 @@ ---- skeptic-0.13.4/Cargo.toml 1970-01-01T00:00:00+00:00 -+++ skeptic-0.13.4/Cargo.toml 2019-09-13T15:49:45.807251+00:00 +--- skeptic-0.13.4/Cargo.toml 1970-01-01T00:00:00+00:00 ++++ skeptic-0.13.4/Cargo.toml 2020-02-22T18:15:33.364847+00:00 @@ -27,20 +27,20 @@ name = "skeptic" path = "lib.rs" @@ -21,7 +21,7 @@ [dependencies.pulldown-cmark] -version = "0.2" -+version = "0.6" ++version = "0.7" default-features = false [dependencies.serde_json]