diff --git a/.gitignore b/.gitignore index 34b203c..13897d1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /ammonia-2.1.1.crate /ammonia-2.1.2.crate /ammonia-3.0.0.crate +/ammonia-3.1.0.crate diff --git a/0001-chore-Update-html5ever-to-0.25.patch b/0001-chore-Update-html5ever-to-0.25.patch deleted file mode 100644 index 412f5ed..0000000 --- a/0001-chore-Update-html5ever-to-0.25.patch +++ /dev/null @@ -1,46 +0,0 @@ -From a962518225a1f2dd9e35dc313834f6fccf91ef89 Mon Sep 17 00:00:00 2001 -From: Igor Raits -Date: Sat, 15 Feb 2020 15:56:52 +0100 -Subject: [PATCH] chore: Update html5ever to 0.25 - -Signed-off-by: Igor Raits ---- - src/lib.rs | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/src/lib.rs b/src/lib.rs -index 360532d..d36ff9b 100644 ---- a/src/lib.rs -+++ b/src/lib.rs -@@ -28,7 +28,7 @@ - //! [pulldown-cmark]: https://github.com/google/pulldown-cmark "CommonMark parser" - - use html5ever::interface::Attribute; --use html5ever::rcdom::{Handle, NodeData, RcDom}; -+use markup5ever_rcdom::{Handle, NodeData, RcDom, SerializableHandle}; - use html5ever::serialize::{serialize, SerializeOpts}; - use html5ever::tree_builder::{NodeOrText, TreeSink}; - use html5ever::{driver as html, local_name, namespace_url, ns, QualName}; -@@ -1904,7 +1904,8 @@ impl Document { - pub fn to_string(&self) -> String { - let opts = Self::serialize_opts(); - let mut ret_val = Vec::new(); -- serialize(&mut ret_val, &self.0.document.children.borrow()[0], opts) -+ let inner: SerializableHandle = self.0.document.children.borrow()[0].clone().into(); -+ serialize(&mut ret_val, &inner, opts) - .expect("Writing to a string shouldn't fail (expect on OOM)"); - String::from_utf8(ret_val).expect("html5ever only supports UTF8") - } -@@ -1939,7 +1940,8 @@ impl Document { - W: io::Write, - { - let opts = Self::serialize_opts(); -- serialize(writer, &self.0.document.children.borrow()[0], opts) -+ let inner: SerializableHandle = self.0.document.children.borrow()[0].clone().into(); -+ serialize(writer, &inner, opts) - } - - /// Exposes the `Document` instance as an [`html5ever::rcdom::Handle`][h]. --- -2.25.0 - diff --git a/ammonia-fix-metadata.diff b/ammonia-fix-metadata.diff deleted file mode 100644 index 598ee73..0000000 --- a/ammonia-fix-metadata.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- ammonia-3.0.0/Cargo.toml 1970-01-01T00:00:00+00:00 -+++ ammonia-3.0.0/Cargo.toml 2020-02-15T15:04:39.732853+00:00 -@@ -23,7 +23,10 @@ - license = "MIT OR Apache-2.0" - repository = "https://github.com/rust-ammonia/ammonia" - [dependencies.html5ever] --version = "0.24" -+version = "0.25" -+ -+[dependencies.markup5ever_rcdom] -+version = "0.1" - - [dependencies.lazy_static] - version = "1.3" diff --git a/rust-ammonia.spec b/rust-ammonia.spec index 53872d1..dd81e5f 100644 --- a/rust-ammonia.spec +++ b/rust-ammonia.spec @@ -5,19 +5,14 @@ %global crate ammonia Name: rust-%{crate} -Version: 3.0.0 -Release: 3%{?dist} +Version: 3.1.0 +Release: 1%{?dist} Summary: HTML Sanitization # Upstream license specification: MIT OR Apache-2.0 License: MIT or ASL 2.0 URL: https://crates.io/crates/ammonia Source: %{crates_source} -# Initial patched metadata -# * Upgrade html5ever to 0.25, https://github.com/rust-ammonia/ammonia/pull/130 -Patch0: ammonia-fix-metadata.diff -# * Finish the upgrade -Patch0001: 0001-chore-Update-html5ever-to-0.25.patch ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build} @@ -58,9 +53,7 @@ which use "default" feature of "%{crate}" crate. %ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -N -grep -IUlr $'\r' | xargs sed -i 's/\r$//' -%autopatch -p1 +%autosetup -n %{crate}-%{version_no_tilde} -p1 %cargo_prep %generate_buildrequires @@ -78,6 +71,9 @@ grep -IUlr $'\r' | xargs sed -i 's/\r$//' %endif %changelog +* Tue Mar 10 2020 Josh Stone - 3.1.0-1 +- Update to 3.1.0 + * Sat Feb 15 16:04:39 CET 2020 Igor Raits - 3.0.0-3 - Upgrade html5ever to 0.25 diff --git a/sources b/sources index e0fda4a..9507f3e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ammonia-3.0.0.crate) = 743aa0e68db8bd2f636ba75a6683e02c581dab74ddd14b8f3abaef5e55be3d3a58ba361bfe4bf6ad00da20c232011239c9b6a2622818f4a86a290aa628e74186 +SHA512 (ammonia-3.1.0.crate) = 51913e564f04e7c90116abc6f4251a0be8fc6bd6d44f38ca4b0da4744357cf559ee8b15c474879839f151f521a2c4fde76b26eb1f38077b99bce54fb4d3e1d0b