Glide get could cause the locked dependencies into a bad state. Fixed.
diff --git a/cmd/get_imports.go b/cmd/get_imports.go
index 050a9d2..8eafe64 100644
--- a/cmd/get_imports.go
+++ b/cmd/get_imports.go
@@ -48,18 +48,9 @@
names := p.Get("packages", []string{}).([]string)
conf := p.Get("conf", nil).(*cfg.Config)
insecure := p.Get("insecure", false).(bool)
- home := p.Get("home", "").(string)
- cache := p.Get("cache", false).(bool)
- cacheGopath := p.Get("cacheGopath", false).(bool)
- useGopath := p.Get("useGopath", false).(bool)
Info("Preparing to install %d package.", len(names))
- cwd, err := VendorPath(c)
- if err != nil {
- return nil, err
- }
-
deps := []*cfg.Dependency{}
for _, name := range names {
var version string
@@ -84,13 +75,6 @@
continue
}
- dest := path.Join(cwd, root)
-
- if err != nil {
- Error("Could not construct repo for %q: %s", name, err)
- return false, err
- }
-
dep := &cfg.Dependency{
Name: root,
}
@@ -109,8 +93,11 @@
if len(subpkg) > 0 && subpkg != "/" {
dep.Subpackages = []string{subpkg}
}
- if err := VcsGet(dep, dest, home, cache, cacheGopath, useGopath); err != nil {
- return dep, err
+
+ if dep.Reference != "" {
+ Info("Importing %s with the version %s", dep.Name, dep.Reference)
+ } else {
+ Info("Importing %s", dep.Name)
}
conf.Imports = append(conf.Imports, dep)
@@ -118,6 +105,8 @@
deps = append(deps, dep)
}
+
+ Info("Walking the dependency tree to calculate versions")
return deps, nil
}
diff --git a/glide.go b/glide.go
index 04bd3e7..5a07f85 100644
--- a/glide.go
+++ b/glide.go
@@ -165,16 +165,20 @@
`,
Flags: []cli.Flag{
cli.BoolFlag{
- Name: "no-recursive",
+ Name: "insecure",
+ Usage: "Use http:// rather than https:// to retrieve pacakges.",
+ },
+ cli.BoolFlag{
+ Name: "no-recursive, quick",
Usage: "Disable updating dependencies' dependencies.",
},
cli.BoolFlag{
- Name: "import",
- Usage: "When fetching dependencies, convert Godeps (GPM, Godep) to glide.yaml and pull dependencies",
+ Name: "force",
+ Usage: "If there was a change in the repo or VCS switch to new one. Warning, changes will be lost.",
},
cli.BoolFlag{
- Name: "insecure",
- Usage: "Use http:// rather than https:// to retrieve pacakges.",
+ Name: "update-vendored, u",
+ Usage: "Update vendored packages (without local VCS repo). Warning, changes will be lost.",
},
cli.BoolFlag{
Name: "cache",
@@ -194,6 +198,7 @@
fmt.Println("Oops! Package name is required.")
os.Exit(1)
}
+ cxt.Put("forceUpdate", c.Bool("force"))
cxt.Put("packages", []string(c.Args()))
cxt.Put("skipFlatten", !c.Bool("no-recursive"))
cxt.Put("insecure", c.Bool("insecure"))
@@ -206,6 +211,7 @@
cxt.Put("importGPM", true)
cxt.Put("importGb", true)
}
+ cxt.Put("updateVendoredDeps", c.Bool("update-vendored"))
setupHandler(c, "get", cxt, router)
},
},
@@ -530,14 +536,21 @@
Includes("@startup").
Includes("@ready").
Does(cmd.GetAll, "goget").
- Using("filename").From("cxt:yaml").
Using("packages").From("cxt:packages").
Using("conf").From("cxt:cfg").
Using("insecure").From("cxt:insecure").
+ Does(cmd.VendoredSetup, "cfg").
+ Using("conf").From("cxt:cfg").
+ Using("update").From("cxt:updateVendoredDeps").
+ Does(cmd.UpdateImports, "dependencies").
+ Using("conf").From("cxt:cfg").
+ Using("force").From("cxt:forceUpdate").
+ //Using("packages").From("cxt:packages").
Using("home").From("cxt:home").
Using("cache").From("cxt:useCache").
Using("cacheGopath").From("cxt:cacheGopath").
Using("useGopath").From("cxt:useGopath").
+ Does(cmd.SetReference, "version").Using("conf").From("cxt:cfg").
Does(cmd.Flatten, "flatten").Using("conf").From("cxt:cfg").
Using("packages").From("cxt:packages").
Using("force").From("cxt:forceUpdate").
@@ -545,6 +558,9 @@
Using("cache").From("cxt:useCache").
Using("cacheGopath").From("cxt:cacheGopath").
Using("useGopath").From("cxt:useGopath").
+ Does(cmd.VendoredCleanUp, "_").
+ Using("conf").From("cxt:flattened").
+ Using("update").From("cxt:updateVendoredDeps").
Does(cmd.WriteYaml, "out").
Using("conf").From("cxt:cfg").
Using("filename").WithDefault("glide.yaml").From("cxt:yaml").
diff --git a/glide.lock b/glide.lock
index d78601e..e87b2c0 100644
--- a/glide.lock
+++ b/glide.lock
@@ -1,5 +1,5 @@
hash: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
-updated: 2015-12-10T10:46:38.137326757-05:00
+updated: 2015-12-10T12:31:08.864762919-05:00
imports:
- name: github.com/codegangsta/cli
version: 0302d3914d2a6ad61404584cdae6e6dbc9c03599