libvirt_cloud/roles/toxcore/overlay/Linux/usr/local/src/pyassuan.bash

68 lines
1.7 KiB
Bash
Raw Normal View History

2024-01-04 14:53:42 +00:00
#!/bin/sh
# -*- mode: sh; tab-width: 8; encoding: utf-8-unix -*-
#See /var/local/src/ZeroNet.bash
prog=`basename $0 .bash`
PREFIX=/usr/local
ROLE=toxcore
PYVER=3
P="BASE_PYTHON${PYVER}_MINOR"
[ -z "$PYTHON_MINOR" ] && PYTHON_MINOR="$(eval echo \$$P)"
2024-01-09 14:16:55 +00:00
PYTHON_EXE_MSYS=$PREFIX/bin/python$PYTHON_MINOR.sh
2024-01-04 14:53:42 +00:00
PYTHON_EXE=$PYTHON_EXE_MSYS
2024-01-09 14:16:55 +00:00
PYTHON_PIP_MSYS=$PREFIX/bin/pip$PYTHON_MINOR.sh
2024-01-04 14:53:42 +00:00
MOD="pyassuan"
DIR="${MOD}"
BINS="get-info pinentry"
GIT_HUB=http-git.tremily.us
GIT_DIR=pyassuan
#ols_funtoo_requires
cd $PREFIX/src || exit 2
WD=$PWD
if [ "$#" -eq 0 ] ; then
2024-01-09 14:16:55 +00:00
if [ ! -d "$DIR" ] ; then
if [ ! -d "$PREFIX/net/Git/$GIT_HUB/$GIT_DIR" ] ; then
[ -d "$PREFIX/net/Git/$GIT_HUB" ] || \
2024-01-04 14:53:42 +00:00
mkdir "$PREFIX/net/Git/$GIT_HUB"
2024-01-09 14:16:55 +00:00
route|grep ^def || { DEBUG not connected ; exit 0 ; }
(cd "$PREFIX/net/Git/$GIT_HUB" && \
git clone --depth=1 "http://http-git.tremily.us/pyassuan.git" ) ||\
2024-01-04 14:53:42 +00:00
exit 2
fi
2024-01-09 14:16:55 +00:00
cp -rip "$PREFIX/net/Git/$GIT_HUB/$GIT_DIR" . || \
exit 3
fi
2024-01-04 14:53:42 +00:00
2024-01-09 14:16:55 +00:00
cd "$DIR" || exit 4
2024-01-04 14:53:42 +00:00
2024-01-09 14:16:55 +00:00
# ols_setup_zip_unsafe 's@^ )@ zip_safe=False)@'
2024-01-04 14:53:42 +00:00
#? [ -e /var/local/src/var_local_local.bash ] && . /var/local/src/var_local_local.bash
2024-01-19 01:10:51 +00:00
[ -d $PREFIX/$LIB/python${PYTHON_MINOR}/site-packages/${DIR}-${VER}.dist-info ] || \
msys_python_pip_install . 2>&1 || { ERROR "code $?" ; cat install$PYVER.log ; exit 6 ; }
2024-01-04 14:53:42 +00:00
2024-01-09 14:16:55 +00:00
# msys_python_bins $BINS
2024-01-04 14:53:42 +00:00
"$PYTHON_EXE_MSYS" -c "import $MOD" 2>/dev/null || exit 10
exit 0
elif [ $1 = 'check' ] ; then # 1*
"$PYTHON_EXE_MSYS" -c "import $MOD" 2>/dev/null || exit 20
2024-01-09 14:16:55 +00:00
# ols_test_bins
2024-01-04 14:53:42 +00:00
exit $?
elif [ "$1" = 'test' ] ; then # 3*
cd $WD/$DIR
$PYTHON_EXE_MSYS -m unittest discover >>test.log || exit 31$?
fi