comparison python/install_config.py @ 14:ac34d580c6d7

make symbolic links when necessary (should generalize)
author k0s <k0scist@gmail.com>
date Tue, 19 Jan 2010 16:22:21 -0500
parents c38d875a3b78
children 57298ea7a7f1
comparison
equal deleted inserted replaced
13:f6e9284dfe08 14:ac34d580c6d7
6 """ 6 """
7 7
8 SRC='http://k0s.org/hg/config' 8 SRC='http://k0s.org/hg/config'
9 import os 9 import os
10 import sys 10 import sys
11 os.chdir(os.environ['HOME']) 11 HOME=os.environ['HOME']
12 os.chdir(HOME)
12 13
13 # make the current directory a repository 14 # make the current directory a repository
14 import subprocess 15 import subprocess
15 16
16 commands = [ ['hg', 'init'], 17 commands = [ ['hg', 'init'],
17 ['hg', 'pull', SRC], 18 ['hg', 'pull', SRC],
18 ['hg', 'update', '-C' ] ] 19 ['hg', 'update', '-C'],
20
21 # site-specific files
22 ['rm', '.subversion/config'],
23 ['ln', '-s', os.path.join(HOME, '.subversion_config/config'), os.path.join(HOME, '.subversion/config')],
24 ]
19 25
20 for command in commands: 26 for command in commands:
21 code = subprocess.call(command) 27 code = subprocess.call(command)
22 if code: 28 if code:
23 sys.exit(code) 29 sys.exit(code)