Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add ugly bash if to check if a file to be cherry picked is in the base

of the archive or a subdirectory
  • Loading branch information...
commit dcc0c254614fe9a5361ccd346e04d0fbe40913c0 1 parent 5d93003
@bryanwb authored
Showing with 28 additions and 19 deletions.
  1. +27 −18 libraries/provider_ark.rb
  2. +1 −1  metadata.rb
View
45 libraries/provider_ark.rb
@@ -83,26 +83,30 @@ def action_configure
end
def action_build_with_make
- set_paths
- action_download
- action_unpack
- b = Chef::Resource::Script::Bash.new("build with make", run_context)
- b.cwd new_resource.path
- b.environment new_resource.environment
- b.code "make #{new_resource.make_opts.join(' ')}"
- b.run_action(:run)
- action_set_owner new_resource.path
- action_link_paths
- action_install_binaries
+ unless new_resource.creates and ::File.exists? new_resource.creates
+ set_paths
+ action_download
+ action_unpack
+ b = Chef::Resource::Script::Bash.new("build with make", run_context)
+ b.cwd new_resource.path
+ b.environment new_resource.environment
+ b.code "make #{new_resource.make_opts.join(' ')}"
+ b.run_action(:run)
+ action_set_owner new_resource.path
+ action_link_paths
+ action_install_binaries
+ end
end
def action_install_with_make
- action_build_with_make
- b = Chef::Resource::Script::Bash.new("make install", run_context)
- b.cwd new_resource.path
- b.environment new_resource.environment
- b.code "make install"
- b.run_action(:run)
+ unless new_resource.creates and ::File.exists? new_resource.creates
+ action_build_with_make
+ b = Chef::Resource::Script::Bash.new("make install", run_context)
+ b.cwd new_resource.path
+ b.environment new_resource.environment
+ b.code "make install"
+ b.run_action(:run)
+ end
end
# needs a test, start here http://guide.python-distribute.org/quickstart.html
@@ -305,7 +309,12 @@ def unzip_dump
def unzip_cherry_pick
b = Chef::Resource::Script::Bash.new(new_resource.name, run_context)
b.code <<-EOS
- unzip -j -o #{new_resource.release_file} "*/#{new_resource.creates}" -d #{new_resource.path}
+ unzip -t #{new_resource.release_file} "*/#{new_resource.creates}"
+ if [ $? -eq 11 ] ; then
+ unzip -j -o #{new_resource.release_file} "#{new_resource.creates}" -d #{new_resource.path}
+ else
+ unzip -j -o #{new_resource.release_file} "*/#{new_resource.creates}" -d #{new_resource.path}
+ fi
EOS
b.run_action(:run)
end
View
2  metadata.rb
@@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs/Configures ark"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "0.0.11"
+version "0.0.13"
%w{ debian ubuntu centos redhat fedora }.each do |os|
supports os
Please sign in to comment.
Something went wrong with that request. Please try again.