Exemple #1
0
func getRemote() error {
	log.Always("trying to get remote Go source")
	out, err := run("hg", "clone", "-r release", "-b default", "-u release", "https://code.google.com/p/go")
	if err != nil {
		log.Error(out)
		return err
	}

	log.Always("building")
	cmd, b := cmd("./all.bash")
	cmd.Dir = filepath.Join(sandboxGoRoot, "src")
	err = cmd.Run()
	if err != nil {
		log.Error(b.String())
		return err
	}
	return nil
}
Exemple #2
0
func (bbbh *borkBorkBorkHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	pid := os.Getpid()
	proc, err := os.FindProcess(os.Getpid())
	if err != nil {
		log.Error("borkborkbork: Failed to find my process", pid, err)
		http.Error(w, "borkborkbork: Failed to get my process", http.StatusInternalServerError)
		return
	}
	msg := fmt.Sprintf("OK (waiting %s)", Delay)
	w.Write([]byte(msg))
	go func() {
		time.Sleep(Delay)
		log.Alwaysln("borkborkbork: sending myself", bbbh.sig.String())
		proc.Signal(bbbh.sig)
	}()
}