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

[vidalia-svn] r1623: Add a --notimestamp option to build a packaged geoip-cache w (in trunk: . pkg)



Author: edmanm
Date: 2007-01-29 21:18:36 -0500 (Mon, 29 Jan 2007)
New Revision: 1623

Modified:
   trunk/
   trunk/pkg/build-geoip-cache.sh
Log:
 r1645@adrastea:  edmanm | 2007-01-29 21:15:11 -0500
 Add a --notimestamp option to build a packaged geoip-cache without timestamps.



Property changes on: trunk
___________________________________________________________________
 svk:merge ticket from /vidalia/local/trunk [r1645] on 54b3572a-7227-0410-958f-53ecd705b71a

Modified: trunk/pkg/build-geoip-cache.sh
===================================================================
--- trunk/pkg/build-geoip-cache.sh	2007-01-30 02:18:24 UTC (rev 1622)
+++ trunk/pkg/build-geoip-cache.sh	2007-01-30 02:18:36 UTC (rev 1623)
@@ -25,8 +25,13 @@
 DIRURL="http://tor.noreply.org/tor/status/all";
 GEOIPURL="http://geoip.vidalia-project.net/cgi-bin/geoip";
 CACHEFILE="geoip-cache"
-timestamp=$(date -u +%s)
 
+if [ "$1" == "-notimestamp" -o "$1" == "--notimestamp" ]; then
+  timestamp=""
+else
+  timestamp=":$(date +%s)"
+fi
+
 # Fetch a list of server IP addresses
 ipaddrs=$(wget -q -O - "$DIRURL" | awk '$1 == "r" { print $7 }' | sort | uniq | tr "\n" ",")
 
@@ -37,6 +42,6 @@
 IFS=$'\n'
 rm -f $CACHEFILE
 for geoip in $geoips; do
-  echo "$geoip:$timestamp" >> "$CACHEFILE"
+  echo "$geoip""$timestamp" >> "$CACHEFILE"
 done