From: Paul Hänsch Date: Sun, 12 May 2024 14:43:28 +0000 (+0200) Subject: simplified pipeline protocol X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=df20f046b4ff4e58a5b93ce152926325c7e15767;p=confetti simplified pipeline protocol --- diff --git a/ledgers/iban_assign.awk b/ledgers/iban_assign.awk index 68a5727..57ab62d 100755 --- a/ledgers/iban_assign.awk +++ b/ledgers/iban_assign.awk @@ -1,5 +1,7 @@ #!/bin/awk -f +function dbg( text ) { print text >>"/dev/stderr"; } + function STRING( inp ) { gsub(/\\/, "\\\\", inp); gsub(/\n/, "\\n", inp); @@ -52,7 +54,7 @@ BEGIN { fn = n = uid = iban = tmp = ""; split("", ibans); } -strftime("%Y-%m-%d", $1, "UTC") == $2 && strftime("%Y-%m-%d", $3, "UTC") == $4 { ledger = 1; } +/^BEGIN:LEDGERS$/ { ledger = 1; } ledger && strftime("%Y-%m-%d", $2, "UTC") == $1 { if ($3 in iban_uid) { diff --git a/ledgers/index.cgi b/ledgers/index.cgi index 685ee85..f55850d 100755 --- a/ledgers/index.cgi +++ b/ledgers/index.cgi @@ -41,6 +41,7 @@ credit() { printf ']' l10n_attendant="$(l10n attendant)" { pdi_load "${_DATA}"/vcard/*.vcf + printf 'BEGIN:LEDGERS\n' cat "${_DATA}"/ledgers/????-??-??\ -\ ????-??-??\ -\ ????.tbl } | "${_EXEC}"/ledgers/iban_assign.awk \ | while read -r state iban data; do