mirror of https://github.com/apache/jclouds.git
Issue 891: ensure we run apt update when install jdk fails
This commit is contained in:
parent
b9c4f5cd4b
commit
98a205b603
|
@ -84,13 +84,13 @@ END_OF_JCLOUDS_SCRIPT
|
|||
exit 1
|
||||
}
|
||||
alias apt-get-install="apt-get install -f -y -qq --force-yes"
|
||||
alias apt-get-upgrade="(apt-get update -qq&&apt-get upgrade -y -qq)"
|
||||
alias apt-get-update="apt-get update -qq"
|
||||
|
||||
function ensure_cmd_or_install_package_apt(){
|
||||
local cmd=$1
|
||||
local pkg=$2
|
||||
|
||||
hash $cmd 2>/dev/null || apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg )
|
||||
hash $cmd 2>/dev/null || apt-get-install $pkg || ( apt-get-update && apt-get-install $pkg )
|
||||
}
|
||||
|
||||
function ensure_cmd_or_install_package_yum(){
|
||||
|
@ -155,7 +155,7 @@ END_OF_JCLOUDS_FILE
|
|||
function installOpenJDK() {
|
||||
if hash apt-get 2>/dev/null; then
|
||||
export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-6-openjdk}
|
||||
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk
|
||||
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk || ( apt-get-update && apt-get-install openjdk-6-jdk )
|
||||
elif hash yum 2>/dev/null; then
|
||||
export pkg=java-1.6.0-openjdk-devel
|
||||
yum --nogpgcheck -y install $pkg &&
|
||||
|
|
|
@ -84,13 +84,13 @@ END_OF_JCLOUDS_SCRIPT
|
|||
exit 1
|
||||
}
|
||||
alias apt-get-install="apt-get install -f -y -qq --force-yes"
|
||||
alias apt-get-upgrade="(apt-get update -qq&&apt-get upgrade -y -qq)"
|
||||
alias apt-get-update="apt-get update -qq"
|
||||
|
||||
function ensure_cmd_or_install_package_apt(){
|
||||
local cmd=$1
|
||||
local pkg=$2
|
||||
|
||||
hash $cmd 2>/dev/null || apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg )
|
||||
hash $cmd 2>/dev/null || apt-get-install $pkg || ( apt-get-update && apt-get-install $pkg )
|
||||
}
|
||||
|
||||
function ensure_cmd_or_install_package_yum(){
|
||||
|
@ -155,7 +155,7 @@ END_OF_JCLOUDS_FILE
|
|||
function installOpenJDK() {
|
||||
if hash apt-get 2>/dev/null; then
|
||||
export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-6-openjdk}
|
||||
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk
|
||||
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk || ( apt-get-update && apt-get-install openjdk-6-jdk )
|
||||
elif hash yum 2>/dev/null; then
|
||||
export pkg=java-1.6.0-openjdk-devel
|
||||
yum --nogpgcheck -y install $pkg &&
|
||||
|
|
|
@ -84,13 +84,13 @@ END_OF_JCLOUDS_SCRIPT
|
|||
exit 1
|
||||
}
|
||||
alias apt-get-install="apt-get install -f -y -qq --force-yes"
|
||||
alias apt-get-upgrade="(apt-get update -qq&&apt-get upgrade -y -qq)"
|
||||
alias apt-get-update="apt-get update -qq"
|
||||
|
||||
function ensure_cmd_or_install_package_apt(){
|
||||
local cmd=$1
|
||||
local pkg=$2
|
||||
|
||||
hash $cmd 2>/dev/null || apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg )
|
||||
hash $cmd 2>/dev/null || apt-get-install $pkg || ( apt-get-update && apt-get-install $pkg )
|
||||
}
|
||||
|
||||
function ensure_cmd_or_install_package_yum(){
|
||||
|
@ -155,7 +155,7 @@ END_OF_JCLOUDS_FILE
|
|||
function installOpenJDK() {
|
||||
if hash apt-get 2>/dev/null; then
|
||||
export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-6-openjdk}
|
||||
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk
|
||||
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk || ( apt-get-update && apt-get-install openjdk-6-jdk )
|
||||
elif hash yum 2>/dev/null; then
|
||||
export pkg=java-1.6.0-openjdk-devel
|
||||
yum --nogpgcheck -y install $pkg &&
|
||||
|
|
|
@ -84,13 +84,13 @@ END_OF_JCLOUDS_SCRIPT
|
|||
exit 1
|
||||
}
|
||||
alias apt-get-install="apt-get install -f -y -qq --force-yes"
|
||||
alias apt-get-upgrade="(apt-get update -qq&&apt-get upgrade -y -qq)"
|
||||
alias apt-get-update="apt-get update -qq"
|
||||
|
||||
function ensure_cmd_or_install_package_apt(){
|
||||
local cmd=$1
|
||||
local pkg=$2
|
||||
|
||||
hash $cmd 2>/dev/null || apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg )
|
||||
hash $cmd 2>/dev/null || apt-get-install $pkg || ( apt-get-update && apt-get-install $pkg )
|
||||
}
|
||||
|
||||
function ensure_cmd_or_install_package_yum(){
|
||||
|
|
|
@ -20,7 +20,7 @@ END_OF_JCLOUDS_FILE
|
|||
function installOpenJDK() {
|
||||
if hash apt-get 2>/dev/null; then
|
||||
export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-6-openjdk}
|
||||
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk
|
||||
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk || ( apt-get-update && apt-get-install openjdk-6-jdk )
|
||||
elif hash yum 2>/dev/null; then
|
||||
export pkg=java-1.6.0-openjdk-devel
|
||||
yum --nogpgcheck -y install $pkg &&
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
alias apt-get-install="apt-get install -f -y -qq --force-yes"
|
||||
alias apt-get-upgrade="(apt-get update -qq&&apt-get upgrade -y -qq)"
|
||||
alias apt-get-update="apt-get update -qq"
|
||||
|
||||
function ensure_cmd_or_install_package_apt(){
|
||||
local cmd=$1
|
||||
local pkg=$2
|
||||
|
||||
hash $cmd 2>/dev/null || apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg )
|
||||
hash $cmd 2>/dev/null || apt-get-install $pkg || ( apt-get-update && apt-get-install $pkg )
|
||||
}
|
||||
|
||||
function ensure_cmd_or_install_package_yum(){
|
||||
|
|
|
@ -84,13 +84,13 @@ END_OF_JCLOUDS_SCRIPT
|
|||
exit 1
|
||||
}
|
||||
alias apt-get-install="apt-get install -f -y -qq --force-yes"
|
||||
alias apt-get-upgrade="(apt-get update -qq&&apt-get upgrade -y -qq)"
|
||||
alias apt-get-update="apt-get update -qq"
|
||||
|
||||
function ensure_cmd_or_install_package_apt(){
|
||||
local cmd=$1
|
||||
local pkg=$2
|
||||
|
||||
hash $cmd 2>/dev/null || apt-get-install $pkg || ( apt-get-upgrade && apt-get-install $pkg )
|
||||
hash $cmd 2>/dev/null || apt-get-install $pkg || ( apt-get-update && apt-get-install $pkg )
|
||||
}
|
||||
|
||||
function ensure_cmd_or_install_package_yum(){
|
||||
|
@ -155,7 +155,7 @@ END_OF_JCLOUDS_FILE
|
|||
function installOpenJDK() {
|
||||
if hash apt-get 2>/dev/null; then
|
||||
export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-6-openjdk}
|
||||
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk
|
||||
test -d $JAVA_HOME || apt-get-install openjdk-6-jdk || ( apt-get-update && apt-get-install openjdk-6-jdk )
|
||||
elif hash yum 2>/dev/null; then
|
||||
export pkg=java-1.6.0-openjdk-devel
|
||||
yum --nogpgcheck -y install $pkg &&
|
||||
|
|
Loading…
Reference in New Issue