Commit cfbe7dde authored by Vitaly Lipatov's avatar Vitaly Lipatov

distr_info: improve checking for default package manager

parent d18c8184
......@@ -100,7 +100,7 @@ case $DISTRIB_ID in
PCLinux)
CMD="apt-rpm"
;;
Ubuntu|Debian|Mint|AstraLinux*|Elbrus)
Ubuntu|Debian|Mint|OSNovaLinux|AstraLinux*|Elbrus)
CMD="apt-dpkg"
#which aptitude 2>/dev/null >/dev/null && CMD=aptitude-dpkg
#hascommand snappy && CMD=snappy
......@@ -168,17 +168,23 @@ case $DISTRIB_ID in
;;
*)
# try detect firstly
if hascommand "rpm" ; then
if grep -q "ID_LIKE=debian" /etc/os-release 2>/dev/null ; then
echo "apt-dpkg" && return
fi
if hascommand "rpm" && [ -s /var/lib/rpm/Name ] ; then
hascommand "zypper" && echo "zypper-rpm" && return
hascommand "apt-get" && echo "apt-rpm" && return
hascommand "dnf" && echo "dnf-rpm" && return
hascommand "apt-get" && echo "apt-rpm" && return
hascommand "yum" && echo "yum-rpm" && return
hascommand "urpmi" && echo "urpmi-rpm" && return
fi
if hascommand "dpkg" ; then
if hascommand "dpkg" && [ -s /var/lib/dpkg/status ] ; then
hascommand "apt" && echo "apt-dpkg" && return
hascommand "apt-get" && echo "apt-dpkg" && return
fi
echo "We don't support yet DISTRIB_ID $DISTRIB_ID" >&2
;;
esac
......
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