Commit 16bad341 authored by Vitaly Lipatov's avatar Vitaly Lipatov

play/common.sh: add version checking

parent 9a24ff55
...@@ -6,6 +6,12 @@ fatal() ...@@ -6,6 +6,12 @@ fatal()
exit 1 exit 1
} }
get_latest_version()
{
local URL="https://eepm.ru/app-versions"
epm tool eget -q -O- "$URL/$1"
}
case "$1" in case "$1" in
"--remove") "--remove")
epm remove $PKGNAME epm remove $PKGNAME
...@@ -19,6 +25,10 @@ case "$1" in ...@@ -19,6 +25,10 @@ case "$1" in
epm installed $PKGNAME epm installed $PKGNAME
exit exit
;; ;;
"--installed-version")
epm print version for package $PKGNAME
exit
;;
"--description") "--description")
echo "$DESCRIPTION" echo "$DESCRIPTION"
exit exit
...@@ -28,6 +38,11 @@ case "$1" in ...@@ -28,6 +38,11 @@ case "$1" in
echo "Skipping update of $PKGNAME (package is not installed)" echo "Skipping update of $PKGNAME (package is not installed)"
exit exit
fi fi
pkgver="$(epm print version for package $PKGNAME)"
if [ -n "$pkgver" ] && [ "$(get_latest_version $PKGNAME)" = "$pkgver" ] ; then
echo "There is no newer version of $PKGNAME then installed version $version."
exit
fi
;; ;;
"--run") "--run")
# just pass # just pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment