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

[tor-commits] [ooni-probe/master] Improve pip installation



commit 9e093b2c6200627907e7035f4521c622819d2743
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Fri Jul 3 17:36:57 2015 +0200

    Improve pip installation
    
    * Fix some shell bugs
---
 scripts/install.sh |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/scripts/install.sh b/scripts/install.sh
index 3c9fa82..46a6afa 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -131,7 +131,7 @@ install_obfs4proxy() {
 }
 
 install_pluggable_transports() {
-  if [ -z "$INSTALL_PT" ];then
+  if [ "$INSTALL_PT" = "yes" ];then
     (
       set -x
       $sh_c 'pip install obfsproxy fteproxy'
@@ -140,13 +140,18 @@ install_pluggable_transports() {
   fi
 }
 
+install_pip() {
+  $curl https://bootstrap.pypa.io/get-pip.py > /tmp/get-pip.py
+  $sh_c "python /tmp/get-pip.py > /dev/null 2>&1"
+}
+
 case "$lsb_dist" in
 	Fedora)
 		(
 			set -x
       $sh_c 'yum -y groupinstall "Development tools"'
       $sh_c 'yum -y install zlib-devel bzip2-devel openssl-devel sqlite-devel libpcap-devel libffi-devel libevent-devel libgeoip-devel tor'
-      $sh_c "$curl https://bootstrap.pypa.io/get-pip.py | python"
+      install_pip
       $sh_c 'pip install ooniprobe'
 		)
 
@@ -182,13 +187,15 @@ case "$lsb_dist" in
       $sh_c 'apt-get update'
     )
 
-    if [ "$lsb_dist" == 'Debian' ] && 
+    install_pip
+
+    if [ "$lsb_dist" = 'Debian' ] && 
       [ "$(echo $distro_version | cut -d '.' -f1 )" -gt $MIN_DEBIAN_VERSION ]; then
       (
         set -x
         $sh_c 'apt-get install -y -q ooniprobe'
       )
-    elif [ "$lsb_dist" == 'Ubuntu' ] &&
+    elif [ "$lsb_dist" = 'Ubuntu' ] &&
       [ "$(echo $distro_version | cut -d '.' -f1 )" -gt $MIN_UBUNTU_VERSION ]; then
       (
         set -x
@@ -198,7 +205,6 @@ case "$lsb_dist" in
       (
         set -x
         $sh_c 'apt-get install -y -q curl git-core python python-dev python-setuptools build-essential libdumbnet1 python-dumbnet python-libpcap tor tor-geoipdb libgeoip-dev libpcap0.8-dev libssl-dev libffi-dev libdumbnet-dev'
-        $sh_c "$curl https://bootstrap.pypa.io/get-pip.py | python"
         $sh_c 'pip install ooniprobe'
       )
     fi



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits