# HG changeset patch # User Jeff Hammel # Date 1390802766 28800 # Node ID 4b79ee6c8539b185642e02a7f37b1dc5bb0fb254 # Parent 98ccb704e2417b0289fa5875b1d494be07fd1869 STUB: python/install_config.py diff -r 98ccb704e241 -r 4b79ee6c8539 python/install_config.py --- a/python/install_config.py Sat Jan 25 18:30:24 2014 -0800 +++ b/python/install_config.py Sun Jan 26 22:06:06 2014 -0800 @@ -13,6 +13,7 @@ # to have some base (e.g. .gkrellm2/user_config) # - scp k0s.org:~/web/sync.ini ~/.silvermirror # - make idempotent +# - step to install (and setup) firefox # imports import imp @@ -74,9 +75,16 @@ def __call__(self): execute(*self.commands) + class Command(object): """require a command""" +#@require(Virtualenv) +class InstallVirtualenv(Step): + """ABC for installing packages in a virtualenv""" + # TODO: move install_develop sctuff to here + + ### process steps class InitializeRepository(Step): @@ -96,6 +104,7 @@ """ with file('.hg/hgrc', 'w') as f: f.write(hgrc) + def __call__(self): Step.__call__(self) self.write_hgrc() @@ -107,7 +116,11 @@ #@requires(Command('git')) class ConfigureGit(Step): """configure git""" - commands = [['git', 'config', '--global', 'core.excludesfile', os.path.join(HOME, '.gitignore')]] + commands = [ + # setup git's global ignore, since git is silly about this + # and doesn't look for the file in the right place + ['git', 'config', '--global', 'core.excludesfile', os.path.join(HOME, '.gitignore')] + ] #@requires(Command('git')) class InstallVirtualenv(Step): @@ -117,8 +130,19 @@ os.path.join(HOME, 'bin', 'virtualenv.py')] ] -class InstallKWare(Step): +class InstallKWare(In): """install k0s.ware""" + # TODO + # from legacy + # # install some python + # install_develop('smartopen') + # 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) + class DebianPackages(Step): """ubuntu packages to install""" @@ -159,17 +183,6 @@ git = which('git') if git: - # setup git's global ignore, since git is silly about this - # and doesn't look for the file in the right place - - # install some python - install_develop('smartopen') - 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) else: print "git not installed"