[tor-commits] [ooni-probe/master] added precise and squeeze support to setup-dependencies.sh

art at torproject.org art at torproject.org
Thu Aug 15 17:29:47 UTC 2013


commit 7e6bc883c0c0cbb99c152d9389994ded42e04de8
Author: Stephen Caraher <moskvax at gmail.com>
Date:   Wed Feb 27 21:45:05 2013 +1100

    added precise and squeeze support to setup-dependencies.sh
---
 setup-dependencies.sh |   30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/setup-dependencies.sh b/setup-dependencies.sh
index c4f356f..cdbd0f0 100755
--- a/setup-dependencies.sh
+++ b/setup-dependencies.sh
@@ -1,16 +1,19 @@
 #!/bin/bash
+trap 'sudo -k && exit 1' INT
 
 # Discover our Distro release
 RELEASE="`lsb_release -c|cut -f 2`";
-TOR_DEB_REPO="deb.torproject.org/torproject.org";
+TOR_DEB_REPO="http://deb.torproject.org/torproject.org";
 
-echo "sudo is annoying, tell us your password once and sudo won't annoy you for the rest of this process...";
-sudo echo "if you read this, we won't ask for your password again during this process unless something goes wrong";
+case $RELEASE in
+  natty|wheezy|squeeze|precise)
+
+  echo "sudo is annoying, tell us your password once and sudo won't annoy you for the rest of this process...";
+  sudo echo "if you read this, we won't ask for your password again during this process unless something goes wrong";
 
-# This is for Ubuntu's natty
-if [ $RELEASE = "natty" ] || [ $RELEASE = "wheezy" ]; then
   # Add Tor repo
   HAVE_GPG_KEY="`sudo apt-key finger|grep 'A3C4 F0F9 79CA A22C DBA8  F512 EE8C BC9E 886D DD89'|head -n 1`";
+  echo "Checking for torproject.org Debian repository key..."
   if [ -z "$HAVE_GPG_KEY" ]; then
     echo "It appears that you do not have the torproject.org Debian repository key installed; installing it...";
     cat apt.key | sudo apt-key add -;
@@ -21,7 +24,11 @@ if [ $RELEASE = "natty" ] || [ $RELEASE = "wheezy" ]; then
   HAVE_TOR_REPO="`grep deb.torproject.org/torproject.org /etc/apt/sources.list /etc/apt/sources.list.d/* 2>&1|grep torproject|head -n 1`";
   if [ -z "$HAVE_TOR_REPO" ]; then
     echo "It appears that you do not have the torproject.org Debian repository installed; installing it...";
-    sudo apt-add-repository "deb $TOR_DEB_REPO $RELEASE main";
+     if [ $RELEASE = "squeeze" ]; then
+       (echo -e "deb $TOR_DEB_REPO $RELEASE main\ndeb-src $TOR_DEB_REPO $RELEASE main" | sudo tee -a /etc/apt/sources.list) > /dev/null
+     else
+       sudo apt-add-repository "deb $TOR_DEB_REPO $RELEASE main"
+     fi
   else
     echo "It appears that you have the torproject.org Debian repository installed!";
   fi
@@ -34,7 +41,7 @@ if [ $RELEASE = "natty" ] || [ $RELEASE = "wheezy" ]; then
 
   if [ ! -f ~/.virtualenvs/ooniprobe/bin/activate ]; then
     # Set up the virtual environment
-    mkdir ~/.virtualenvs/
+    mkdir -p ~/.virtualenvs
     virtualenv ~/.virtualenvs/ooniprobe
     source ~/.virtualenvs/ooniprobe/bin/activate
   else
@@ -74,10 +81,9 @@ if [ $RELEASE = "natty" ] || [ $RELEASE = "wheezy" ]; then
   echo "  fi";
   echo ;
 
-else
-
+  ;;
+*)
   echo "It appears that you are using an unsupported OS - please tell us";
   echo "by filing a bug: https://trac.torproject.org/projects/tor/newticket";
-
-fi
-
+  ;;
+esac





More information about the tor-commits mailing list