[tarent-useful-scripts SCM] {mirkarte} branch master updated. 75b785db654277c78e460aab408806bc5e36a8c3

mirabilos at evolvis.org mirabilos at evolvis.org
Sat Oct 4 23:52:00 CEST 2014 • <20141004215201.0748A4A2557@evolvis.org>


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 "MirKarte source code repository".

The branch, master has been updated
       via  75b785db654277c78e460aab408806bc5e36a8c3 (commit)
      from  320e262af00f34aa75e3ed9e38d405467d6b2b46 (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 75b785db654277c78e460aab408806bc5e36a8c3
Author: Thorsten Glaser <tg at mirbsd.org>
Date:   Sat Oct 4 21:52:11 2014 +0000

    correct algorithm for ghtomorrow hash (oops)

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

Summary of changes:
 geohashing.cgi |   16 ++++++++++------
 ghtomorrow.cgi |   16 ++++++++++------
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/geohashing.cgi b/geohashing.cgi
index 4c0e38d..7d50512 100755
--- a/geohashing.cgi
+++ b/geohashing.cgi
@@ -176,15 +176,14 @@ function mjd_implode {
 
 # end magic from mirtime.c
 
+typeset -i10 -Z4 dY
+typeset -i10 -Z2 dM dD
+
 # force hash to use Central European Time (possibly with DST)
 # for calculation, and always apply the 30W rule
-set -A d -- $(TZ=Europe/Berlin date +'%Y %m %d %F')
+set -A d -- $(TZ=Europe/Berlin date +'%Y %m %d')
 set -A t -- $(mjd_implode 0 0 0 ${d[2]} $((d[1] - 1)) $((d[0] - 1900)))
 set -A t -- $(mjd_explode $((t[0] - 1)) 0)
-
-typeset -i10 -Z4 dY
-typeset -i10 -Z2 dM dD
-
 (( dY = t[tm_year] + 1900 ))
 (( dM = t[tm_mon] + 1 ))
 (( dD = t[tm_mday] ))
@@ -215,7 +214,12 @@ Content-type: text/html; charset=utf-8
 EOF
 	exit 0
 fi
-set -A latlon -- $(print -nr -- "${d[3]}-$i" | $md | \
+set -A t -- $(mjd_implode 0 0 0 ${d[2]} $((d[1] - 1)) $((d[0] - 1900)))
+set -A t -- $(mjd_explode $((t[0])) 0)
+(( dY = t[tm_year] + 1900 ))
+(( dM = t[tm_mon] + 1 ))
+(( dD = t[tm_mday] ))
+set -A latlon -- $(print -nr -- "$dY-$dM-$dD-$i" | $md | \
     sed -e 'y/abcdef/ABCDEF/' -e 's/.\{16\}/.&p/g' | \
     dc -e 16i -)
 
diff --git a/ghtomorrow.cgi b/ghtomorrow.cgi
index b0cb563..58d325b 100755
--- a/ghtomorrow.cgi
+++ b/ghtomorrow.cgi
@@ -176,15 +176,14 @@ function mjd_implode {
 
 # end magic from mirtime.c
 
+typeset -i10 -Z4 dY
+typeset -i10 -Z2 dM dD
+
 # force hash to use Central European Time (possibly with DST)
 # for calculation, and always apply the 30W rule
-set -A d -- $(TZ=Europe/Berlin date +'%Y %m %d %F')
+set -A d -- $(TZ=Europe/Berlin date +'%Y %m %d')
 set -A t -- $(mjd_implode 0 0 0 ${d[2]} $((d[1] - 1)) $((d[0] - 1900)))
 set -A t -- $(mjd_explode $((t[0] + 1 - 1)) 0)
-
-typeset -i10 -Z4 dY
-typeset -i10 -Z2 dM dD
-
 (( dY = t[tm_year] + 1900 ))
 (( dM = t[tm_mon] + 1 ))
 (( dD = t[tm_mday] ))
@@ -215,7 +214,12 @@ Content-type: text/html; charset=utf-8
 EOF
 	exit 0
 fi
-set -A latlon -- $(print -nr -- "${d[3]}-$i" | $md | \
+set -A t -- $(mjd_implode 0 0 0 ${d[2]} $((d[1] - 1)) $((d[0] - 1900)))
+set -A t -- $(mjd_explode $((t[0] + 1)) 0)
+(( dY = t[tm_year] + 1900 ))
+(( dM = t[tm_mon] + 1 ))
+(( dD = t[tm_mday] ))
+set -A latlon -- $(print -nr -- "$dY-$dM-$dD-$i" | $md | \
     sed -e 'y/abcdef/ABCDEF/' -e 's/.\{16\}/.&p/g' | \
     dc -e 16i -)
 


hooks/post-receive
-- 
MirKarte source code repository
(Evolvis project useful-scripts repository mirkarte)


More information about the useful-scripts-commits mailing list