Commit 5031a1db authored by Vitaly Lipatov's avatar Vitaly Lipatov

move stdc++ checking code to is_stdcpp_enouch() function

parent f263881e
...@@ -66,6 +66,25 @@ get_pkgvendor() ...@@ -66,6 +66,25 @@ get_pkgvendor()
epm print field Vendor for package $1 epm print field Vendor for package $1
} }
# arg: minimal require of libstdc++ version
# return true is we have such version
is_stdcpp_enough()
{
local needed="$1"
local STDCPKG="libstdc++"
epm installed $STDCPKG || STDCPKG="libstdc++6"
if epm installed $STDCPKG ; then
local stdcver
stdcver=$(epm print version for package "$STDCPKG" | head -n1)
if [ -n "$stdcver" ] && [ "$(epm print compare version "$stdcver" "$needed")" = "-1" ] ; then
return 1
fi
fi
return 0
}
get_first() get_first()
{ {
echo "$1" echo "$1"
......
...@@ -15,16 +15,7 @@ case "$(epm print info -s)" in ...@@ -15,16 +15,7 @@ case "$(epm print info -s)" in
;; ;;
esac esac
STDCPKG="libstdc++" is_stdcpp_enough "11.0" || VERSION="4.1.0"
epm installed $STDCPKG || STDCPKG="libstdc++6"
if epm installed $STDCPKG ; then
stdcver=$(epm print version for package "$STDCPKG" | head -n1)
if [ -n "$stdcver" ] && [ "$(epm print compare version "$stdcver" "11.0")" = "-1" ] ; then
# all next versions require libstdc++ >= 11 (libstdc++.so.6(GLIBCXX_3.4.29)(64bit))
VERSION="4.1.0"
fi
fi
PKGURL="$(eget --list --latest https://mango3d.io/downloads/ "LycheeSlicer-$VERSION.deb")" PKGURL="$(eget --list --latest https://mango3d.io/downloads/ "LycheeSlicer-$VERSION.deb")"
......
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