-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
berks vendor
"cannot be trusted!" error
#1124
Conversation
@JeanMertz paths are expanded relative to the Berksfile. It seems there is some path wonkiness going on. Can you show us:
|
@sethvargo so our directory structure is unlike a regular Chef project directory or a Cookbook directory. It's just the way we can manage our cookbooks best, and it's something we've settled on about a year ago. Having said that, Berkshelf has never given us any issues with this structure. But maybe you decide not to support this way of working, so it might not really be a bug per-se. After investigating, it seems that the When using this position to fire the following command:
the following error is returned:
as you can see, Berkshelf interpreted the
and only after I enter the cookbook path itself, does the Maybe this is intended behaviour since DIRECTORY STRUCTUREnote, I removed a few subdirectories with some sensitive and/or irrelevant data
Berksfile (cookbooks/helpers/attribute-helpers)source 'http://api.berkshelf.com'
metadata Berksfile.lock
metadata.rbdef read(file, default = '')
IO.read(File.join(File.dirname(__FILE__), file))
rescue Errno::ENOENT
default
end
name 'attribute-helpers'
maintainer 'Jean Mertz'
maintainer_email 'jean@kabisa.nl'
license 'All rights reserved'
description 'Installs/Configures attribute-helpers'
long_description read('README.md')
version read('VERSION', '0.1.0') |
@JeanMertz didn't intend to only be able to run vendor from within the cookbook. It should run relative to the path of the Berksfile. This will be fixed before 3.0. |
I've labeled this as a bug and assigned to me |
@sethvargo need to fix the cucumber features but this should take care of the grossness |
|
||
add_dependency(name, nil, path: path, metadata: true) | ||
add_dependency(metadata.name, nil, path: path, metadata: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accidentally snuck this in to the PR. We don't need to do this song and dance of figuring out the name of the cookbook anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
def expanded_path | ||
parent = File.expand_path(File.dirname(dependency.berksfile.filepath)) | ||
File.expand_path(relative_path, parent) | ||
@expanded_path ||= Pathname.new File.expand_path(options[:path], File.dirname(dependency.berksfile.filepath)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really difficult to follow. Can we make a helper or something? There's a ton of expanding and contracting.
I see File.dirname(dependency.berksfile.filepath)
twice - maybe that could become a more semantic name, like "berksfile_directory"?
`berks vendor` "cannot be trusted!" error
Since upgrading from
beta6
torc1
I'm getting the following error:Not sure how, but the path in the
Locked location
seems to be the issue.