summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason E. Hale <jhale@FreeBSD.org>2022-02-22 08:59:45 -0500
committerJason E. Hale <jhale@FreeBSD.org>2022-03-07 08:58:11 -0500
commitb34b6515e4daadd960ff7e992263656ce5383a06 (patch)
treee82a67fc303250e6a344aa46c64d5eb83a0bb7ab
parentmultimedia/onevpl: update to 2022.0.6 (diff)
finance/ktoblzcheck: Update bank data
Bank data is valid from 2022-03-07 - 2022-06-05. Update check digit calculation for methods 45, B1, and C2. Add check digit caluclation for method E4. MFH: 2022Q1 (cherry picked from commit 9b1fe5df80c20028de9847767cf144595ffa4ba7) (cherry picked from commit be1d9733d1258d1f1565412164f2844e3bd26679)
-rw-r--r--finance/ktoblzcheck/Makefile6
-rw-r--r--finance/ktoblzcheck/distinfo6
-rw-r--r--finance/ktoblzcheck/files/patch-src_lib_methods.cc83
3 files changed, 89 insertions, 6 deletions
diff --git a/finance/ktoblzcheck/Makefile b/finance/ktoblzcheck/Makefile
index e9ffd5d897d5..410f29269c9a 100644
--- a/finance/ktoblzcheck/Makefile
+++ b/finance/ktoblzcheck/Makefile
@@ -2,7 +2,7 @@
PORTNAME= ktoblzcheck
PORTVERSION= 1.53
-PORTREVISION= 2
+PORTREVISION= 4
CATEGORIES= finance german
MASTER_SITES= SF/${PORTNAME} \
LOCAL/jhale:bankdata
@@ -15,7 +15,7 @@ COMMENT= Check bank codes of German banks
LICENSE= LGPL21+
LICENSE_FILE= ${WRKSRC}/COPYING
-USES= cmake pathfix python:3.6+,build
+USES= cmake pathfix python:3.7+,build
USE_LDCONFIG= yes
CMAKE_ON= INSTALL_RAW_BANKDATA_FILE
@@ -24,7 +24,7 @@ CMAKE_OFF= ENABLE_BANKDATA_DOWNLOAD
PLIST_SUB= BANKDATA_DATE=${BANKDATA_DATE}
PORTDOCS= README.md
-BANKDATA_DATE= 20210308
+BANKDATA_DATE= 20220307
OPTIONS_DEFINE= DOCS DOXYGEN
OPTIONS_SUB= yes
diff --git a/finance/ktoblzcheck/distinfo b/finance/ktoblzcheck/distinfo
index 59e8f172731a..1ba71bbd02d3 100644
--- a/finance/ktoblzcheck/distinfo
+++ b/finance/ktoblzcheck/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1615403881
+TIMESTAMP = 1646591314
SHA256 (ktoblzcheck-1.53.tar.gz) = 18b9118556fe83240f468f770641d2578f4ff613cdcf0a209fb73079ccb70c55
SIZE (ktoblzcheck-1.53.tar.gz) = 531459
-SHA256 (ktoblzcheck-bankdata-20210308.tar.gz) = 935980f1d5001a90326e6fe2fc85efd46b5be32bf3402c54d2d7346bfc90eea9
-SIZE (ktoblzcheck-bankdata-20210308.tar.gz) = 308267
+SHA256 (ktoblzcheck-bankdata-20220307.tar.gz) = 87fb315c76756366a2c75abc6b078a06af93e3b90faf8044cf8c1c6436dc9466
+SIZE (ktoblzcheck-bankdata-20220307.tar.gz) = 302328
diff --git a/finance/ktoblzcheck/files/patch-src_lib_methods.cc b/finance/ktoblzcheck/files/patch-src_lib_methods.cc
new file mode 100644
index 000000000000..58e7293ef25e
--- /dev/null
+++ b/finance/ktoblzcheck/files/patch-src_lib_methods.cc
@@ -0,0 +1,83 @@
+Update methods 45, B1, and C2. Implement method E4.
+https://sourceforge.net/p/ktoblzcheck/code/merge-requests/14/
+
+--- src/lib/methods.cc.orig 2020-01-20 15:07:55 UTC
++++ src/lib/methods.cc
+@@ -530,15 +530,15 @@ AccountNumberCheck::Result method_44(const int *accoun
+ return algo01(11, weight, false, 10, account);
+ }
+
++// method 45 was extended for due-date 2018-06-04
+ AccountNumberCheck::Result method_45(const int *account, int *weight)
+ {
+- // some numbers do not have a checksum
+- if (0 == account[0] || 1 == account[4]) {
++ // accountIDs starting with "0" or "48" do not have a check digit
++ // accountIDs that have "1" as the fifth digit do not have a check digit
++ if (0 == account[0] || 1 == account[4] || (4 == account[0] && 8 == account[1])) {
+ return AccountNumberCheck::OK;
+ }
+-
+- number2Array("2121212120", weight);
+- return algo01(10, weight, true, 10, account);
++ return method_00(account, weight);
+ }
+
+ AccountNumberCheck::Result method_46(const int *account, int *weight)
+@@ -1644,13 +1644,13 @@ AccountNumberCheck::Result method_B0(const int *accoun
+ // Checked with Bundesbank-Testnumbers
+ AccountNumberCheck::Result method_B1(const int *account, int *weight)
+ {
+- number2Array("1371371370", weight);
+- if (AccountNumberCheck::OK == algo01(10, weight, false, 10, account)) {
+- return AccountNumberCheck::OK; // variant 1 (method "05")
++ if (AccountNumberCheck::OK == method_05(account, weight)) {
++ return AccountNumberCheck::OK; // variant 1
+ }
+- number2Array("1731731730", weight);
+- return algo01(10, weight, false, 10, account);
+- // variant 2 (method "01")
++ if (AccountNumberCheck::OK == method_01(account, weight)) {
++ return AccountNumberCheck::OK; // variant 2
++ }
++ return method_00(account, weight); //variant 3, extended for due-date 2017-06-05
+ }
+
+ // Added by Jens Gecius (new Method as of September 6th, 2004)
+@@ -1824,7 +1824,10 @@ AccountNumberCheck::Result method_C2(const int *accoun
+ if (AccountNumberCheck::OK == method_22(account, weight)) { // variant 1
+ return AccountNumberCheck::OK;
+ }
+- return method_00(account, weight); // variant 2
++ if (AccountNumberCheck::OK == method_00(account, weight)) { // variant 2
++ return AccountNumberCheck::OK;
++ }
++ return method_04(account, weight); // variant 3, extended for due-date 2017-09-04
+ }
+
+ // new method C3 and C4 valid from March 5th, 2007, checked with Bundesbank-Testnumbers
+@@ -2190,6 +2193,16 @@ AccountNumberCheck::Result method_E3(const int *accoun
+ return method_21(account, weight); // variant 2
+ }
+
++// new method E4 valid from 2017-06-05
++// checked with Bundesbank-Testnumbers
++AccountNumberCheck::Result method_E4(const int *account, int *weight)
++{
++ if (AccountNumberCheck::OK == method_02(account, weight)) { // variant 1
++ return AccountNumberCheck::OK;
++ }
++ return method_00(account, weight); // variant 2
++}
++
+ struct method_func_s {
+ const char *str;
+ AccountNumberCheck::MethodFunc func;
+@@ -2337,6 +2350,7 @@ const struct method_func_s cb_funcs[] = {
+ { "E1", method_E1},
+ { "E2", method_E2},
+ { "E3", method_E3},
++ { "E4", method_E4},
+ { 0, 0} // Important: The array has to end with the {0,0} entry,
+ // otherwise initMethodMap() will runaway and crash!
+ };