Skip to content

Commit

Permalink
default_java_symlink should be conditional on node['java']['set_defau…
Browse files Browse the repository at this point in the history
…lt']
  • Loading branch information
carmstrong committed Mar 15, 2014
1 parent 38bfd40 commit e300e23
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions recipes/default_java_symlink.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Cookbook Name:: java
# Recipe:: default_java_symlink
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

link '/usr/lib/jvm/default-java' do
to node['java']['java_home']
not_if { node['java']['java_home'] == '/usr/lib/jvm/default-java' }
Expand Down
2 changes: 1 addition & 1 deletion recipes/openjdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
end
end

if platform_family?('debian')
if node['java']['set_default'] and platform_family?('debian')
include_recipe 'java::default_java_symlink'
end

Expand Down
2 changes: 1 addition & 1 deletion recipes/oracle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@
action :install
end

if platform_family?('debian')
if node['java']['set_default'] and platform_family?('debian')
include_recipe 'java::default_java_symlink'
end
2 changes: 1 addition & 1 deletion recipes/oracle_i386.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@
default false
end

if platform_family?('debian')
if node['java']['set_default'] and platform_family?('debian')
include_recipe 'java::default_java_symlink'
end

0 comments on commit e300e23

Please sign in to comment.