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