WIP: Attempting to install erlang 17.3.4 now

This commit is contained in:
Akash Manohar J 2014-11-30 11:32:57 +05:30
parent 32fe431ae6
commit 26c67bc32f
3 changed files with 20 additions and 17 deletions

View File

@ -1,9 +1,10 @@
run_command() {
run_callback_if_command "--version" $1 asdf_version "${@:2}"
run_callback_if_command "install" $1 install_command "${@:2}"
run_callback_if_command "list" $1 list_command "${@:2}"
run_callback_if_command "list-all" $1 list_all_command "${@:2}"
run_callback_if_command "help" $1 help_command "${@:2}"
local callback_args="${@:2}"
run_callback_if_command "--version" $1 asdf_version $callback_args
run_callback_if_command "install" $1 install_command $callback_args
run_callback_if_command "list" $1 list_command $callback_args
run_callback_if_command "list-all" $1 list_all_command $callback_args
run_callback_if_command "help" $1 help_command $callback_args
help_command
@ -19,7 +20,7 @@ install_command() {
check_if_source_exists $source_path
local install_path=$(get_install_path $package $version)
./${source_path}/install $version $install_path "${@:3}"
${source_path}/install $version $install_path "${@:3}"
}
@ -35,7 +36,7 @@ get_install_path() {
list_all_command() {
local source_path=$(get_source_path $1)
check_if_source_exists $source_path
./${source_path}/list-all
${source_path}/list-all
}

View File

@ -4,7 +4,12 @@ asdf_version() {
asdf_dir() {
echo $(dirname $(dirname $0))
if [ -z $ASDF_DIR ]
then
export ASDF_DIR=$(cd $(dirname $(dirname $0)); echo $(pwd))
fi
echo $ASDF_DIR
}

View File

@ -7,9 +7,7 @@ install_erlang() {
local install_path=$2
local source_path=$(get_download_file_path $1)
# download_git_source $1
cp ~/projects/asdf/tryout/otp-17.3.4.tar.gz $TMPDIR/
download_git_source $1
# running this in a subshell
# because we don't want to disturb current working dir
@ -19,11 +17,9 @@ install_erlang() {
tar zxf $source_path
cd $(untar_path $1)
./otp_build autoconf
pwd
echo $install_path
./configure --prefix=$install_path
# make
# make install
make
make install
)
}
@ -41,14 +37,15 @@ download_git_source() {
get_download_file_path() {
local version=$1
echo "$TMPDIR/otp-$1.tar.gz"
local pkg_name="otp-$1.tar.gz"
echo "$TMPDIR$pkg_name"
}
get_github_download_url() {
local version=$1
#TODO support downloading tags, branches and commits
echo "https://github.com/erlang/otp/archive/OTP-${$1}.tar.gz"
echo "https://github.com/erlang/otp/archive/OTP-$1.tar.gz"
}