Пример #1
0
def install_cygwin():
	cwd=os.getcwd()
	os.chdir(ARGS.install_dir)

	COMMAND=quote_dos_path(ARGS.install_dir)+"/setup.exe"+" "+DEFAULT_OPTIONS+" -l " + quote_dos_path(ARGS.CYGPAK_DIR) + " -R " + quote_dos_path(ARGS.CYGWIN_DIR)+" -P subversion,wget,tcsh,python "
	print_console("Using command: "+COMMAND)

	while (not os.path.lexists(ARGS.CYGWIN_DIR)):#this is for windows 7, keep nagging for auth
		output=stream_exec(COMMAND,verbose=False)



	print_console("Linking BIRCH into home directory")
	cygwin_exec("cd /home && ln -s "+quote_dos_path(ARGS.install_dir)+" /home/BIRCH")
	cygwin_exec("cd && ln -s /home/BIRCH ")

	if (os.path.lexists(ARGS.install_dir+"/cyghead") ):	
		print_console("Setting up cygwin to work with windows java")
		print_console("Installing easy_install and cygwinreg")
		cygwin_exec("cd /home/BIRCH/cyghead && sh "+EGGFILE)
		cygwin_exec("easy_install cygwinreg")

		cygwin_exec("mv /home/BIRCH/cyghead/java_bridge /bin/java")
		cygwin_exec("mv /home/BIRCH/cyghead/browser_bridge /bin/browser")
		cygwin_exec("mv /home/BIRCH/cyghead/apt-get /bin/apt-get")

		cygwin_exec("chmod +x /bin/java")
		cygwin_exec("chmod +x /bin/browser")
		cygwin_exec("chmod +x /bin/apt-cyg")
		print_console("Finished installing cygwin java compatability layer")
	else:
		print_console("Error! cyghead not found")
		raise Exception
	os.chdir(cwd)
Пример #2
0
def cygwin_exec(command,verbosity=True,callbackfunc=None):

	command=command.replace("\"","\\\"")
	cmd=quote_dos_path(ARGS.CYGWIN_DIR)+"/bin/bash.exe -lc \""+command+"\""

	output=stream_exec(cmd,verbose=verbosity,callback=callbackfunc)
	return output
Пример #3
0
def cygwin_exec(command, verbosity=True, callbackfunc=None):

    command = command.replace("\"", "\\\"")
    cmd = quote_dos_path(
        ARGS.CYGWIN_DIR) + "/bin/bash.exe -lc \"" + command + "\""

    output = stream_exec(cmd, verbose=verbosity, callback=callbackfunc)
    return output
Пример #4
0
def install_cygwin():
    cwd = os.getcwd()
    os.chdir(ARGS.install_dir)

    COMMAND = quote_dos_path(
        ARGS.install_dir
    ) + "/setup.exe" + " " + DEFAULT_OPTIONS + " -l " + quote_dos_path(
        ARGS.CYGPAK_DIR) + " -R " + quote_dos_path(
            ARGS.CYGWIN_DIR) + " -P subversion,wget,tcsh,python "
    print_console("Using command: " + COMMAND)

    while (not os.path.lexists(
            ARGS.CYGWIN_DIR)):  #this is for windows 7, keep nagging for auth
        output = stream_exec(COMMAND, verbose=False)

    print_console("Linking BIRCH into home directory")
    cygwin_exec("cd /home && ln -s " + quote_dos_path(ARGS.install_dir) +
                " /home/BIRCH")
    cygwin_exec("cd && ln -s /home/BIRCH ")

    if (os.path.lexists(ARGS.install_dir + "/cyghead")):
        print_console("Setting up cygwin to work with windows java")
        print_console("Installing easy_install and cygwinreg")
        cygwin_exec("cd /home/BIRCH/cyghead && sh " + EGGFILE)
        cygwin_exec("easy_install cygwinreg")

        cygwin_exec("mv /home/BIRCH/cyghead/java_bridge /bin/java")
        cygwin_exec("mv /home/BIRCH/cyghead/browser_bridge /bin/browser")
        cygwin_exec("mv /home/BIRCH/cyghead/apt-get /bin/apt-get")

        cygwin_exec("chmod +x /bin/java")
        cygwin_exec("chmod +x /bin/browser")
        cygwin_exec("chmod +x /bin/apt-cyg")
        print_console("Finished installing cygwin java compatability layer")
    else:
        print_console("Error! cyghead not found")
        raise Exception
    os.chdir(cwd)