From ebac658e23f7a1586351a1e021596531928d559e Mon Sep 17 00:00:00 2001 From: fivepiece Date: Sat, 23 Sep 2017 20:24:59 +0300 Subject: [PATCH] install.sh accepts flags * add parsing * add --develop flag * joinmarket_install() removes previous version before installing --- install.sh | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 367a3a7..27c4e01 100755 --- a/install.sh +++ b/install.sh @@ -254,13 +254,29 @@ libsodium_install () joinmarket_install () { jm_pkgs=( 'jmbase' 'jmdaemon' 'jmbitcoin' 'jmclient' ) + rm -rf "${jm_root}/lib/python2.7/site-packages/easy-install.pth" for pkg in ${jm_pkgs[@]}; do + rm -rf "${jm_root}/lib/python2.7/site-packages/${pkg/jm/joinmarket}"* pushd "${pkg}" - pip install . || return 1 + pip install ${develop_build:+-e} . || return 1 popd done } +parse_flags () +{ + for flag in ${@}; do + case ${flag} in + --develop) + develop_build='1' + ;; + *) + echo "warning. unknown flag : ${flag}" 1>&2 + ;; + esac + done +} + main () { jm_source="$PWD" @@ -270,6 +286,10 @@ main () export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${jm_root}/lib" export C_INCLUDE_PATH="${C_INCLUDE_PATH}:${jm_root}/include" + # flags + develop_build='' + parse_flags ${@} + if ! deb_deps_install; then echo "Dependecies could not be installed. Exiting." return 1 @@ -309,4 +329,4 @@ main () from this directiry, to acticate virtualenv." } -main +main ${@}