Hello community,
here is the log from the commit of package ghc-hledger-lib for openSUSE:Factory
checked in at 2020-09-15 16:21:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hledger-lib (Old)
and /work/SRC/openSUSE:Factory/.ghc-hledger-lib.new.4249 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hledger-lib"
Tue Sep 15 16:21:09 2020 rev:6 rq:833308 version:1.19.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-hledger-lib/ghc-hledger-lib.changes
2020-09-07 21:32:22.425298393 +0200
+++
/work/SRC/openSUSE:Factory/.ghc-hledger-lib.new.4249/ghc-hledger-lib.changes
2020-09-15 16:21:19.234196429 +0200
@@ -1,0 +2,15 @@
+Tue Sep 8 02:00:51 UTC 2020 - [email protected]
+
+- Update hledger-lib to version 1.19.1.
+ # 1.19.1 2020-09-07
+
+ - Allow megaparsec 9
+
+ - stripAnsi: correctly strip ansi sequences with no
+ numbers/semicolons. (Stephen Morgan)
+
+ - Added case-insensitive accountNameToAccountRegexCI,
+ accountNameToAccountOnlyRegexCI, made the default account type
+ queries case insensitive again. (#1341)
+
+-------------------------------------------------------------------
Old:
----
hledger-lib-1.19.tar.gz
New:
----
hledger-lib-1.19.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-hledger-lib.spec ++++++
--- /var/tmp/diff_new_pack.GznJzK/_old 2020-09-15 16:21:20.974198095 +0200
+++ /var/tmp/diff_new_pack.GznJzK/_new 2020-09-15 16:21:20.974198095 +0200
@@ -19,7 +19,7 @@
%global pkg_name hledger-lib
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 1.19
+Version: 1.19.1
Release: 0
Summary: A reusable library providing the core functionality of hledger
License: GPL-3.0-or-later
++++++ hledger-lib-1.19.tar.gz -> hledger-lib-1.19.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hledger-lib-1.19/CHANGES.md
new/hledger-lib-1.19.1/CHANGES.md
--- old/hledger-lib-1.19/CHANGES.md 2020-09-02 05:39:58.000000000 +0200
+++ new/hledger-lib-1.19.1/CHANGES.md 2020-09-08 00:41:25.000000000 +0200
@@ -1,6 +1,17 @@
Internal/api/developer-ish changes in the hledger-lib (and hledger) packages.
For user-visible changes, see the hledger package changelog.
+# 1.19.1 2020-09-07
+
+- Allow megaparsec 9
+
+- stripAnsi: correctly strip ansi sequences with no
+ numbers/semicolons. (Stephen Morgan)
+
+- Added case-insensitive accountNameToAccountRegexCI,
+ accountNameToAccountOnlyRegexCI, made the default account type
+ queries case insensitive again. (#1341)
+
# 1.19 2020-09-01
- Added a missing lower bound for aeson, making cabal installs more
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hledger-lib-1.19/Hledger/Data/AccountName.hs
new/hledger-lib-1.19.1/Hledger/Data/AccountName.hs
--- old/hledger-lib-1.19/Hledger/Data/AccountName.hs 2020-09-01
19:33:33.000000000 +0200
+++ new/hledger-lib-1.19.1/Hledger/Data/AccountName.hs 2020-09-04
01:42:32.000000000 +0200
@@ -16,7 +16,9 @@
,accountNameFromComponents
,accountNameLevel
,accountNameToAccountOnlyRegex
+ ,accountNameToAccountOnlyRegexCI
,accountNameToAccountRegex
+ ,accountNameToAccountRegexCI
,accountNameTreeFrom
,accountSummarisedName
,acctsep
@@ -218,10 +220,20 @@
accountNameToAccountRegex :: AccountName -> Regexp
accountNameToAccountRegex a = toRegex' $ '^' : escapeName a ++ "(:|$)" --
PARTIAL: Is this safe after escapeName?
+-- | Convert an account name to a regular expression matching it and its
subaccounts,
+-- case insensitively.
+accountNameToAccountRegexCI :: AccountName -> Regexp
+accountNameToAccountRegexCI a = toRegexCI' $ '^' : escapeName a ++ "(:|$)" --
PARTIAL: Is this safe after escapeName?
+
-- | Convert an account name to a regular expression matching it but not its
subaccounts.
accountNameToAccountOnlyRegex :: AccountName -> Regexp
accountNameToAccountOnlyRegex a = toRegex' $ '^' : escapeName a ++ "$" --
PARTIAL: Is this safe after escapeName?
+-- | Convert an account name to a regular expression matching it but not its
subaccounts,
+-- case insensitively.
+accountNameToAccountOnlyRegexCI :: AccountName -> Regexp
+accountNameToAccountOnlyRegexCI a = toRegexCI' $ '^' : escapeName a ++ "$" --
PARTIAL: Is this safe after escapeName?
+
-- -- | Does this string look like an exact account-matching regular
expression ?
--isAccountRegex :: String -> Bool
--isAccountRegex s = take 1 s == "^" && take 5 (reverse s) == ")$|:("
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hledger-lib-1.19/Hledger/Data/Amount.hs
new/hledger-lib-1.19.1/Hledger/Data/Amount.hs
--- old/hledger-lib-1.19/Hledger/Data/Amount.hs 2020-09-01 01:04:28.000000000
+0200
+++ new/hledger-lib-1.19.1/Hledger/Data/Amount.hs 2020-09-07
01:37:24.000000000 +0200
@@ -439,8 +439,7 @@
fromInteger i = Mixed [fromInteger i]
negate (Mixed as) = Mixed $ map negate as
(+) (Mixed as) (Mixed bs) = normaliseMixedAmount $ Mixed $ as ++ bs
- -- PARTIAL:
- (*) = error' "error, mixed amounts do not support multiplication"
+ (*) = error' "error, mixed amounts do not support multiplication" --
PARTIAL:
abs = error' "error, mixed amounts do not support abs"
signum = error' "error, mixed amounts do not support signum"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hledger-lib-1.19/Hledger/Data/Journal.hs
new/hledger-lib-1.19.1/Hledger/Data/Journal.hs
--- old/hledger-lib-1.19/Hledger/Data/Journal.hs 2020-09-01
19:33:33.000000000 +0200
+++ new/hledger-lib-1.19.1/Hledger/Data/Journal.hs 2020-09-04
01:42:32.000000000 +0200
@@ -300,7 +300,7 @@
-- or otherwise for accounts with names matched by the case-insensitive
-- regular expression @^assets?(:|$)@.
journalAssetAccountQuery :: Journal -> Query
-journalAssetAccountQuery = journalAccountTypeQuery [Asset,Cash] (toRegex'
"^assets?(:|$)")
+journalAssetAccountQuery = journalAccountTypeQuery [Asset,Cash] (toRegexCI'
"^assets?(:|$)")
-- | A query for "Cash" (liquid asset) accounts in this journal, ie accounts
-- declared as Cash by account directives, or otherwise with names matched by
the
@@ -309,7 +309,7 @@
journalCashAccountQuery :: Journal -> Query
journalCashAccountQuery j =
case M.lookup Cash (jdeclaredaccounttypes j) of
- Nothing -> And [ journalAssetAccountQuery j, Not . Acct $ toRegex'
"(investment|receivable|:A/R|:fixed)" ]
+ Nothing -> And [ journalAssetAccountQuery j, Not . Acct $ toRegexCI'
"(investment|receivable|:A/R|:fixed)" ]
Just _ -> journalAccountTypeQuery [Cash] notused j
where notused = error' "journalCashAccountQuery: this should not have
happened!" -- PARTIAL:
@@ -318,28 +318,28 @@
-- accounts with names matched by the case-insensitive regular expression
-- @^(debts?|liabilit(y|ies))(:|$)@.
journalLiabilityAccountQuery :: Journal -> Query
-journalLiabilityAccountQuery = journalAccountTypeQuery [Liability] (toRegex'
"^(debts?|liabilit(y|ies))(:|$)")
+journalLiabilityAccountQuery = journalAccountTypeQuery [Liability] (toRegexCI'
"^(debts?|liabilit(y|ies))(:|$)")
-- | A query for accounts in this journal which have been
-- declared as Equity by account directives, or otherwise for
-- accounts with names matched by the case-insensitive regular expression
-- @^equity(:|$)@.
journalEquityAccountQuery :: Journal -> Query
-journalEquityAccountQuery = journalAccountTypeQuery [Equity] (toRegex'
"^equity(:|$)")
+journalEquityAccountQuery = journalAccountTypeQuery [Equity] (toRegexCI'
"^equity(:|$)")
-- | A query for accounts in this journal which have been
-- declared as Revenue by account directives, or otherwise for
-- accounts with names matched by the case-insensitive regular expression
-- @^(income|revenue)s?(:|$)@.
journalRevenueAccountQuery :: Journal -> Query
-journalRevenueAccountQuery = journalAccountTypeQuery [Revenue] (toRegex'
"^(income|revenue)s?(:|$)")
+journalRevenueAccountQuery = journalAccountTypeQuery [Revenue] (toRegexCI'
"^(income|revenue)s?(:|$)")
-- | A query for accounts in this journal which have been
-- declared as Expense by account directives, or otherwise for
-- accounts with names matched by the case-insensitive regular expression
-- @^expenses?(:|$)@.
journalExpenseAccountQuery :: Journal -> Query
-journalExpenseAccountQuery = journalAccountTypeQuery [Expense] (toRegex'
"^expenses?(:|$)")
+journalExpenseAccountQuery = journalAccountTypeQuery [Expense] (toRegexCI'
"^expenses?(:|$)")
-- | A query for Asset, Liability & Equity accounts in this journal.
-- Cf <http://en.wikipedia.org/wiki/Chart_of_accounts#Balance_Sheet_Accounts>.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hledger-lib-1.19/Hledger/Utils/Regex.hs
new/hledger-lib-1.19.1/Hledger/Utils/Regex.hs
--- old/hledger-lib-1.19/Hledger/Utils/Regex.hs 2020-09-01 19:33:33.000000000
+0200
+++ new/hledger-lib-1.19.1/Hledger/Utils/Regex.hs 2020-09-04
01:42:32.000000000 +0200
@@ -193,7 +193,7 @@
case read s of n | n `elem` indices grps -> Right $ fst (grps !
n)
_ -> Left $ "no match
group exists for backreference \"\\"++s++"\""
lookupMatchGroup _ s = Left $ "lookupMatchGroup called on
non-numeric-backreference \""++s++"\", shouldn't happen"
- backrefRegex = toRegex' "\\\\[0-9]+" -- PARTIAL: should not happen
+ backrefRegex = toRegex' "\\\\[0-9]+" -- PARTIAL: should not fail
-- regexReplace' :: Regexp -> Replacement -> String -> String
-- regexReplace' re repl s =
@@ -213,7 +213,7 @@
-- -- PARTIAL:
-- _ -> error' $ "no
match group exists for backreference \"\\"++s++"\""
-- lookupMatchGroup _ s = error' $ "lookupMatchGroup called on
non-numeric-backreference \""++s++"\", shouldn't happen"
--- backrefRegex = toRegex' "\\\\[0-9]+" -- PARTIAL: should not error
happen
+-- backrefRegex = toRegex' "\\\\[0-9]+" -- PARTIAL: should not fail
-- helpers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hledger-lib-1.19/Hledger/Utils/String.hs
new/hledger-lib-1.19.1/Hledger/Utils/String.hs
--- old/hledger-lib-1.19/Hledger/Utils/String.hs 2020-09-01
19:33:33.000000000 +0200
+++ new/hledger-lib-1.19.1/Hledger/Utils/String.hs 2020-09-07
21:20:58.000000000 +0200
@@ -50,8 +50,8 @@
import Data.Char (isDigit, isSpace, toLower, toUpper)
import Data.List (intercalate, transpose)
-import Text.Megaparsec (Parsec, (<|>), (<?>), between, many, noneOf, oneOf,
- parseMaybe, sepBy, takeWhile1P)
+import Text.Megaparsec (Parsec, (<|>), (<?>), anySingle, between, many, noneOf,
+ oneOf, parseMaybe, sepBy, takeWhileP, try)
import Text.Megaparsec.Char (char, string)
import Text.Printf (printf)
@@ -337,12 +337,18 @@
strWidth :: String -> Int
strWidth = maximum . (0:) . map (foldr (\a b -> charWidth a + b) 0) . lines .
stripAnsi
+-- | Strip ANSI escape sequences from a string.
+--
+-- >>> stripAnsi "\ESC[31m-1\ESC[m"
+-- "-1"
stripAnsi :: String -> String
-stripAnsi s = maybe s concat $ parseMaybe (many $ takeWhile1P Nothing
(/='\ESC') <|> "" <$ ansi) s
+stripAnsi s = case parseMaybe (many $ "" <$ try ansi <|> pure <$> anySingle) s
of
+ Nothing -> error "Bad ansi escape" -- PARTIAL: should not happen
+ Just xs -> concat xs
where
-- This parses lots of invalid ANSI escape codes, but that should be fine
ansi = string "\ESC[" *> digitSemicolons *> suffix <?> "ansi" :: Parsec
CustomErr String Char
- digitSemicolons = takeWhile1P Nothing (\c -> isDigit c || c == ';')
+ digitSemicolons = takeWhileP Nothing (\c -> isDigit c || c == ';')
suffix = oneOf ['A', 'B', 'C', 'D', 'H', 'J', 'K', 'f', 'm', 's', 'u']
-- | Get the designated render width of a character: 0 for a combining
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hledger-lib-1.19/hledger-lib.cabal
new/hledger-lib-1.19.1/hledger-lib.cabal
--- old/hledger-lib-1.19/hledger-lib.cabal 2020-09-02 05:38:36.000000000
+0200
+++ new/hledger-lib-1.19.1/hledger-lib.cabal 2020-09-08 00:41:25.000000000
+0200
@@ -4,10 +4,10 @@
--
-- see: https://github.com/sol/hpack
--
--- hash: 562b07c743e67f55f539704cf37da021e6ec23c3b47b3bc3f673875b1feb256f
+-- hash: 4cff01322093c9a60a07a65c0ed150394360e71104dd3e7b52fc6782c5cf5a57
name: hledger-lib
-version: 1.19
+version: 1.19.1
synopsis: A reusable library providing the core functionality of hledger
description: A reusable library containing hledger's core functionality.
This is used by most hledger* packages so that they support
the same
@@ -130,7 +130,7 @@
, file-embed >=0.0.10
, filepath
, hashtables >=1.2.3.1
- , megaparsec >=7.0.0 && <8.1
+ , megaparsec >=7.0.0 && <9.1
, mtl >=2.2.1
, old-time
, parsec >=3
@@ -183,7 +183,7 @@
, file-embed >=0.0.10
, filepath
, hashtables >=1.2.3.1
- , megaparsec >=7.0.0 && <8.1
+ , megaparsec >=7.0.0 && <9.1
, mtl >=2.2.1
, old-time
, parsec >=3
@@ -238,7 +238,7 @@
, filepath
, hashtables >=1.2.3.1
, hledger-lib
- , megaparsec >=7.0.0 && <8.1
+ , megaparsec >=7.0.0 && <9.1
, mtl >=2.2.1
, old-time
, parsec >=3