mirror of https://github.com/apache/jclouds.git
Improved setupPublicCurl script
With this changes, apt and yum helper functions can be used to install many packages at one as follows: ensure_cmd_or_install_package_apt git git-core build-essentials <...>
This commit is contained in:
parent
9212d4ff26
commit
652bc2f75e
|
@ -89,14 +89,16 @@ alias yum-install="yum --quiet --nogpgcheck -y install"
|
||||||
|
|
||||||
function ensure_cmd_or_install_package_apt(){
|
function ensure_cmd_or_install_package_apt(){
|
||||||
local cmd=$1
|
local cmd=$1
|
||||||
local pkg=$2
|
shift
|
||||||
|
local pkg=$*
|
||||||
|
|
||||||
hash $cmd 2>/dev/null || ( apt-get-update && apt-get-install $pkg )
|
hash $cmd 2>/dev/null || ( apt-get-update && apt-get-install $pkg )
|
||||||
}
|
}
|
||||||
|
|
||||||
function ensure_cmd_or_install_package_yum(){
|
function ensure_cmd_or_install_package_yum(){
|
||||||
local cmd=$1
|
local cmd=$1
|
||||||
local pkg=$2
|
shift
|
||||||
|
local pkg=$*
|
||||||
hash $cmd 2>/dev/null || yum-install $pkg
|
hash $cmd 2>/dev/null || yum-install $pkg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,14 +89,16 @@ alias yum-install="yum --quiet --nogpgcheck -y install"
|
||||||
|
|
||||||
function ensure_cmd_or_install_package_apt(){
|
function ensure_cmd_or_install_package_apt(){
|
||||||
local cmd=$1
|
local cmd=$1
|
||||||
local pkg=$2
|
shift
|
||||||
|
local pkg=$*
|
||||||
|
|
||||||
hash $cmd 2>/dev/null || ( apt-get-update && apt-get-install $pkg )
|
hash $cmd 2>/dev/null || ( apt-get-update && apt-get-install $pkg )
|
||||||
}
|
}
|
||||||
|
|
||||||
function ensure_cmd_or_install_package_yum(){
|
function ensure_cmd_or_install_package_yum(){
|
||||||
local cmd=$1
|
local cmd=$1
|
||||||
local pkg=$2
|
shift
|
||||||
|
local pkg=$*
|
||||||
hash $cmd 2>/dev/null || yum-install $pkg
|
hash $cmd 2>/dev/null || yum-install $pkg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,14 +89,16 @@ alias yum-install="yum --quiet --nogpgcheck -y install"
|
||||||
|
|
||||||
function ensure_cmd_or_install_package_apt(){
|
function ensure_cmd_or_install_package_apt(){
|
||||||
local cmd=$1
|
local cmd=$1
|
||||||
local pkg=$2
|
shift
|
||||||
|
local pkg=$*
|
||||||
|
|
||||||
hash $cmd 2>/dev/null || ( apt-get-update && apt-get-install $pkg )
|
hash $cmd 2>/dev/null || ( apt-get-update && apt-get-install $pkg )
|
||||||
}
|
}
|
||||||
|
|
||||||
function ensure_cmd_or_install_package_yum(){
|
function ensure_cmd_or_install_package_yum(){
|
||||||
local cmd=$1
|
local cmd=$1
|
||||||
local pkg=$2
|
shift
|
||||||
|
local pkg=$*
|
||||||
hash $cmd 2>/dev/null || yum-install $pkg
|
hash $cmd 2>/dev/null || yum-install $pkg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,16 @@ alias yum-install="yum --quiet --nogpgcheck -y install"
|
||||||
|
|
||||||
function ensure_cmd_or_install_package_apt(){
|
function ensure_cmd_or_install_package_apt(){
|
||||||
local cmd=$1
|
local cmd=$1
|
||||||
local pkg=$2
|
shift
|
||||||
|
local pkg=$*
|
||||||
|
|
||||||
hash $cmd 2>/dev/null || ( apt-get-update && apt-get-install $pkg )
|
hash $cmd 2>/dev/null || ( apt-get-update && apt-get-install $pkg )
|
||||||
}
|
}
|
||||||
|
|
||||||
function ensure_cmd_or_install_package_yum(){
|
function ensure_cmd_or_install_package_yum(){
|
||||||
local cmd=$1
|
local cmd=$1
|
||||||
local pkg=$2
|
shift
|
||||||
|
local pkg=$*
|
||||||
hash $cmd 2>/dev/null || yum-install $pkg
|
hash $cmd 2>/dev/null || yum-install $pkg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,14 +89,16 @@ alias yum-install="yum --quiet --nogpgcheck -y install"
|
||||||
|
|
||||||
function ensure_cmd_or_install_package_apt(){
|
function ensure_cmd_or_install_package_apt(){
|
||||||
local cmd=$1
|
local cmd=$1
|
||||||
local pkg=$2
|
shift
|
||||||
|
local pkg=$*
|
||||||
|
|
||||||
hash $cmd 2>/dev/null || ( apt-get-update && apt-get-install $pkg )
|
hash $cmd 2>/dev/null || ( apt-get-update && apt-get-install $pkg )
|
||||||
}
|
}
|
||||||
|
|
||||||
function ensure_cmd_or_install_package_yum(){
|
function ensure_cmd_or_install_package_yum(){
|
||||||
local cmd=$1
|
local cmd=$1
|
||||||
local pkg=$2
|
shift
|
||||||
|
local pkg=$*
|
||||||
hash $cmd 2>/dev/null || yum-install $pkg
|
hash $cmd 2>/dev/null || yum-install $pkg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,14 +89,16 @@ alias yum-install="yum --quiet --nogpgcheck -y install"
|
||||||
|
|
||||||
function ensure_cmd_or_install_package_apt(){
|
function ensure_cmd_or_install_package_apt(){
|
||||||
local cmd=$1
|
local cmd=$1
|
||||||
local pkg=$2
|
shift
|
||||||
|
local pkg=$*
|
||||||
|
|
||||||
hash $cmd 2>/dev/null || ( apt-get-update && apt-get-install $pkg )
|
hash $cmd 2>/dev/null || ( apt-get-update && apt-get-install $pkg )
|
||||||
}
|
}
|
||||||
|
|
||||||
function ensure_cmd_or_install_package_yum(){
|
function ensure_cmd_or_install_package_yum(){
|
||||||
local cmd=$1
|
local cmd=$1
|
||||||
local pkg=$2
|
shift
|
||||||
|
local pkg=$*
|
||||||
hash $cmd 2>/dev/null || yum-install $pkg
|
hash $cmd 2>/dev/null || yum-install $pkg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue