Package: newsboat
Version: 2.21-1.1
Severity: normal
Tags: patch  pending

Dear maintainer,

I've prepared an NMU for newsboat (versioned as 2.21-1.2) to adapt it
for the transition of rust-nom 5 -> 7.  I'll upload it to DELAYED/7.
Please feel free to tell me if I should delay it longer.

Regards.

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB
diffstat for newsboat-2.21 newsboat-2.21

 changelog                      |    8 +++
 control                        |    2 
 patches/nom-ContextError.patch |   93 +++++++++++++++++++++++++++++++++++++++++
 patches/relax-deps.diff        |    8 ++-
 patches/series                 |    1 
 5 files changed, 108 insertions(+), 4 deletions(-)

diff -Nru newsboat-2.21/debian/changelog newsboat-2.21/debian/changelog
--- newsboat-2.21/debian/changelog	2022-01-23 09:28:08.000000000 -0500
+++ newsboat-2.21/debian/changelog	2022-03-05 19:26:54.000000000 -0500
@@ -1,3 +1,11 @@
+newsboat (2.21-1.2) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Update to nom 7
+  * Backport patch from upstream to build properly with nom-7
+
+ -- James McCoy <james...@debian.org>  Sat, 05 Mar 2022 19:26:54 -0500
+
 newsboat (2.21-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru newsboat-2.21/debian/control newsboat-2.21/debian/control
--- newsboat-2.21/debian/control	2022-01-23 09:28:08.000000000 -0500
+++ newsboat-2.21/debian/control	2022-03-05 16:46:48.000000000 -0500
@@ -23,7 +23,7 @@
                librust-backtrace-0.3-dev,
                librust-backtrace-sys-0.1-dev,
                librust-unicode-width-0.1-dev,
-               librust-nom-5+lexical-core-dev,
+               librust-nom-7-dev,
                librust-curl-sys-0.4+ssl-dev,
                librust-libc-0.2-dev,
                librust-gettext-rs-0.4-dev,
diff -Nru newsboat-2.21/debian/patches/nom-ContextError.patch newsboat-2.21/debian/patches/nom-ContextError.patch
--- newsboat-2.21/debian/patches/nom-ContextError.patch	1969-12-31 19:00:00.000000000 -0500
+++ newsboat-2.21/debian/patches/nom-ContextError.patch	2022-03-05 16:59:33.000000000 -0500
@@ -0,0 +1,93 @@
+From 5fb3d1fcabefa740547d1a5ebe2fd5b825624029 Mon Sep 17 00:00:00 2001
+From: David Brito <39559632+davbr...@users.noreply.github.com>
+Date: Sat, 7 Nov 2020 11:53:01 -0400
+Subject: [PATCH] Add ContextError trait
+
+---
+ rust/libnewsboat/src/filterparser.rs          | 24 +++++++++++++------
+ .../libnewsboat/src/fmtstrformatter/parser.rs |  2 +-
+ 2 files changed, 18 insertions(+), 8 deletions(-)
+
+diff --git a/rust/libnewsboat/src/filterparser.rs b/rust/libnewsboat/src/filterparser.rs
+index 2c0bffe38..a27128c30 100644
+--- a/rust/libnewsboat/src/filterparser.rs
++++ b/rust/libnewsboat/src/filterparser.rs
+@@ -7,7 +7,7 @@ use nom::{
+     bytes::complete::{escaped, is_not, tag, take, take_while, take_while1},
+     character::{is_alphanumeric, is_digit},
+     combinator::{complete, map, opt, peek, recognize, value},
+-    error::{context, ParseError, VerboseError, VerboseErrorKind},
++    error::{context, ContextError, ParseError, VerboseError, VerboseErrorKind},
+     sequence::{delimited, separated_pair, terminated, tuple},
+     IResult, Offset,
+ };
+@@ -96,7 +96,9 @@ fn expected_to_i18n_msg(expected_id: &'static str) -> &'static str {
+         .unwrap_or("<internal error in filterparser::expected_to_i18n_msg>")
+ }
+ 
+-fn operators<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a str, Operator, E> {
++fn operators<'a, E: ParseError<&'a str> + ContextError<&'a str>>(
++    input: &'a str,
++) -> IResult<&'a str, Operator, E> {
+     context(
+         EXPECTED_OPERATORS,
+         alt((
+@@ -154,8 +156,10 @@ fn space1<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a str, &'a st
+     take_while1(|c| c == ' ')(input)
+ }
+ 
+-fn comparison<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a str, Expression, E> {
+-    let attribute_name = context(
++fn comparison<'a, E: ParseError<&'a str> + ContextError<&'a str>>(
++    input: &'a str,
++) -> IResult<&'a str, Expression, E> {
++    let mut attribute_name = context(
+         EXPECTED_ATTRIBUTE_NAME,
+         take_while1(|c| is_alphanumeric(c as u8) || c == '_' || c == '-' || c == '.'),
+     );
+@@ -180,7 +184,9 @@ fn comparison<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a str, Ex
+     ))
+ }
+ 
+-fn parens<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a str, Expression, E> {
++fn parens<'a, E: ParseError<&'a str> + ContextError<&'a str>>(
++    input: &'a str,
++) -> IResult<&'a str, Expression, E> {
+     let (input, _) = tag("(")(input)?;
+     let (input, _) = space0(input)?;
+     let (input, result) = alt((expression, parens, comparison))(input)?;
+@@ -208,7 +214,9 @@ fn space_after_logop<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a
+     peek(parser)(input)
+ }
+ 
+-fn expression<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a str, Expression, E> {
++fn expression<'a, E: ParseError<&'a str> + ContextError<&'a str>>(
++    input: &'a str,
++) -> IResult<&'a str, Expression, E> {
+     // `Expression`s enum variants can't be used as return values without filling in their
+     // arguments, so we have to create another enum, which variants we can return and `match` on.
+     // This is better than matching on bare strings returned by `tag`, as it enables us to write an
+@@ -237,7 +245,9 @@ fn expression<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a str, Ex
+     Ok((leftovers, op))
+ }
+ 
+-fn parser<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&'a str, Expression, E> {
++fn parser<'a, E: ParseError<&'a str> + ContextError<&'a str>>(
++    input: &'a str,
++) -> IResult<&'a str, Expression, E> {
+     let parsers = alt((expression, parens, comparison));
+     // Ignore leading and trailing whitespace
+     let parsers = delimited(space0, parsers, space0);
+diff --git a/rust/libnewsboat/src/fmtstrformatter/parser.rs b/rust/libnewsboat/src/fmtstrformatter/parser.rs
+index 61047027e..d5bfc290c 100644
+--- a/rust/libnewsboat/src/fmtstrformatter/parser.rs
++++ b/rust/libnewsboat/src/fmtstrformatter/parser.rs
+@@ -110,7 +110,7 @@ fn conditional(input: &str) -> IResult<&str, Specifier> {
+         let (input, _) = end_tag(input)?;
+         Ok((input, None))
+     };
+-    let else_branch = alt((some_else_branch, none_else_branch));
++    let mut else_branch = alt((some_else_branch, none_else_branch));
+ 
+     // Input parsing
+     let (input, _) = start_tag(input)?;
diff -Nru newsboat-2.21/debian/patches/relax-deps.diff newsboat-2.21/debian/patches/relax-deps.diff
--- newsboat-2.21/debian/patches/relax-deps.diff	2022-01-23 09:28:08.000000000 -0500
+++ newsboat-2.21/debian/patches/relax-deps.diff	2022-03-05 16:43:42.000000000 -0500
@@ -2,7 +2,7 @@
 ===================================================================
 --- newsboat-2.21.orig/rust/libnewsboat/Cargo.toml
 +++ newsboat-2.21/rust/libnewsboat/Cargo.toml
-@@ -9,8 +9,8 @@ strprintf = { path="../strprintf" }
+@@ -9,17 +9,17 @@ strprintf = { path="../strprintf" }
  regex-rs = { path="../regex-rs" }
  
  chrono = "0.4"
@@ -13,8 +13,10 @@
  url = "2.0.0"
  percent-encoding = "2.0.0"
  xdg = "2.2.0"
-@@ -19,7 +19,7 @@ unicode-width = "0.1.8"
- nom = "5"
+ backtrace = "= 0.3"
+ unicode-width = "0.1.8"
+-nom = "5"
++nom = "7"
  curl-sys = "0.4.5"
  libc = "0.2"
 -gettext-rs = "0.5.0"
diff -Nru newsboat-2.21/debian/patches/series newsboat-2.21/debian/patches/series
--- newsboat-2.21/debian/patches/series	2020-10-15 09:34:08.000000000 -0400
+++ newsboat-2.21/debian/patches/series	2022-03-05 17:00:00.000000000 -0500
@@ -1,3 +1,4 @@
 01-use-policy-compliant-perl-hashbang.patch
 02-fix-make.patch
 relax-deps.diff
+nom-ContextError.patch

Reply via email to