fix some differences between ruby-build (refs #8)

This commit is contained in:
Yamashita Yuu 2013-02-07 17:32:10 +09:00
parent ea7dc5f1e1
commit ad900ba436
2 changed files with 10 additions and 9 deletions

View file

@ -81,7 +81,6 @@ DEFINITION="${ARGUMENTS[0]}"
[ -n "$DEFINITION" ] || usage 1 [ -n "$DEFINITION" ] || usage 1
# Define `before_install` and `after_install` functions that allow # Define `before_install` and `after_install` functions that allow
# plugin hooks to register a string of code for execution before or # plugin hooks to register a string of code for execution before or
# after the installation process. # after the installation process.
@ -120,7 +119,7 @@ if [ -z "$FORCE" ] && [ -d "${PREFIX}/bin" ]; then
esac esac
fi fi
# If PYENV_BUILD_ROOT is set, always pass keep options to python-build # If PYENV_BUILD_ROOT is set, always pass keep options to python-build.
if [ -n "${PYENV_BUILD_ROOT}" ]; then if [ -n "${PYENV_BUILD_ROOT}" ]; then
export PYTHON_BUILD_BUILD_PATH="${PYENV_BUILD_ROOT}/${VERSION_NAME}" export PYTHON_BUILD_BUILD_PATH="${PYENV_BUILD_ROOT}/${VERSION_NAME}"
KEEP="-k" KEEP="-k"
@ -136,7 +135,6 @@ fi
# Execute `before_install` hooks. # Execute `before_install` hooks.
for hook in "${before_hooks[@]}"; do eval "$hook"; done for hook in "${before_hooks[@]}"; do eval "$hook"; done
# Invoke `python-build` and record the exit status in $STATUS. Run # Invoke `python-build` and record the exit status in $STATUS. Run
# `pyenv rehash` after a successful installation. # `pyenv rehash` after a successful installation.
STATUS=0 STATUS=0

View file

@ -96,6 +96,10 @@ install_git() {
install_package_using "git" 2 $* install_package_using "git" 2 $*
} }
install_svn() {
install_package_using "svn" 2 $*
}
install_jar() { install_jar() {
install_package_using "jar" 1 $* install_package_using "jar" 1 $*
} }
@ -130,7 +134,7 @@ make_package() {
} }
compute_md5() { compute_md5() {
if type md5 >/dev/null; then if type md5 &>/dev/null; then
md5 -q md5 -q
elif type openssl &>/dev/null; then elif type openssl &>/dev/null; then
local output="$(openssl md5)" local output="$(openssl md5)"
@ -341,8 +345,8 @@ build_package_standard() {
fi fi
{ ./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS { ./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
make $MAKE_OPTS "$MAKE" $MAKE_OPTS
make install "$MAKE" install
} >&4 2>&1 } >&4 2>&1
} }
@ -354,8 +358,7 @@ build_package_autoconf() {
build_package_python() { build_package_python() {
local package_name="$1" local package_name="$1"
{ { "$PYTHON_BIN" setup.py install
"$PYTHON_BIN" setup.py install
} >&4 2>&1 } >&4 2>&1
} }
@ -539,7 +542,7 @@ usage() {
list_definitions() { list_definitions() {
{ for definition in "${PYTHON_BUILD_ROOT}/share/python-build/"*; do { for definition in "${PYTHON_BUILD_ROOT}/share/python-build/"*; do
test -f "${definition}" && echo "${definition##*/}" echo "${definition##*/}"
done done
} | sort } | sort
} }