Ejemplo n.º 1
0
def setup(executable, target_dir, filename, source_url, options, setup_make=None, setup_premake=None):
  if executable:
    if not check_executable(executable):
      print '{e} not found'.format(e=executable)
  if not os.path.isdir(target_dir):
    print 'Downloading'
    if filename.endswith(".git"):
      command = 'git clone --depth 1 {u}'.format(u=source_url)
      print command
      subprocess.check_call(command, shell=True)
    else:
      urllib.urlretrieve(source_url, filename)
      extract_tar.extract(filename, '.')
  with cd(target_dir) as dir:
    if setup_make:
      setup_make(setup_premake, options)
    else:
      print 'No setup_make for {e}'.format(e=executable)
Ejemplo n.º 2
0
import os
import sys
import subprocess
from with_cd import cd
import p4_util
import config

if __name__ == '__main__':
  print __file__
  print os.system('date')

  lxr = '/etc/lxr-2.0.3/lxr.conf'

  latest = p4_util.main()
  
  if latest in config.current_versions(lxr):
    print 'Config already processed'
    sys.exit(0)

  config.main(lxr,'/home/lxr/Perforce/main')

  with cd('/etc/lxr-2.0.3') as dir:
    command = './genxref --url=http://lxr/lxr --allversions'
    print command
    subprocess.check_call(command, shell=True)

  print os.system('date')
Ejemplo n.º 3
0
  print 'Setup Perl File::MMagic module'
  setup_perl_mmagic()

  print 'Setup Perl libdbi-perl'
  setup_perl_libdbi()

  pwd = os.getcwd()

  print 'Run database setup script.'
  print 'Passwords required are as follows: postgres, postgres, postgres... when promted for the new password insert lxrpw'
  print 'Then the password required switches to lxrpw from the 2nd request after the mention of database'
  command = './initdb.sh'
  print command
  subprocess.check_call(command, shell=True)

  with cd(pwd) as dir:
    print os.getcwd()
    update_http_conf(apache_dir, 'httpd.conf')

  update_http_perl()

  check_apache_and_restart()

  print 'Setup p4'
  setup_p4()

  print 'Setup p4 clientspec'
  setup_p4_client(get_latest_changelist())

  print 'Setup cron'
  setup_cron()