From 68cc0081bdb99b029682d75c3e6a2dbbe3d555fec97e5ddfa12c1c0c79f415e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Sun, 14 Mar 2021 22:14:49 +0000 Subject: [PATCH 1/2] osc copypac from project:devel:languages:haskell:ghc-8.10.x package:hledger-interest revision:15, using keep-link OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/hledger-interest?expand=0&rev=12 --- hledger-interest-1.6.0.tar.gz | 3 - hledger-interest-1.6.1.tar.gz | 3 + hledger-interest.cabal | 127 ---------------------------------- hledger-interest.changes | 6 ++ hledger-interest.spec | 6 +- hledger.patch | 35 ++++++++++ 6 files changed, 46 insertions(+), 134 deletions(-) delete mode 100644 hledger-interest-1.6.0.tar.gz create mode 100644 hledger-interest-1.6.1.tar.gz delete mode 100644 hledger-interest.cabal create mode 100644 hledger.patch diff --git a/hledger-interest-1.6.0.tar.gz b/hledger-interest-1.6.0.tar.gz deleted file mode 100644 index ab1507b..0000000 --- a/hledger-interest-1.6.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5817bc5ff289758e7f6b139d93a234b5f436f2f7bd26cd6c5991cc1d6aab1768 -size 8564 diff --git a/hledger-interest-1.6.1.tar.gz b/hledger-interest-1.6.1.tar.gz new file mode 100644 index 0000000..eaf4466 --- /dev/null +++ b/hledger-interest-1.6.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0cee0bef33a18bb1aca414abb93d5931e97dc293a2713c266ea2cda2f3f12745 +size 8558 diff --git a/hledger-interest.cabal b/hledger-interest.cabal deleted file mode 100644 index 9c6f33b..0000000 --- a/hledger-interest.cabal +++ /dev/null @@ -1,127 +0,0 @@ -Name: hledger-interest -Version: 1.6.0 -x-revision: 1 -Synopsis: computes interest for a given account -License: BSD3 -License-file: LICENSE -Author: Peter Simons -Maintainer: Peter Simons -Homepage: https://github.com/peti/hledger-interest -Category: Finance -Build-type: Simple -Cabal-version: >= 1.10 -Extra-source-files: README.md -Stability: stable -tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5 - , GHC == 8.8.4, GHC == 8.10.2 - -Description: - hledger-interest is a small command-line utility based on Simon - Michael's hleder library. Its purpose is to compute interest for a - given ledger account. Using command line flags, the program can be - configured to use various schemes for day-counting, such as act\/act, - 30\/360, 30E\/360, and 30\/360isda. Furthermore, it supports a (small) - number of interest schemes, i.e. annual interest with a fixed rate and - the scheme mandated by the German BGB288 (Basiszins fuer - Verbrauchergeschaefte). Extending support for other schemes is fairly - easy, but currently requires changes to the source code. - . - As an example, consider the following loan, stored in a file called - @test.ledger@: - . - > 2008/09/26 Loan - > Assets:Bank EUR 10000.00 - > Liabilities:Bank - > - > 2008/11/27 Payment - > Assets:Bank EUR -3771.12 - > Liabilities:Bank - > - > 2009/05/03 Payment - > Assets:Bank EUR -1200.00 - > Liabilities:Bank - > - > 2010/12/10 Payment - > Assets:Bank EUR -3700.00 - > Liabilities:Bank - . - Suppose that loan earns 5% interest per year, and payments amortize - interest before amortizing the principal claim, then the resulting - ledger would look like this: - . - > $ hledger-interest --file=test.ledger --source=Expenses:Interest --target=Liabilities:Bank --30-360 --annual=0.05 Liabilities:Bank - > 2008/09/26 Loan - > Assets:Bank EUR 10000.00 - > Liabilities:Bank - > - > 2008/11/27 Payment - > Assets:Bank EUR -3771.12 - > Liabilities:Bank - > - > 2008/11/27 5.00% interest for EUR -10000.00 over 61 days - > Liabilities:Bank EUR -84.72 - > Expenses:Interest - > - > 2008/12/31 5.00% interest for EUR -6313.60 over 34 days - > Liabilities:Bank EUR -29.81 - > Expenses:Interest - > - > 2009/05/03 Payment - > Assets:Bank EUR -1200.00 - > Liabilities:Bank - > - > 2009/05/03 5.00% interest for EUR -6343.42 over 123 days - > Liabilities:Bank EUR -108.37 - > Expenses:Interest - > - > 2009/12/31 5.00% interest for EUR -5251.78 over 238 days - > Liabilities:Bank EUR -173.60 - > Expenses:Interest - > - > 2010/12/10 Payment - > Assets:Bank EUR -3700.00 - > Liabilities:Bank - > - > 2010/12/10 5.00% interest for EUR -5425.38 over 340 days - > Liabilities:Bank EUR -256.20 - > Expenses:Interest - > - > 2010/12/31 5.00% interest for EUR -1981.58 over 21 days - > Liabilities:Bank EUR -5.78 - > Expenses:Interest - . - Running the utility with @--help@ gives a brief overview over the - available options: - . - > Usage: hledger-interest [OPTION...] ACCOUNT - > -h --help print this message and exit - > -V --version show version number and exit - > -v --verbose echo input ledger to stdout (default) - > -q --quiet don't echo input ledger to stdout - > --today compute interest up until today - > -f FILE --file=FILE input ledger file (pass '-' for stdin) - > -s ACCOUNT --source=ACCOUNT interest source account - > -t ACCOUNT --target=ACCOUNT interest target account - > -I --ignore-assertions ignore any failing balance assertions - > --act use 'act' day counting convention - > --30-360 use '30/360' day counting convention - > --30E-360 use '30E/360' day counting convention - > --30E-360isda use '30E/360isda' day counting convention - > --constant=RATE constant interest rate - > --annual-schedule=SCHEDULE schedule of annual interest rates. - > syntax: '[(Date1,Rate1),(Date2,Rate2),...]' - > --annual=RATE annual interest rate - > --bgb288 compute interest according to German BGB288 - -Source-Repository head - Type: git - Location: git://github.com/peti/hledger-interest.git - -Executable hledger-interest - default-language: Haskell2010 - Main-is: Main.hs - Build-depends: base >= 3 && < 5, hledger-lib >= 1.19 && < 1.21, time, mtl, Cabal, Decimal, text - other-modules: Hledger.Interest - Hledger.Interest.DayCountConvention - Hledger.Interest.Rate - Paths_hledger_interest diff --git a/hledger-interest.changes b/hledger-interest.changes index 0c2810b..9f7021c 100644 --- a/hledger-interest.changes +++ b/hledger-interest.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Mar 12 20:37:23 UTC 2021 - psimons@suse.com + +- Update hledger-interest to version 1.6.1. + Upstream does not provide a change log file. + ------------------------------------------------------------------- Thu Dec 17 12:20:00 UTC 2020 - Ondřej Súkup diff --git a/hledger-interest.spec b/hledger-interest.spec index b55dad0..178ed3e 100644 --- a/hledger-interest.spec +++ b/hledger-interest.spec @@ -1,7 +1,7 @@ # # spec file for package hledger-interest # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,13 +17,12 @@ Name: hledger-interest -Version: 1.6.0 +Version: 1.6.1 Release: 0 Summary: Computes interest for a given account License: BSD-3-Clause URL: https://hackage.haskell.org/package/%{name} Source0: https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz -Source1: https://hackage.haskell.org/package/%{name}-%{version}/revision/1.cabal#/%{name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-Decimal-devel BuildRequires: ghc-hledger-lib-devel @@ -89,7 +88,6 @@ German BGB288. %prep %autosetup -cp -p %{SOURCE1} %{name}.cabal %build %ghc_bin_build diff --git a/hledger.patch b/hledger.patch new file mode 100644 index 0000000..1540b11 --- /dev/null +++ b/hledger.patch @@ -0,0 +1,35 @@ +From e0694605be0c89c9b97629a893696a7947dc7fcb Mon Sep 17 00:00:00 2001 +From: Dmitry Astapov +Date: Wed, 10 Mar 2021 23:47:56 +0000 +Subject: [PATCH] Allow building with hledger-lib version 1.21.x + +--- + Main.hs | 6 +++--- + hledger-interest.cabal | 4 ++-- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/Main.hs b/Main.hs +index 042da78..bb07b7b 100644 +--- a/Main.hs ++++ b/Main.hs +@@ -95,12 +95,12 @@ main = bracket (return ()) (\() -> hFlush stdout >> hFlush stderr) $ \() -> do + jnl' <- readJournalFiles ledgerInputOptions (reverse (optInput opts)) >>= either fail return + interestAcc <- case args of + [] -> commandLineError "required argument ACCOUNT is missing\n" +- [acc] -> return acc ++ [acc] -> return $ T.pack acc + _ -> commandLineError "only one interest ACCOUNT may be specified\n" + let jnl = filterJournalTransactions (Acct (toRegex' interestAcc)) jnl' + ts = sortOn tdate (jtxns jnl) + cfg = Config +- { interestAccount = T.pack interestAcc ++ { interestAccount = interestAcc + , sourceAccount = T.pack (optSourceAcc opts) + , targetAccount = T.pack (optTargetAcc opts) + , dayCountConvention = fromJust (optDCC opts) +@@ -114,4 +114,4 @@ main = bracket (return ()) (\() -> hFlush stdout >> hFlush stderr) $ \() -> do + result + | optVerbose opts = ts' ++ ts + | otherwise = ts' +- mapM_ (putStr . showTransactionUnelided) (sortOn tdate result) ++ mapM_ (putStr . T.unpack . showTransaction) (sortOn tdate result) From f0ad1b0b488a464c64b3009636e5ba265f9e4eddf42b2bd98661c5fa81f982d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Mon, 15 Mar 2021 12:28:22 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/hledger-interest?expand=0&rev=13 --- hledger.patch | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 hledger.patch diff --git a/hledger.patch b/hledger.patch deleted file mode 100644 index 1540b11..0000000 --- a/hledger.patch +++ /dev/null @@ -1,35 +0,0 @@ -From e0694605be0c89c9b97629a893696a7947dc7fcb Mon Sep 17 00:00:00 2001 -From: Dmitry Astapov -Date: Wed, 10 Mar 2021 23:47:56 +0000 -Subject: [PATCH] Allow building with hledger-lib version 1.21.x - ---- - Main.hs | 6 +++--- - hledger-interest.cabal | 4 ++-- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/Main.hs b/Main.hs -index 042da78..bb07b7b 100644 ---- a/Main.hs -+++ b/Main.hs -@@ -95,12 +95,12 @@ main = bracket (return ()) (\() -> hFlush stdout >> hFlush stderr) $ \() -> do - jnl' <- readJournalFiles ledgerInputOptions (reverse (optInput opts)) >>= either fail return - interestAcc <- case args of - [] -> commandLineError "required argument ACCOUNT is missing\n" -- [acc] -> return acc -+ [acc] -> return $ T.pack acc - _ -> commandLineError "only one interest ACCOUNT may be specified\n" - let jnl = filterJournalTransactions (Acct (toRegex' interestAcc)) jnl' - ts = sortOn tdate (jtxns jnl) - cfg = Config -- { interestAccount = T.pack interestAcc -+ { interestAccount = interestAcc - , sourceAccount = T.pack (optSourceAcc opts) - , targetAccount = T.pack (optTargetAcc opts) - , dayCountConvention = fromJust (optDCC opts) -@@ -114,4 +114,4 @@ main = bracket (return ()) (\() -> hFlush stdout >> hFlush stderr) $ \() -> do - result - | optVerbose opts = ts' ++ ts - | otherwise = ts' -- mapM_ (putStr . showTransactionUnelided) (sortOn tdate result) -+ mapM_ (putStr . T.unpack . showTransaction) (sortOn tdate result)