Commit 140052af authored by Vitaly Lipatov's avatar Vitaly Lipatov

distr_info: use VENDOR_ID for detect pkgmanager

parent b60e3944
......@@ -120,20 +120,25 @@ pkgvendor()
# TODO: in more appropriate way
#which pkcon 2>/dev/null >/dev/null && info "You can run $ PMTYPE=packagekit epm to use packagekit backend"
# Print package manager (need DISTRIB_ID var)
# Print package manager (need DISTRIB_ID, DISTRIB_RELEASE vars)
pkgmanager()
{
local CMD
# FIXME: some problems with multibased distros (Server Edition on CentOS and Desktop Edition on Ubuntu)
case $DISTRIB_ID in
ALTLinux|ALTServer)
#which ds-install 2>/dev/null >/dev/null && CMD=deepsolver-rpm
#which pkcon 2>/dev/null >/dev/null && CMD=packagekit-rpm
CMD="apt-rpm"
case $VENDOR_ID in
alt)
echo "apt-rpm" && return
;;
ALTServer)
CMD="apt-rpm"
arch|manjaro)
echo "pacman" && return
;;
debian)
echo "apt-dpkg" && return
;;
esac
# FIXME: some problems with multibased distros (Server Edition on CentOS and Desktop Edition on Ubuntu)
case $DISTRIB_ID in
PCLinux)
CMD="apt-rpm"
;;
......@@ -214,11 +219,6 @@ case $DISTRIB_ID in
CMD="xbps"
;;
*)
# try detect firstly
if grep -q "ID_LIKE=debian" /etc/os-release 2>/dev/null ; then
echo "apt-dpkg" && return
fi
if is_command "rpm" && [ -s /var/lib/rpm/Name ] || [ -s /var/lib/rpm/rpmdb.sqlite ] ; then
is_command "zypper" && echo "zypper-rpm" && return
is_command "dnf" && echo "dnf-rpm" && return
......@@ -232,7 +232,7 @@ case $DISTRIB_ID in
is_command "apt-get" && echo "apt-dpkg" && return
fi
echo "pkgmanager(): We don't support yet DISTRIB_ID $DISTRIB_ID" >&2
echo "pkgmanager(): We don't support yet DISTRIB_ID $DISTRIB_ID (VENDOR_ID $VENDOR_ID)" >&2
;;
esac
echo "$CMD"
......@@ -299,6 +299,9 @@ normalize_name()
"Debian GNU/Linux")
echo "Debian"
;;
"Liya GNU/Linux")
echo "LiyaLinux"
;;
"CentOS Linux")
echo "CentOS"
;;
......@@ -372,11 +375,12 @@ if distro os-release ; then
DISTRIB_RELEASE_ORIG="$VERSION_ID"
DISTRIB_RELEASE="$VERSION_ID"
[ -n "$DISTRIB_RELEASE" ] || DISTRIB_RELEASE="CUR"
[ "$BUILD_ID" = "rolling" ] && DISTRIB_RELEASE="rolling"
# set by os-release:
#PRETTY_NAME
VENDOR_ID="$ID"
case "$VENDOR_ID" in
ubuntu|reld|rhel|astra)
ubuntu|reld|rhel|astra|manjaro)
;;
*)
[ -n "$ID_LIKE" ] && VENDOR_ID="$(echo "$ID_LIKE" | cut -d" " -f1)"
......
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