Commit 186a6be0 authored by Boris Yumankulov's avatar Boris Yumankulov Committed by Vitaly Lipatov

distr_info: added dnf5-rpm package manager

parent f90f7598
......@@ -237,6 +237,9 @@ case $DISTRIB_ID in
echo "pkgmanager(): We don't support yet DISTRIB_ID $DISTRIB_ID (VENDOR_ID $VENDOR_ID)" >&2
;;
esac
if [ "$CMD" = "dnf-rpm" ] && [ $(dnf --version | grep -qi "dnf5") ] ; then
CMD="dnf5-rpm"
fi
echo "$CMD"
}
......
......@@ -89,7 +89,7 @@ case $PMTYPE in
local PKGLIST=$(a= package-cleanup -q --orphans | grep -v "^eepm-")
docmd epm remove $dryrun $PKGLIST
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
# TODO: dnf list extras
docmd epm upgrade
assure_exists package-cleanup dnf-utils
......
......@@ -303,7 +303,7 @@ case $PMTYPE in
docmd epm remove $PKGLIST
done
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
if [ -n "$dryrun" ] ; then
fatal "--dry-run is not supported yet"
fi
......
......@@ -51,7 +51,7 @@ __epm_changelog_local_names()
[ -z "$*" ] && return
case $PMTYPE in
apt-rpm|yum-rpm|dnf-rpm|urpm-rpm|zypper-rpm)
apt-rpm|yum-rpm|dnf-rpm|dnf5-rpm|urpm-rpm|zypper-rpm)
docmd_foreach "rpm -q --changelog" $@
;;
apt-dpkg|aptitude-dpkg)
......
......@@ -67,7 +67,7 @@ case $PMTYPE in
docmd rpm -Va --nofiles --nodigest
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
sudocmd dnf check $DNFOPTIONS
;;
emerge)
......
......@@ -59,7 +59,7 @@ case $PMTYPE in
sudocmd yum clean all
#sudocmd yum makecache
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
sudocmd dnf clean all
;;
urpm-rpm)
......
......@@ -135,7 +135,7 @@ epm_downgrade()
sudocmd yum distro-sync
fi
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
if [ -n "$pkg_filenames" ] ; then
sudocmd dnf downgrade $pkg_filenames
else
......
......@@ -279,7 +279,7 @@ epm_download()
fi
docmd apt-get download $*
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
sudocmd dnf download $print_url $*
;;
aptcyg)
......
......@@ -81,7 +81,7 @@ __epm_filelist_remote()
assure_exists yum-utils
docmd repoquery -q -l "$@"
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
assure_exists dnf-plugins-core
docmd dnf repoquery -l "$@"
;;
......
......@@ -78,7 +78,7 @@ case $PMTYPE in
urpmi-rpm)
docmd urpmq -i $pkg_names
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
docmd dnf info $pkg_names
;;
zypper-rpm)
......
......@@ -135,7 +135,7 @@ epm_install_names()
yum-rpm)
sudocmd yum $YUMOPTIONS install $(echo "$*" | exp_with_arch_suffix)
return ;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
sudocmd dnf install $(echo "$*" | exp_with_arch_suffix)
return ;;
snappy)
......@@ -223,7 +223,7 @@ epm_ni_install_names()
yum-rpm)
sudocmd yum -y $YUMOPTIONS install $(echo "$*" | exp_with_arch_suffix)
return ;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
sudocmd dnf install -y --allowerasing $YUMOPTIONS $(echo "$*" | exp_with_arch_suffix)
return ;;
urpm-rpm)
......
......@@ -103,7 +103,7 @@ epm_print_install_names_command()
yum-rpm)
echo "yum -y $YUMOPTIONS install $*"
return ;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
echo "dnf install -y $YUMOPTIONS --allowerasing $*"
return ;;
urpm-rpm)
......
......@@ -93,7 +93,7 @@ esac
esac
case $PMTYPE in
dnf-rpm)
dnf-rpm|dnf5-rpm)
docmd epm install kernel
;;
apt-*)
......
......@@ -91,7 +91,7 @@ case $PMTYPE in
apt-dpkg)
sudocmd apt-mark hold "$@"
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
__dnf_assure_versionlock
sudocmd dnf versionlock add "$@"
;;
......
......@@ -249,7 +249,7 @@ print_srcpkgname()
docmd urpmq --sourcerpm "$@"
return
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
showcmd dnf repoquery --qf '%{SOURCERPM}' "$@"
a= dnf repoquery --qf '%{SOURCERPM}' "$@"
return
......
......@@ -92,7 +92,7 @@ case $PMTYPE in
fixme "FIXME: use hi level commands or download firstly"
fi
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
if is_installed $pkg_names ; then
CMD="rpm -q --provides"
else
......
......@@ -45,7 +45,7 @@ exp_with_arch_suffix()
# TODO: it is ok for ALT rpm to remove with this suffix
# TODO: separate install and remove?
case $PMTYPE in
yum-rpm|dnf-rpm)
yum-rpm|dnf-rpm|dnf5-rpm)
suffix=".x86_64"
;;
*)
......@@ -146,7 +146,7 @@ __epm_get_hilevel_nameform()
echo $pkg
return
;;
yum-rpm|dnf-rpm)
yum-rpm|dnf-rpm|dnf5-rpm)
# just use strict version with Epoch and Serial
local pkg
#pkg=$(rpm -q --queryformat "%{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" -- $1)
......
......@@ -40,7 +40,7 @@ epm_reinstall_names()
yum-rpm)
sudocmd yum reinstall $@
return ;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
sudocmd dnf reinstall $@
return ;;
homebrew)
......
......@@ -119,7 +119,7 @@ epm_release_downgrade()
showcmd rpm -Uvh http://mirror.yandex.ru/fedora/linux/releases/16/Fedora/x86_64/os/Packages/fedora-release-16-1.noarch.rpm
showcmd epm Upgrade
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
info "Check https://fedoraproject.org/wiki/DNF_system_upgrade for an additional info"
docmd epm install dnf
#docmd epm install epel-release yum-utils
......
......@@ -124,7 +124,7 @@ epm_remove_names()
yum-rpm)
sudocmd yum remove $@
return ;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
sudocmd dnf remove $@
return ;;
snappy)
......
......@@ -121,7 +121,7 @@ case $PMTYPE in
docmd yum repolist $verbose
[ -n "$verbose" ] || info "Use --verbose if you need detail information."
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
docmd dnf repolist $verbose
[ -n "$verbose" ] || info "Use --verbose if you need detail information."
;;
......
......@@ -151,7 +151,7 @@ case $PMTYPE in
CMD="yum deplist"
fi
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
if is_installed $pkg_names ; then
CMD="rpm -q --requires"
else
......
......@@ -62,7 +62,7 @@ case $PMTYPE in
yum-rpm)
CMD="yum search"
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
CMD="dnf search"
;;
zypper-rpm)
......
......@@ -80,7 +80,7 @@ case $PMTYPE in
info "Search by full packages list is not implemented yet"
CMD="yum provides"
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
# TODO
info "Search by full packages list is not implemented yet"
CMD="dnf provides"
......
......@@ -131,7 +131,7 @@ case $PMTYPE in
# just skipped
[ -z "$verbose" ] || info "update command is stubbed for yum"
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
# just skipped
[ -z "$verbose" ] || info "update command is stubbed for dnf"
;;
......
......@@ -140,7 +140,7 @@ epm_upgrade()
# can do update repobase automagically
CMD="yum $OPTIONS upgrade $*"
;;
dnf-rpm)
dnf-rpm|dnf5-rpm)
local OPTIONS="$(subst_option non_interactive -y)"
CMD="dnf $OPTIONS upgrade $*"
;;
......
......@@ -41,8 +41,8 @@ case $PMTYPE in
urpm-rpm)
CMD="urpmq --whatprovides"
;;
dnf-rpm)
CMD="yum provides"
dnf-rpm|dnf5-rpm)
CMD="dnf repoquery --whatprovides"
;;
zypper-rpm)
CMD="zypper what-provides"
......
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