[tor-commits] [ooni-probe/master] Run ooniresources only in post install

art at torproject.org art at torproject.org
Wed Feb 4 13:27:16 UTC 2015


commit f5ee5e39c337c31e75e011fc7dcec4e3cc8e342c
Author: Arturo Filastò <art at fuffa.org>
Date:   Wed Feb 4 12:39:21 2015 +0100

    Run ooniresources only in post install
    
    Fix inclusion of inputs in MANIFEST
---
 MANIFEST.in |    2 +-
 setup.py    |   16 +++++++++-------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/MANIFEST.in b/MANIFEST.in
index 71c4a58..920f933 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,6 +1,6 @@
 include README.rst ChangeLog.rst requirements.txt LICENSE
 recursive-include data/decks *
-include data/inputs/
+recursive-include data/inputs *
 include data/oonideckgen.1
 include data/ooniprobe.1
 include data/oonireport.1
diff --git a/setup.py b/setup.py
index 62335d9..54ec4ee 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ from ConfigParser import SafeConfigParser
 from os.path import join as pj
 from setuptools import setup
 from setuptools.command.install import install as _st_install
-
+from distutils.spawn import find_executable
 
 class install(_st_install):
     def gen_config(self, share_path):
@@ -67,11 +67,18 @@ class install(_st_install):
         except OSError:
             pass
 
+    def ooniresources(self):
+        ooniresources = find_executable("ooniresources")
+        from subprocess import Popen, PIPE
+        process = Popen([ooniresources, '--update-inputs', '--update-geoip'],
+                        stdout=sys.stdout.fileno(), stderr=sys.stderr.fileno())
+        process.wait()
+
     def run(self):
         prefix = os.path.abspath(self.prefix)
         self.set_data_files(prefix)
         self.do_egg_install()
-
+        self.ooniresources()
 
 install_requires = []
 dependency_links = []
@@ -163,8 +170,3 @@ setup(
         "Topic :: System :: Networking :: Monitoring",
     )
 )
-
-from subprocess import Popen, PIPE
-process = Popen(['ooniresources', '--update-inputs', '--update-geoip'],
-                stdout=sys.stdout.fileno(), stderr=sys.stderr.fileno())
-process.wait()





More information about the tor-commits mailing list