berkshelf/berkshelf — pull request #963 by reset (2013-12-25 07:43:14+00:00)
Title: Berkshelf 3 overrides custom cookbooks w/ "locked_version" of community cookbooks.

I've been building out forks of community cookbooks that are specifically targeted at Ubuntu LTS 12.04 running on AWS. As such, I have a number of cookbooks that share the same name and largely the same functionality for cookbooks that rely on them.

My `Berksfile`:

```ruby
source "https://api.berkshelf.com"
# site :opscode

cookbook "wasatch", github: "sprintly/wasatch-chef", protocol: :ssh

cookbook "nodejs", github: "tvdinner/nodejs"
cookbook "npm", github: "tvdinner/npm"
cookbook "route53", github: "tvdinner/route53"
cookbook "redis", github: "tvdinner/redis"
cookbook "rabbitmq", github: "tvdinner/rabbitmq"
cookbook "sensu", github: "tvdinner/sensu"
```

My understanding of how Berkshelf works is that it would see that `npm` has `nodejs` in the `metadata.rb` file but would override the location with the references to `tvdinner/nodejs`. That almost appears to be the case. When I open up my `Berksfile.lock` I see the following:

```
"nodejs": {
"locked_version": "1.3.0",
"git": "git://github.com/tvdinner/nodejs.git",
"ref": "c806a1aeb4ea2fc5c26ebe5ae247ee672d08dcf2"
},
"npm": {
"locked_version": "0.1.2",
"git": "git://github.com/tvdinner/npm.git",
"ref": "752a016a601d3356dacca2d36263248d7896aa32"
},
"route53": {
"locked_version": "0.3.1",
"git": "git://github.com/tvdinner/route53.git",
"ref": "458c148fa705ab8e7180b5917615b6e502a0c510"
},
```

If you look at the actual `metadata.rb`'s of those respective repos, you'll see that the versions are all below those.

Near as I can tell Berkshelf is overriding the `metadata.rb`'s version information with the cookbook site's version.

This breaks most commands as the cookbook Berkshelf downloads is not the version it ends up looking for.