mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-12-01 20:05:43 +03:00
create function - un nest ifs.
This commit is contained in:
parent
3312a96909
commit
2648829eb0
@ -1,33 +1,36 @@
|
||||
|
||||
THE_PATH=`python -c 'import pkg_resources; print( pkg_resources.get_distribution("chiavdf").location)' 2> /dev/null`/vdf_client
|
||||
CHIAVDF_VERSION=`python -c 'from setup import dependencies; t = [_ for _ in dependencies if _.startswith("chiavdf")][0]; print(t)'`
|
||||
UBUNTU_BUILD_REQUIREMENTS=(cmake libgmp-dev libboost-python-dev libbost-system-dev)
|
||||
|
||||
if [ `uname` = "Linux" ] && type apt-get;
|
||||
then UBUNTU_DEBIAN=1
|
||||
fi
|
||||
|
||||
echo "This script assumes it is run from the chia venv - '. ./activate' before running."
|
||||
|
||||
install_debian_requirements() {
|
||||
for packages in "${UBUNTU_BUILD_REQUIREMENTS[@]}"; do
|
||||
if [ $UBUNTU_DEBIAN && ! dpkg -s $Packages >/dev/null 2>&1;
|
||||
then
|
||||
sudo apt-get install $Packages -y
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
#echo "This script assumes it is run from the chia venv - '. ./activate' before running."
|
||||
|
||||
if [ -e $THE_PATH ]
|
||||
then
|
||||
echo $THE_PATH
|
||||
echo "vdf_client already exists, no action taken"
|
||||
else
|
||||
if [ -e venv/bin/python ]
|
||||
if [ -e venv/bin/python && $UBUNTU_DEBIAN ]
|
||||
then
|
||||
echo "installing chiavdf from source"
|
||||
# Check for development tools
|
||||
if [ `uname` = "Linux" ] && type apt-get;
|
||||
then
|
||||
echo "Found Ubuntu/Debian"
|
||||
BUILD_REQUIREMENTS=(cmake libgmp-dev libboost-python-dev libbost-system-dev)
|
||||
for packages in "${BUILD_REQUIREMENTS[@]}"; do
|
||||
echo "$packages";
|
||||
done
|
||||
#if ! dpkg -s $Packages >/dev/null 2>&1; then
|
||||
#echo "Installing $Packages."
|
||||
#sudo apt-get install $Packages -y
|
||||
#fi;
|
||||
#done
|
||||
fi
|
||||
install_debian_requirements
|
||||
echo venv/bin/python -m pip install --force --no-binary chiavdf $CHIAVDF_VERSION
|
||||
#venv/bin/python -m pip install --force --no-binary chiavdf $CHIAVDF_VERSION
|
||||
venv/bin/python -m pip install --force --no-binary chiavdf $CHIAVDF_VERSION
|
||||
else
|
||||
echo "no venv created yet, please run install.sh"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user