commit 30b2667b7444c1e05f225f9bae9ed32c65565932
parent 8e9fef99243ed1fe29a8dc363fa3225f2aa42001
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Mon, 26 Sep 2016 23:52:33 +0200
use base64
Diffstat:
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/svn-poll b/svn-poll
@@ -9,12 +9,11 @@
URL="$1"
USER="$2"
-# TODO: use base64 instead, what was I thinking...
-HASH=$(sha1sum <<<"$URL" | awk '{print $1}')
-DIR="$HOME/temp/svn-poll"
-FILE="$DIR/$HASH.rev"
-MUTEFILE="$DIR/$HASH.muted"
-URLFILE="$DIR/$HASH.url"
+BASE=$(base64 <<<"$URL")
+DIR="$HOME/temp/svn-poll/$BASE"
+FILE="$DIR/rev"
+MUTEFILE="$DIR/muted"
+URLFILE="$DIR/url"
mkdir -p "$DIR"
diff --git a/svn-poll-drop b/svn-poll-drop
@@ -3,9 +3,9 @@
# say we are interested again in $URL
URL="$1"
-HASH=$(sha1sum <<<"$URL" | awk '{print $1}')
-DIR="$HOME/temp/svn-poll"
-MUTEFILE="$DIR/$HASH.muted"
+BASE=$(base64 <<<"$URL")
+DIR="$HOME/temp/svn-poll/$BASE"
+MUTEFILE="$DIR/muted"
rm -f "$MUTEFILE"
diff --git a/svn-poll-init b/svn-poll-init
@@ -4,10 +4,10 @@
# inits to the current revision in an unmuted state
URL="$1"
-HASH=$(sha1sum <<<"$URL" | awk '{print $1}')
-DIR="$HOME/temp/svn-poll"
-FILE="$DIR/$HASH.rev"
-URLFILE="$DIR/$HASH.url"
+BASE=$(base64 <<<"$URL")
+DIR="$HOME/temp/svn-poll/$BASE"
+FILE="$DIR/rev"
+URLFILE="$DIR/url"
mkdir -p "$DIR"