No more name conflict, so go back to Config.Name
diff --git a/action/create.go b/action/create.go
index e44e2fe..5d42199 100644
--- a/action/create.go
+++ b/action/create.go
@@ -85,7 +85,7 @@
config := new(cfg.Config)
// Get the name of the top level package
- config.ProjectRoot = name
+ config.Name = name
// Import by looking at other package managers and looking over the
// entire directory structure.
@@ -131,7 +131,7 @@
n := strings.TrimPrefix(pa, vpath)
root, subpkg := util.NormalizeName(n)
- if !config.Imports.Has(root) && root != config.ProjectRoot {
+ if !config.Imports.Has(root) && root != config.Name {
msg.Info("--> Found reference to %s\n", n)
d := &cfg.Dependency{
Name: root,
@@ -156,9 +156,9 @@
n := strings.TrimPrefix(pa, vpath)
root, subpkg := util.NormalizeName(n)
- if config.Imports.Has(root) && root != config.ProjectRoot {
+ if config.Imports.Has(root) && root != config.Name {
msg.Debug("--> Found test reference to %s already listed as an import", n)
- } else if !config.DevImports.Has(root) && root != config.ProjectRoot {
+ } else if !config.DevImports.Has(root) && root != config.Name {
msg.Info("--> Found test reference to %s", n)
d := &cfg.Dependency{
Name: root,
diff --git a/action/ensure.go b/action/ensure.go
index 43f2df9..2f5f5af 100644
--- a/action/ensure.go
+++ b/action/ensure.go
@@ -48,8 +48,8 @@
b, err = filepath.Rel(b, cwd)
if err == nil {
name := buildContext.PackageName(b)
- if name != conf.ProjectRoot {
- msg.Warn("The name listed in the config file (%s) does not match the current location (%s)", conf.ProjectRoot, name)
+ if name != conf.Name {
+ msg.Warn("The name listed in the config file (%s) does not match the current location (%s)", conf.Name, name)
}
} else {
msg.Warn("Problem finding the config file path (%s) relative to the current directory (%s): %s", b, cwd, err)
diff --git a/action/get.go b/action/get.go
index 36d678a..bcb62f3 100644
--- a/action/get.go
+++ b/action/get.go
@@ -39,7 +39,7 @@
params := gps.SolveParameters{
RootDir: filepath.Dir(glidefile),
- ImportRoot: gps.ProjectRoot(conf.ProjectRoot),
+ ImportRoot: gps.ProjectRoot(conf.Name),
Manifest: conf,
Trace: true,
TraceLogger: log.New(os.Stdout, "", 0),
diff --git a/action/install.go b/action/install.go
index bf0dc07..d379544 100644
--- a/action/install.go
+++ b/action/install.go
@@ -40,7 +40,7 @@
params := gps.SolveParameters{
RootDir: filepath.Dir(vend),
- ImportRoot: gps.ProjectRoot(conf.ProjectRoot),
+ ImportRoot: gps.ProjectRoot(conf.Name),
Manifest: conf,
Trace: true,
TraceLogger: log.New(os.Stdout, "", 0),
diff --git a/action/name.go b/action/name.go
index 7a67b7c..77972b3 100644
--- a/action/name.go
+++ b/action/name.go
@@ -7,5 +7,5 @@
// Name prints the name of the package, according to the glide.yaml file.
func Name() {
conf := EnsureConfig()
- msg.Puts(conf.ProjectRoot)
+ msg.Puts(conf.Name)
}
diff --git a/action/project_info.go b/action/project_info.go
index b82b41c..379026e 100644
--- a/action/project_info.go
+++ b/action/project_info.go
@@ -15,7 +15,7 @@
if varInit {
switch varfmt {
case 'n':
- buffer.WriteString(conf.ProjectRoot)
+ buffer.WriteString(conf.Name)
case 'd':
buffer.WriteString(conf.Description)
case 'h':
diff --git a/action/update.go b/action/update.go
index ce6dbba..feab38a 100644
--- a/action/update.go
+++ b/action/update.go
@@ -32,7 +32,7 @@
params := gps.SolveParameters{
RootDir: filepath.Dir(vend),
- ImportRoot: gps.ProjectRoot(conf.ProjectRoot),
+ ImportRoot: gps.ProjectRoot(conf.Name),
Manifest: conf,
Trace: true,
TraceLogger: log.New(os.Stdout, "", 0),
diff --git a/cfg/config.go b/cfg/config.go
index 4bf3f8d..0bcfb18 100644
--- a/cfg/config.go
+++ b/cfg/config.go
@@ -19,7 +19,7 @@
type Config struct {
// Name is the name of the package or application.
- ProjectRoot string `yaml:"package"`
+ Name string `yaml:"package"`
// Description is a short description for a package, application, or library.
// This description is similar but different to a Go package description as
@@ -105,7 +105,7 @@
if err := unmarshal(&newConfig); err != nil {
return err
}
- c.ProjectRoot = newConfig.Name
+ c.Name = newConfig.Name
c.Description = newConfig.Description
c.Home = newConfig.Home
c.License = newConfig.License
@@ -124,7 +124,7 @@
// MarshalYAML is a hook for gopkg.in/yaml.v2 in the marshaling process
func (c *Config) MarshalYAML() (interface{}, error) {
newConfig := &cf{
- Name: c.ProjectRoot,
+ Name: c.Name,
Description: c.Description,
Home: c.Home,
License: c.License,
@@ -257,7 +257,7 @@
// Clone performs a deep clone of the Config instance
func (c *Config) Clone() *Config {
n := &Config{}
- n.ProjectRoot = c.ProjectRoot
+ n.Name = c.Name
n.Description = c.Description
n.Home = c.Home
n.License = c.License
@@ -298,7 +298,7 @@
// If the name on the config object is part of the imports remove it.
found := -1
for i, dep := range c.Imports {
- if dep.Name == c.ProjectRoot {
+ if dep.Name == c.Name {
found = i
}
}
@@ -308,7 +308,7 @@
found = -1
for i, dep := range c.DevImports {
- if dep.Name == c.ProjectRoot {
+ if dep.Name == c.Name {
found = i
}
}
@@ -502,7 +502,7 @@
if d.Reference != "" {
r := d.Reference
- // TODO this covers git & hg; bzr and svn (??) need love
+ // TODO(sdboyer) this covers git & hg; bzr and svn (??) need love
if len(r) == 40 {
if _, err := hex.DecodeString(r); err == nil {
d.Constraint = gps.Revision(r)
@@ -524,7 +524,6 @@
return fmt.Errorf("Error on creating constraint for %q from %q: %s", d.Name, newDep.Branch, err)
}
} else {
- // TODO this is just for now - need a default branch constraint type
d.Constraint = gps.Any()
}
diff --git a/cfg/config_test.go b/cfg/config_test.go
index bf6a190..6313ff0 100644
--- a/cfg/config_test.go
+++ b/cfg/config_test.go
@@ -48,8 +48,8 @@
t.Errorf("Unable to Unmarshal config yaml")
}
- if cfg.ProjectRoot != "fake/testing" {
- t.Errorf("Inaccurate name found %s", cfg.ProjectRoot)
+ if cfg.Name != "fake/testing" {
+ t.Errorf("Inaccurate name found %s", cfg.Name)
}
if cfg.Description != "foo bar baz" {
@@ -98,15 +98,15 @@
}
cfg2 := cfg.Clone()
- if cfg2.ProjectRoot != "fake/testing" {
+ if cfg2.Name != "fake/testing" {
t.Error("Config cloning failed")
}
if cfg2.License != "MIT" {
t.Error("Config cloning failed to copy License")
}
- cfg.ProjectRoot = "foo"
+ cfg.Name = "foo"
- if cfg.ProjectRoot == cfg2.ProjectRoot {
+ if cfg.Name == cfg2.Name {
t.Error("Cloning Config name failed")
}
}
@@ -117,7 +117,7 @@
t.Error("ConfigFromYaml failed to parse yaml")
}
- if c.ProjectRoot != "fake/testing" {
+ if c.Name != "fake/testing" {
t.Error("ConfigFromYaml failed to properly parse yaml")
}
}
diff --git a/dependency/analyzer.go b/dependency/analyzer.go
index b844dc9..0f88d7d 100644
--- a/dependency/analyzer.go
+++ b/dependency/analyzer.go
@@ -138,7 +138,7 @@
return nil, nil, err
}
- return &cfg.Config{ProjectRoot: root, Imports: d}, l, nil
+ return &cfg.Config{Name: root, Imports: d}, l, nil
}
func (a Analyzer) lookForGPM(root string) (gps.Manifest, gps.Lock, error) {
@@ -151,7 +151,7 @@
return nil, nil, err
}
- return &cfg.Config{ProjectRoot: root, Imports: d}, l, nil
+ return &cfg.Config{Name: root, Imports: d}, l, nil
}
func (a Analyzer) lookForGb(root string) (gps.Manifest, gps.Lock, error) {
@@ -164,7 +164,7 @@
return nil, nil, err
}
- return &cfg.Config{ProjectRoot: root, Imports: d}, l, nil
+ return &cfg.Config{Name: root, Imports: d}, l, nil
}
func (a Analyzer) lookForGom(root string) (gps.Manifest, gps.Lock, error) {
diff --git a/repo/installer.go b/repo/installer.go
index 0d6a335..eec08df 100644
--- a/repo/installer.go
+++ b/repo/installer.go
@@ -90,7 +90,7 @@
// Create a config setup based on the Lockfile data to process with
// existing commands.
newConf := &cfg.Config{}
- newConf.ProjectRoot = conf.ProjectRoot
+ newConf.Name = conf.Name
newConf.Imports = make(cfg.Dependencies, len(lock.Imports))
for k, v := range lock.Imports {
@@ -449,7 +449,7 @@
func (m *MissingPackageHandler) NotFound(pkg string, addTest bool) (bool, error) {
root := util.GetRootFromPackage(pkg)
// Skip any references to the root package.
- if root == m.Config.ProjectRoot {
+ if root == m.Config.Name {
return false, nil
}
@@ -516,7 +516,7 @@
root := util.GetRootFromPackage(pkg)
// Skip any references to the root package.
- if root == m.Config.ProjectRoot {
+ if root == m.Config.Name {
return false, nil
}
@@ -546,7 +546,7 @@
func (m *MissingPackageHandler) InVendor(pkg string, addTest bool) error {
root := util.GetRootFromPackage(pkg)
// Skip any references to the root package.
- if root == m.Config.ProjectRoot {
+ if root == m.Config.Name {
return nil
}
@@ -606,7 +606,7 @@
root := util.GetRootFromPackage(pkg)
// Skip any references to the root package.
- if root == d.Config.ProjectRoot {
+ if root == d.Config.Name {
return nil
}
@@ -643,7 +643,7 @@
root := util.GetRootFromPackage(pkg)
// Skip any references to the root package.
- if root == d.Config.ProjectRoot {
+ if root == d.Config.Name {
return nil
}