[or-cvs] r23802: {arm} Finally ending my war with distutils and installing arm to ' (in arm/trunk: . src)

Damian Johnson atagar1 at gmail.com
Mon Nov 15 05:46:25 UTC 2010


Author: atagar
Date: 2010-11-15 05:46:24 +0000 (Mon, 15 Nov 2010)
New Revision: 23802

Modified:
   arm/trunk/arm
   arm/trunk/install
   arm/trunk/setup.py
   arm/trunk/src/uninstall
Log:
Finally ending my war with distutils and installing arm to '/usr/share/pyshared'.
Custom locations are against the grain for distutils and there is no way of generating a build without its accursed egg-info metadata (which in turn causes lintian errors when installing to '/usr/share'). I suppose this location isn't the end of the world. Arm will have plenty of friends in /usr/share/pyshared to keep it company...



Modified: arm/trunk/arm
===================================================================
--- arm/trunk/arm	2010-11-15 04:34:55 UTC (rev 23801)
+++ arm/trunk/arm	2010-11-15 05:46:24 UTC (rev 23802)
@@ -1,6 +1,6 @@
 #!/bin/sh
 if [ $0 = /usr/bin/arm ]; then
-  arm_base=/usr/share/arm/
+  arm_base=/usr/share/pyshared/arm/
 else
   arm_base=$( dirname $0 )/src/
 fi

Modified: arm/trunk/install
===================================================================
--- arm/trunk/install	2010-11-15 04:34:55 UTC (rev 23801)
+++ arm/trunk/install	2010-11-15 05:46:24 UTC (rev 23802)
@@ -2,11 +2,11 @@
 python src/prereq.py
 
 if [ $? = 0 ]; then
-  python setup.py -q install
+  python setup.py -q install --install-purelib /usr/share/pyshared
   
   # provide notice if we installed successfully
   if [ $? = 0 ]; then
-    echo "installed to /usr/share/arm"
+    echo "installed to /usr/share/pyshared/arm"
   fi
   
   # cleans up the automatically built temporary files

Modified: arm/trunk/setup.py
===================================================================
--- arm/trunk/setup.py	2010-11-15 04:34:55 UTC (rev 23801)
+++ arm/trunk/setup.py	2010-11-15 05:46:24 UTC (rev 23802)
@@ -5,16 +5,6 @@
 from src.version import VERSION
 from distutils.core import setup
 
-# Provides the configuration option to install to "/usr/share" rather than as a
-# python module. Alternatives are to either provide this as an input argument
-# (not an option for deb/rpm builds) or add a setup.cfg with:
-#   [install]
-#   install-purelib=/usr/share
-# which would mean a bit more unnecessary clutter.
-
-if "install" in sys.argv:
-  sys.argv += ["--install-purelib", "/usr/share"]
-
 # Compresses the man page. This is a temporary file that we'll install. If
 # something goes wrong then we'll print the issue and use the uncompressed man
 # page instead.
@@ -44,7 +34,7 @@
       package_dir={'arm': 'src'},
       data_files=[("/usr/bin", ["arm"]),
                   ("/usr/share/man/man1", [manFilename]),
-                  ("/usr/share/arm", ["src/settings.cfg"])],
+                  ("/usr/share/pyshared/arm", ["src/settings.cfg"])],
      )
 
 # Cleans up the temporary compressed man page.
@@ -52,12 +42,3 @@
   if "-q" not in sys.argv: print "Removing %s" % manFilename
   os.remove(manFilename)
 
-# Removes the egg_info file. Apparently it is not optional during setup
-# (hardcoded in distutils/command/install.py), nor are there any arguments to
-# bypass its creation.
-# TODO: not sure how to remove this from the deb build too...
-eggPath = '/usr/share/arm-%s.egg-info' % VERSION
-if os.path.isfile(eggPath):
-  if "-q" not in sys.argv: print "Removing %s" % eggPath
-  os.remove(eggPath)
-

Modified: arm/trunk/src/uninstall
===================================================================
--- arm/trunk/src/uninstall	2010-11-15 04:34:55 UTC (rev 23801)
+++ arm/trunk/src/uninstall	2010-11-15 05:46:24 UTC (rev 23802)
@@ -1,5 +1,5 @@
 #!/bin/sh
-files="/usr/bin/arm /usr/share/man/man1/arm.1.gz /usr/share/arm"
+files="/usr/bin/arm /usr/share/man/man1/arm.1.gz /usr/share/pyshared/arm"
 
 for i in $files 
 do



More information about the tor-commits mailing list