[git] gnupg-doc - branch, preview, updated. 0d64d3a1232e0c8a04f7b6a8fddfe9d092013c75

by Werner Koch cvs at cvs.gnupg.org
Fri May 12 12:37:18 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GnuPG website and other docs".

The branch, preview has been updated
       via  0d64d3a1232e0c8a04f7b6a8fddfe9d092013c75 (commit)
      from  570b0a54c703d38d87a01d62dfe6fa60a58f152a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0d64d3a1232e0c8a04f7b6a8fddfe9d092013c75
Author: Werner Koch <wk at gnupg.org>
Date:   Fri May 12 12:34:07 2017 +0200

    tools: Insert thousands-separators
    
    Note that this requires gawk.

diff --git a/tools/append-to-donors.sh b/tools/append-to-donors.sh
index 1c5667d..0145c5c 100755
--- a/tools/append-to-donors.sh
+++ b/tools/append-to-donors.sh
@@ -143,10 +143,15 @@ send_thanks () {
     else
       xqpmail=$(mu-tool 2047 -c utf-8 "$xmail")
     fi
+    if [ $testmode = yes ]; then
+      xisatest="[TEST DONATION] "
+    else
+      xisatest=""
+    fi
     ( cat <<EOF
 From: donations at gnupg.org
 To: $xqpmail
-Subject: Thank you for supporting GnuPG
+Subject: ${xisatest}Thank you for supporting GnuPG
 Date: $RFCDATE
 Mime-Version: 1.0
 Content-Type: text/plain
@@ -159,7 +164,7 @@ Your donation helps us to develop and maintain GnuPG and related software.
 
 Thank you.
 
-  Werner
+  The GnuPG Team
 
 
 $SIGDELIM
@@ -212,6 +217,7 @@ find $journal_dir/ -type f -name 'journal-????????.log' -print \
     jyear=$(echo $jdate |sed 's/\(....\).*/\1/')
     if [ "$jdate" -ge "$lastdate" ]; then
         [ "$jdate" -gt "$lastdate" ] && lastline=0
+        # First for charge records
         payproc-jrnl -F_lnr -Fdate -F'[name]' -F'[message]' \
                      -Fmail -Famount -Fcurrency -Feuro\
            -S "_lnr > $lastline" -Stype=C -Saccount==1 \
@@ -226,6 +232,21 @@ find $journal_dir/ -type f -name 'journal-????????.log' -print \
             touch "$donors".stamp
             send_thanks
          done
+        # Second for new subscriptions
+        payproc-jrnl -F_lnr -Fdate -F'[name]' -F'[message]' \
+                     -Fmail -Famount -Fcurrency -Feuro -Frecur\
+           -S "_lnr > $lastline" -Stype=S -Saccount==1 \
+           --html --print "$journal_dir/journal-$jdate.log" \
+         | while IFS=: read lnr datestr name message \
+                            xmail amount currency euro recur rest; do
+            name=$(echo "$name" | tr \`\$: ...)
+            message=$(echo "$message" | tr \`\$ ..)
+            xmail=$(echo "$xmail" | tr \`\$ .. | sed 's/\.$//')
+            # Note that we removed colons from $name
+            echo "$jyear:$datestr:$name:S:$lnr:" >> "$donors.tmp"
+            touch "$donors".stamp
+            send_thanks
+         done
     fi
 done
 
diff --git a/tools/mkkudos.sh b/tools/mkkudos.sh
index 9858816..613caf3 100755
--- a/tools/mkkudos.sh
+++ b/tools/mkkudos.sh
@@ -145,7 +145,7 @@ thisyear=$(echo "$tmp" | awk -F: '{print $1}')
 nyr=$(echo "$tmp" | awk -F: '{printf "%d", $9}')
 euroyr=$(echo "$tmp" | awk -F: '{printf "%d", int($10 + 0.5)}')
 recur_nyr=$(echo "$tmp" | awk -F: '{printf "%d", $13}')
-recur_euroyr=$(echo "$tmp" | awk -F: '{printf "%d", int($14 + 0.5)}')
+recur_euroyr=$(echo "$tmp" | awk -F: '{printf "%d", int($14 + 0.5)/12}')
 
 dontable=$(awk -F: <"$donations" -v thisyear="$thisyear" '
   BEGIN { m[1] = "January";
@@ -215,7 +215,8 @@ for file in "$htdocs/donate/"kudos-????.html "$htdocs/donate/"kudos.html \
    fi
    [ $verbose = yes ] && echo "processing $file" >&2
    [ -f "$file.tmp" ] && rm "$file.tmp"
-   awk -F: -v year=$year -v donors="$donors" -v dontable="$dontable" \
+   # We need gawk to use "%'d" in inprint
+   gawk -F: -v year=$year -v donors="$donors" -v dontable="$dontable" \
            -v monyear="$monyear" -v thisyear="$thisyear" \
            -v euro="$euro" -v euroyr="$euroyr" \
            -v nyr="$nyr" -v goal="$goal" -v percent="$percent" \
@@ -285,20 +286,20 @@ for file in "$htdocs/donate/"kudos-????.html "$htdocs/donate/"kudos.html \
      }
      /<!--CMPGN-RECUR-EURO-->/ {
            n = index($0,"<!--CMPGN");
-           printf "%s!--CMPGN-RECUR-EURO-->%s €\n",
-                  substr($0,1,n), recur_euroyr;
+           printf "%s!--CMPGN-RECUR-EURO-->%'"'"'d €\n",
+                  substr($0,1,n), int(recur_euroyr);
            next
      }
      /<!--CMPGN-RECUR-EURO-GOAL-->/ {
            n = index($0,"<!--CMPGN");
-           printf "%s!--CMPGN-RECUR-EURO-GOAL-->%s €\n",
-                  substr($0,1,n), recur_goal;
+           printf "%s!--CMPGN-RECUR-EURO-GOAL-->%'"'"'d €\n",
+                  substr($0,1,n), int(recur_goal);
            next
      }
      /<!--CMPGN-ONCE-EURO-->/ {
            n = index($0,"<!--CMPGN");
-           printf "%s!--CMPGN-ONCE-EURO-->%s €\n",
-                  substr($0,1,n), euroyr;
+           printf "%s!--CMPGN-ONCE-EURO-->%'"'"'d €\n",
+                  substr($0,1,n), int(euroyr);
            next
      }
      /<!--CMPGN-RECUR-COUNT-->/ {

-----------------------------------------------------------------------

Summary of changes:
 tools/append-to-donors.sh | 25 +++++++++++++++++++++++--
 tools/mkkudos.sh          | 17 +++++++++--------
 2 files changed, 32 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
The GnuPG website and other docs
http://git.gnupg.org




More information about the Gnupg-commits mailing list