changeset 131:52cf3e146a4c

make the install script slightly nicer
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 22 Mar 2011 17:47:42 -0700
parents c61997cf17b0
children 40b670219789
files python/install_config.py
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/python/install_config.py	Tue Mar 22 11:40:03 2011 -0700
+++ b/python/install_config.py	Tue Mar 22 17:47:42 2011 -0700
@@ -7,14 +7,15 @@
 
 SRC='http://k0s.org/hg/config'
 import os
+import subprocess
 import sys
+
+# go home
 HOME=os.environ['HOME']
 os.chdir(HOME)
 
-# make the current directory a repository
-import subprocess
-
-commands = [ ['hg', 'init'],
+commands = [ # make the home directory a repository
+             ['hg', 'init'],
              ['hg', 'pull', SRC],
              ['hg', 'update', '-C'],
 
@@ -29,6 +30,7 @@
              ]
 
 def execute(*commands):
+    """execute a series of commands"""
     for command in commands:
         print ' '.join(command)
         code = subprocess.call(command)
@@ -36,6 +38,8 @@
             sys.exit(code)
 
 execute(*commands)
+
+# make a (correct) .hg/hgrc file for $HOME
 subprocess.call('/bin/echo -e "[paths]\\ndefault = http://k0s.org/hg/config\\ndefault-push = ssh://k0s.org/hg/config" > ~/.hg/hgrc', shell=True)
 
 def install_develop(package):
@@ -53,14 +57,15 @@
     
 # install some python
 install_develop('smartopen')
-install_develop('silvermirror')
+install_develop('silvermirror') # XXX this won't actually work since python-dev isn't installed; install it first
 
 postinstall_commands = [ ['ln', '-s', os.path.join(HOME, 'smartopen', 'bin', 'smartopen'), os.path.join(HOME, 'bin', 'smartopen') ],
+                         ['ln', '-s', os.path.join(HOME, 'silvermirror', 'bin', 'silvermirror'), os.path.join(HOME, 'bin', 'silvermirror') ],
                          ]
 execute(*postinstall_commands)
 
 
 # - ubuntu packages to install:
-PACKAGES="unison fluxbox antiword xclip graphviz"
+PACKAGES="unison fluxbox antiword xclip graphviz python-dev"
 print "Ensure the following packages are installed:"
 print "sudo apt-get install $PACKAGES"