mirror of
https://github.com/YunoHost-Apps/homeassistant_ynh.git
synced 2024-09-03 19:26:16 +02:00
Update updater
This commit is contained in:
parent
5ac1afdeb6
commit
cba58c8512
1 changed files with 9 additions and 3 deletions
8
.github/workflows/updater.sh
vendored
8
.github/workflows/updater.sh
vendored
|
@ -50,8 +50,14 @@ sed -i "s/^app_version=.*/app_version=$upstream_version/" scripts/_common.sh
|
|||
# Replace python required version
|
||||
py_required_major=$(curl -Ls https://pypi.org/pypi/$app/json | jq -r .info.requires_python | cut -d '=' -f 2 | rev | cut -d"." -f2- | rev)
|
||||
py_required_minor=$(curl -s "https://www.python.org/ftp/python/" | grep ">$py_required_major" | cut -d '/' -f 2 | cut -d '>' -f 2 | sort -rV | head -n 1)
|
||||
current_py_required_minor=$(cat scripts/_common.sh | grep "py_required_version=" | cut -d '=' -f 2)
|
||||
if ! dpkg --compare-versions "$current_py_required_minor" "lt" "$py_required_minor"
|
||||
then
|
||||
echo "::warning :: No need to update required python version"
|
||||
else
|
||||
echo "::warning :: Updating required python version to new upstream python version"
|
||||
sed -i "s/^py_required_version=.*/py_required_version=$py_required_minor/" scripts/_common.sh
|
||||
|
||||
fi
|
||||
# Replace pip required version
|
||||
pip_required=$(curl -Ls https://pypi.org/pypi/$app/json | jq -r .info.requires_dist[] | grep "pip") #"pip (<23.1,>=21.0)"
|
||||
sed -i "s/^pip_required=.*/pip_required=\"$pip_required\"/" scripts/_common.sh
|
||||
|
|
Loading…
Reference in a new issue