Commit edd8e5ad authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm print compare version: implement via lua:print for non ALT rpm)

parent 84dd9d6f
......@@ -259,12 +259,17 @@ print_srcpkgname()
rpm_query_package_field "sourcerpm" "$@"
}
# https://blog.jasonantman.com/2014/07/how-yum-and-rpm-compare-versions/
compare_version()
{
case $PMTYPE in
*-rpm)
is_command rpmevrcmp || fatal "rpmevrcmp exists in ALT Linux only"
# rpmevrcmp exists in ALT Linux only
if is_command rpmevrcmp ; then
a= rpmevrcmp "$@"
else
a= rpm --eval "%{lua:print(rpm.vercmp('$1', '$2'))}"
fi
;;
*-dpkg)
a= dpkg --compare-versions "$1" lt "$2" && echo "-1" && return
......
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