Skip to content
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

Fix cookbook installation from supermarket on windows #3968

Conversation

MichaelPereira
Copy link
Contributor

Successfully ran the unit tests in spec/unit/knife/cookbook_site_install_spec.rb with the change.

Proof of the fix:
Proof of the fix

- Fixes https://tickets.opscode.com/browse/CHEF-3394 by adding the `--force-local` option to tar
- Might fix chef#1753 with the added double quotes

Proof of the fix:
![Proof of the fix](http://imgur.com/MOvHdPD.png)
@thommay
Copy link
Contributor

thommay commented Sep 29, 2015

👍 @chef/client-windows

@lamont-granquist
Copy link
Contributor

👍

@smurawski
Copy link
Contributor

👍

@danielsdeleo
Copy link
Contributor

I think this will break BSD tar (Mac and probably *BSD):

tar zxvf apt-2.4.0.tgz --force-local
tar: Option --force-local is not supported
Usage:
  List:    tar -tf <archive-filename>
  Extract: tar -xf <archive-filename>
  Create:  tar -cf <archive-filename> [filenames...]
  Help:    tar --help

Edit: I ran this on Mac OS 10.11. Also:

$ which tar
/usr/bin/tar

@danielsdeleo
Copy link
Contributor

Unless this only runs on windows or I'm missing something?

@MichaelPereira
Copy link
Contributor Author

@danielsdeleo You're right, it doesn't run on Windows only. The commit needs to be refactored to add the --force-local parameter only for Windows. I will try to look around the code base to see how it's done.

@MichaelPereira
Copy link
Contributor Author

I verified that 48f7688 works on Windows on my local machine:

PS U:\.chef\cookbooks> knife cookbook site install chocolatey
WARNING: No knife configuration file found
Installing chocolatey to U:/.chef/cookbooks
Checking out the master branch.
Creating pristine copy branch chef-vendor-chocolatey
Downloading chocolatey from the cookbooks site at version 0.4.0 to U:/.chef/cookbooks/chocolatey.tar.gz
Cookbook saved: U:/.chef/cookbooks/chocolatey.tar.gz
Removing pre-existing version.
Uncompressing chocolatey version 0.4.0.
removing downloaded tarball
1 files updated, committing changes
Creating tag cookbook-site-imported-chocolatey-0.4.0
Checking out the master branch.
Updating d514eec..170e3e2
Fast-forward
 chocolatey/CHANGELOG.md                    |  11 +++
 chocolatey/README.md                       |  79 +++++++++++++++++
 chocolatey/attributes/default.rb           |   4 +
 chocolatey/libraries/chocolatey_helpers.rb |  24 ++++++
 chocolatey/metadata.json                   |   1 +
 chocolatey/providers/default.rb            | 134 +++++++++++++++++++++++++++++
 chocolatey/recipes/default.rb              |  74 ++++++++++++++++
 chocolatey/resources/default.rb            |  14 +++
 8 files changed, 341 insertions(+)
 create mode 100644 chocolatey/CHANGELOG.md
 create mode 100644 chocolatey/README.md
 create mode 100644 chocolatey/attributes/default.rb
 create mode 100644 chocolatey/libraries/chocolatey_helpers.rb
 create mode 100644 chocolatey/metadata.json
 create mode 100644 chocolatey/providers/default.rb
 create mode 100644 chocolatey/recipes/default.rb
 create mode 100644 chocolatey/resources/default.rb
Cookbook chocolatey version 0.4.0 successfully installed

@danielsdeleo
Copy link
Contributor

LGTM now. 👍

@thommay
Copy link
Contributor

thommay commented Oct 7, 2015

thanks @danielsdeleo, good catch!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

knife cookbook site install fails on Windows in directories with spaces
6 participants