# HG changeset patch # User Jeff Hammel # Date 1300841262 25200 # Node ID 52cf3e146a4c3fcbcf776f27ed4cd87458fb5cab # Parent c61997cf17b063500851119e72a3e727eef0c490 make the install script slightly nicer diff -r c61997cf17b0 -r 52cf3e146a4c python/install_config.py --- 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"