From 24915c91a15906c50121656da17230123aee48d1 Mon Sep 17 00:00:00 2001 From: Mac Mollison Date: Sat, 27 Mar 2010 17:29:35 -0400 Subject: Update installer: Install in ~/bin This provides two advantages: (1) Don't need root to install unit-trace (2) Someone messing with the unit-trace code on a shared machine won't mess up anyone else who's also using unit-trace on that machine --- install.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'install.py') diff --git a/install.py b/install.py index b06462c..af42b71 100755 --- a/install.py +++ b/install.py @@ -8,9 +8,8 @@ # the unit_trace library can be imported with `import unit_trace` by a Python # script, from anywhere on the system. -# The installation merely consists of copying the unit_trace directory to -# the default site_packages directory (which is the appropriate place to -# install Python packages). +# The installation merely copies the unit-trace script and the unit_trace +# folder to ~/bin. You can also do this manually if you want to. # We do not use the Distutils system, provided by Python, because that # is less convenient :-) @@ -30,7 +29,8 @@ import os ################################################################################ # Determine destination directory for unit_trace module -dst = os.path.join(sys.prefix,'lib/python2.6/site-packages/unit_trace') +dst = '~/bin/unit_trace' +dst = os.path.expanduser(dst) try: # If the destination exists @@ -40,17 +40,18 @@ try: # Copy source to destination shutil.copytree('unit_trace', dst) except: - print("Error occurred. Make sure you run the script as root/with sudo.") + print("Error occurred.") exit() # Determine destination directory for unit-trace script -dst = '/usr/bin/unit-trace' +dst = '~/bin/unit-trace' +dst = os.path.expanduser(dst) try: shutil.copyfile('unit-trace', dst) # Keep same permissions shutil.copystat('unit-trace', dst) except: - print("Error occurred. Make sure you run the script as root/with sudo.") + print("Error occurred.") exit() -- cgit v1.2.2