Merge branch 'master' into feature/flatten
diff --git a/cmd/get_imports.go b/cmd/get_imports.go
index c5dec3c..fdc53de 100644
--- a/cmd/get_imports.go
+++ b/cmd/get_imports.go
@@ -42,6 +42,7 @@
func GetAll(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
names := p.Get("packages", []string{}).([]string)
cfg := p.Get("conf", nil).(*Config)
+ insecure := p.Get("insecure", false).(bool)
Info("Preparing to install %d package.", len(names))
@@ -63,7 +64,13 @@
}
dest := path.Join(cwd, root)
- repoURL := "https://" + root
+
+ var repoURL string
+ if insecure {
+ repoURL = "http://" + root
+ } else {
+ repoURL = "https://" + root
+ }
repo, err := v.NewRepo(repoURL, dest)
if err != nil {
Error("Could not construct repo for %q: %s", name, err)
@@ -73,6 +80,13 @@
dep := &Dependency{
Name: root,
}
+
+ // When retriving from an insecure location set the repo to the
+ // insecure location.
+ if insecure {
+ dep.Repository = "http://" + root
+ }
+
subpkg := strings.TrimPrefix(name, root)
if len(subpkg) > 0 && subpkg != "/" {
dep.Subpackages = []string{subpkg}
diff --git a/glide.go b/glide.go
index 06c37c6..deb76fe 100644
--- a/glide.go
+++ b/glide.go
@@ -164,6 +164,10 @@
Name: "import",
Usage: "When fetching dependencies, convert Godeps (GPM, Godep) to glide.yaml and pull dependencies",
},
+ cli.BoolFlag{
+ Name: "insecure",
+ Usage: "Use http:// rather than https:// to retrieve pacakges.",
+ },
},
Action: func(c *cli.Context) {
if len(c.Args()) < 1 {
@@ -172,6 +176,7 @@
}
cxt.Put("packages", []string(c.Args()))
cxt.Put("skipFlatten", !c.Bool("no-recursive"))
+ cxt.Put("insecure", c.Bool("insecure"))
// FIXME: Are these used anywhere?
if c.Bool("import") {
cxt.Put("importGodeps", true)
@@ -441,6 +446,7 @@
Using("filename").From("cxt:yaml").
Using("packages").From("cxt:packages").
Using("conf").From("cxt:cfg").
+ Using("insecure").From("cxt:insecure").
Does(cmd.MergeToYaml, "merged").Using("conf").From("cxt:cfg").
Does(cmd.Flatten, "flatten").Using("conf").From("cxt:cfg").
Using("packages").From("cxt:packages").