From d91efdea27dbf5c8d53b8dcdd8c761e33650cf2c Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Aug 31 2017 15:01:16 +0000 Subject: merge --- diff --git a/banshee-2.6.2-dos2unix-xml.patch b/banshee-2.6.2-dos2unix-xml.patch new file mode 100644 index 0000000..0405eea --- /dev/null +++ b/banshee-2.6.2-dos2unix-xml.patch @@ -0,0 +1,66 @@ +diff -up banshee-2.6.2/src/Libraries/Migo/Migo.Syndication/RssParser.cs.dos2unix banshee-2.6.2/src/Libraries/Migo/Migo.Syndication/RssParser.cs +--- banshee-2.6.2/src/Libraries/Migo/Migo.Syndication/RssParser.cs.dos2unix 2014-02-18 15:35:24.000000000 -0500 ++++ banshee-2.6.2/src/Libraries/Migo/Migo.Syndication/RssParser.cs 2017-08-31 10:45:49.868223559 -0400 +@@ -54,26 +54,49 @@ namespace Migo.Syndication + try { + doc.LoadXml (xml); + } catch (XmlException e) { +- bool have_stripped_control = false; +- StringBuilder sb = new StringBuilder (); +- +- foreach (char c in xml) { +- if (Char.IsControl (c) && c != '\n') { +- have_stripped_control = true; +- } else { +- sb.Append (c); +- } +- } +- + bool loaded = false; +- if (have_stripped_control) { ++ string DosLineBreak = "\r\n"; ++ var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true); ++ string _byteOrderMarkUtf8 = encoding.GetString(encoding.GetPreamble()); ++ if (System.Text.RegularExpressions.Regex.IsMatch(xml, DosLineBreak, System.Text.RegularExpressions.RegexOptions.IgnoreCase)) { ++ Hyena.Log.Warning ("DosLineBreaks detected in xml"); ++ string result = xml.Replace("\r", ""); ++ if (result.StartsWith(_byteOrderMarkUtf8, StringComparison.Ordinal)) { ++ Hyena.Log.Warning ("UTF-8 BOM detected in xml"); ++ result = result.Remove(0, _byteOrderMarkUtf8.Length); ++ } ++ if (result.StartsWith("\uFEFF", StringComparison.Ordinal)) { ++ Hyena.Log.Warning ("UTF-16 BOM detected in xml"); ++ result.Trim(new char[]{'\uFEFF','\u200B'}); ++ } + try { +- doc.LoadXml (sb.ToString ()); ++ doc.LoadXml (result); + loaded = true; + } catch (Exception) { + } + } + ++ if (!loaded) { ++ bool have_stripped_control = false; ++ StringBuilder sb = new StringBuilder (); ++ ++ foreach (char c in xml) { ++ if (Char.IsControl (c) && c != '\n') { ++ have_stripped_control = true; ++ } else { ++ sb.Append (c); ++ } ++ } ++ ++ if (have_stripped_control) { ++ try { ++ doc.LoadXml (sb.ToString ()); ++ loaded = true; ++ } catch (Exception) { ++ } ++ } ++ } ++ + if (!loaded) { + Hyena.Log.Exception (e); + throw new FormatException ("Invalid XML document."); diff --git a/banshee.spec b/banshee.spec index aba55bd..8a83ce1 100644 --- a/banshee.spec +++ b/banshee.spec @@ -1,6 +1,6 @@ Name: banshee Version: 2.6.2 -Release: 24%{?dist} +Release: 25%{?dist} Summary: Easily import, manage, and play selections from your music collection License: MIT @@ -33,6 +33,8 @@ Patch13: banshee-2.6.2-fix-gnomesettings-connection.patch # Fix NetworkManager connection state cases # Thanks to Fabrice Bellet Patch14: banshee-2.6.2-fix-nm-connection-state-cases.patch +# Convert failed xml streams from dos2unix and retry +Patch15: banshee-2.6.2-dos2unix-xml.patch # Mono only available on these: ExclusiveArch: %{mono_arches} @@ -134,6 +136,7 @@ developing extensions for %{name}. %patch12 -p1 -b .monotlsprovider %patch13 -p1 -b .gnomesettings %patch14 -p1 -b .fixnm +%patch15 -p1 -b .dos2unix sed -i "s#gmcs#mcs#g" configure.ac sed -i "s#gmcs#mcs#g" configure* @@ -229,6 +232,9 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || : %{_libdir}/pkgconfig/banshee-*.pc %changelog +* Wed Aug 30 2017 Tom Callaway - 2.6.2-25 +- Convert failed xml streams from dos2unix and retry + * Wed Aug 02 2017 Fedora Release Engineering - 2.6.2-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild