[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r18170: {tor} make it work with base64 base64 from coreutils is really pic (tor/trunk/contrib/directory-archive)



Author: weasel
Date: 2009-01-18 08:22:47 -0500 (Sun, 18 Jan 2009)
New Revision: 18170

Modified:
   tor/trunk/contrib/directory-archive/fetch-all
   tor/trunk/contrib/directory-archive/fetch-all-v3
Log:
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.

Modified: tor/trunk/contrib/directory-archive/fetch-all
===================================================================
--- tor/trunk/contrib/directory-archive/fetch-all	2009-01-18 13:22:45 UTC (rev 18169)
+++ tor/trunk/contrib/directory-archive/fetch-all	2009-01-18 13:22:47 UTC (rev 18170)
@@ -67,7 +67,7 @@
 	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";';

Modified: tor/trunk/contrib/directory-archive/fetch-all-v3
===================================================================
--- tor/trunk/contrib/directory-archive/fetch-all-v3	2009-01-18 13:22:45 UTC (rev 18169)
+++ tor/trunk/contrib/directory-archive/fetch-all-v3	2009-01-18 13:22:47 UTC (rev 18170)
@@ -100,7 +100,7 @@
 	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";';