aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2009-01-18 13:22:47 +0000
committerPeter Palfrader <peter@palfrader.org>2009-01-18 13:22:47 +0000
commit1c70922491173a86fcdb0a0f862feb69d3dae397 (patch)
tree1c7064067ed3aa5147b52fa90bfbe4b5a61cc04b
parent804f2dd7165997dec896965f141898ec6415edc3 (diff)
downloadtor-1c70922491173a86fcdb0a0f862feb69d3dae397.tar.gz
tor-1c70922491173a86fcdb0a0f862feb69d3dae397.zip
make it work with base64
base64 from coreutils is really picky about the number of equation marks (=) that end a base64 encoded string. Unfortunately Tor doesn't believe they are important at all so it cuts them all off all the time. For perl purposes we just added a good measure of = and were happy about it. For base64 we now need to add the proper number of equation marks. It turns out that number is 1 for the length of strings we process. svn:r18170
-rwxr-xr-xcontrib/directory-archive/fetch-all2
-rwxr-xr-xcontrib/directory-archive/fetch-all-v32
2 files changed, 2 insertions, 2 deletions
diff --git a/contrib/directory-archive/fetch-all b/contrib/directory-archive/fetch-all
index 745c0609b4..fabcbb8bc4 100755
--- a/contrib/directory-archive/fetch-all
+++ b/contrib/directory-archive/fetch-all
@@ -67,7 +67,7 @@ if [ "$statuses" = "" ]; then
exit 1
fi
-digests=$( for i in ` bzcat $statuses | awk '$1 == "r" {printf "%s===\n", $4}' | sort -u `; do
+digests=$( for i in ` bzcat $statuses | awk '$1 == "r" {printf "%s=\n", $4}' | sort -u `; do
echo $i | \
base64-decode | \
perl -e 'undef $/; $a=<>; print unpack("H\*", $a),"\n";';
diff --git a/contrib/directory-archive/fetch-all-v3 b/contrib/directory-archive/fetch-all-v3
index 73c24534bb..02b3d5d9e8 100755
--- a/contrib/directory-archive/fetch-all-v3
+++ b/contrib/directory-archive/fetch-all-v3
@@ -100,7 +100,7 @@ for vote in $votes; do
fi
done
-digests=$( for i in ` bzcat $consensus | awk '$1 == "r" {printf "%s===\n", $4}' | sort -u `; do
+digests=$( for i in ` bzcat $consensus | awk '$1 == "r" {printf "%s=\n", $4}' | sort -u `; do
echo $i | \
base64-decode | \
perl -e 'undef $/; $a=<>; print unpack("H\*", $a),"\n";';