Merge "jiri: Support installation of base profile on fnl"
diff --git a/gitutil/git.go b/gitutil/git.go
index 5185d26..c97b418 100644
--- a/gitutil/git.go
+++ b/gitutil/git.go
@@ -646,6 +646,11 @@
 	if g.rootDir != "" {
 		opts.Dir = g.rootDir
 	}
+	if runutil.IsFNLHost() {
+		// TODO(bprosnitz) Remove this after certificates are installed on FNL
+		// Disable SSL verification because certificates are not present on FNL.
+		args = append([]string{"-c", "http.sslVerify=false"}, args...)
+	}
 	if err := g.r.CommandWithOpts(opts, "git", args...); err != nil {
 		stdout, stderr := "", ""
 		buf, ok := opts.Stdout.(*bytes.Buffer)
diff --git a/profiles/util.go b/profiles/util.go
index 0e5f3c8..4be9a35 100644
--- a/profiles/util.go
+++ b/profiles/util.go
@@ -18,6 +18,7 @@
 
 	"v.io/jiri/collect"
 	"v.io/jiri/project"
+  "v.io/jiri/runutil"
 	"v.io/jiri/tool"
 )
 
@@ -162,6 +163,11 @@
 	installDepsFn := func() error {
 		switch runtime.GOOS {
 		case "linux":
+			if runutil.IsFNLHost() {
+				fmt.Fprintf(ctx.Stdout(), "skipping installation of %v on FNL host", pkgs)
+				fmt.Fprintf(ctx.Stdout(), "success\n")
+				break
+			}
 			installPkgs := []string{}
 			for _, pkg := range pkgs {
 				if err := RunCommand(ctx, nil, "dpkg", "-L", pkg); err != nil {
diff --git a/runutil/misc.go b/runutil/misc.go
new file mode 100644
index 0000000..478745b
--- /dev/null
+++ b/runutil/misc.go
@@ -0,0 +1,16 @@
+// Copyright 2015 The Vanadium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package runutil
+
+import "os"
+
+// IsFNLHost returns true iff the host machine is running FNL
+// TODO(bprosnitz) We should find a better way to detect that the machine is running FNL
+// TODO(bprosnitz) This is needed in part because fnl is not currently a GOHOSTOS. This should
+// probably be handled by having hosts that are separate from GOHOSTOSs similarly to how targets
+// are defined.
+func IsFNLHost() bool {
+	return os.Getenv("FNL_SYSTEM") != ""
+}