Skip to content

Instantly share code, notes, and snippets.

@samhendley
Created October 1, 2010 20:45
Show Gist options
  • Save samhendley/606827 to your computer and use it in GitHub Desktop.
Save samhendley/606827 to your computer and use it in GitHub Desktop.
#sprinkle snipppet to install sun-java-jdk and bypass the license step
package :java_license_agreement do
config_file = '/tmp/java-license-sets'
config_text = %q[
sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true
sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true
sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true
sun-java6-bin shared/present-sun-dlj-v1-1 note
sun-java6-jdk shared/present-sun-dlj-v1-1 note
sun-java6-jre shared/present-sun-dlj-v1-1 note
].lstrip
push_text config_text, config_file do
pre :install, "touch #{config_file} && rm #{config_file} && touch #{config_file}" # clear the file
post :install, "sudo debconf-set-selections #{config_file}"
end
verify do
# file_contains config_file, 'sun-dlj-v1'
end
end
package :java do
requires :java_license_agreement
apt('sun-java6-jdk')
verify do
has_executable 'java'
has_executable 'xjc'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment