Commit 563f545d authored by Vitaly Lipatov's avatar Vitaly Lipatov

add initial packagekit (pkcon) support

parent ec11eef2
......@@ -197,6 +197,9 @@ case $PMTYPE in
fi
sudocmd aura -Oj
;;
packagekit-*)
docmd pkcon repair --autoremove
;;
yum-rpm)
# cleanup orphanes?
while true ; do
......
......@@ -37,6 +37,9 @@ case $PMTYPE in
sudocmd apt-get -f install || return
#sudocmd apt-get autoremove
;;
packagekit-*)
docmd pkcon repair
;;
aptitude-dpkg)
sudocmd aptitude -f install || return
#sudocmd apt-get autoremove
......
......@@ -198,6 +198,10 @@ epm_download()
aptcyg)
sudocmd apt-cyg download $pkg_filenames
;;
packagekit-*)
# TODO: force
docmd pkcon download $pkg_filenames
;;
yum-rpm)
# TODO: check yum install --downloadonly --downloaddir=/tmp <package-name>
assure_exists yumdownloader yum-utils
......
......@@ -67,6 +67,9 @@ __epm_filelist_remote()
fi
docmd_foreach __deb_local_content_filelist "$@"
;;
packagekit-*)
docmd pkcon get-files "$@"
;;
yum-rpm)
assure_exists yum-utils || return
docmd repoquery -q -l "$@"
......@@ -120,6 +123,9 @@ __epm_filelist_name()
*-dpkg)
CMD="dpkg -L"
;;
packagekit-*)
CMD="pkcon get-files"
;;
android)
CMD="pm list packages -f"
;;
......
#!/bin/sh
#
# Copyright (C) 2012, 2014, 2016 Etersoft
# Copyright (C) 2012, 2014, 2016 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012, 2014, 2016, 2019 Etersoft
# Copyright (C) 2012, 2014, 2016, 2019 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
......@@ -48,10 +48,6 @@ __epm_info_by_pkgtype()
__epm_info_by_pmtype()
{
case $PMTYPE in
apt-rpm)
__epm_info_rpm_low && return
docmd apt-cache show $pkg_names
;;
apt-dpkg)
if [ -n "$pkg_files" ] ; then
docmd dpkg -I $pkg_files
......@@ -67,21 +63,35 @@ case $PMTYPE in
[ -z "$pkg_names" ] && return
docmd aptitude show $pkg_names
;;
yum-rpm)
__epm_info_rpm_low && return
docmd yum info $pkg_names
;;
urpmi-rpm)
__epm_info_rpm_low && return
docmd urpmq -i $pkg_names
;;
dnf-rpm)
__epm_info_rpm_low && return
docmd dnf info $pkg_names
;;
zypper-rpm)
*-rpm)
__epm_info_rpm_low && return
docmd zypper info $pkg_names
case $PMTYPE in
apt-rpm)
docmd apt-cache show $pkg_names
;;
packagekit-rpm)
docmd pkcon get-details $pkg_names
;;
yum-rpm)
docmd yum info $pkg_names
;;
urpmi-rpm)
docmd urpmq -i $pkg_names
;;
dnf-rpm)
docmd dnf info $pkg_names
;;
zypper-rpm)
docmd zypper info $pkg_names
;;
*)
warning "Unknown command for $PMTYPE"
;;
esac
;;
packagekit-*)
# TODO: get-details-local
docmd pkcon get-details $pkg_names
;;
pacman)
is_installed $pkg_names && docmd pacman -Qi $pkg_names && return
......
#!/bin/sh
#
# Copyright (C) 2012-2018 Etersoft
# Copyright (C) 2012-2018 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012-2019 Etersoft
# Copyright (C) 2012-2019 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
......@@ -129,6 +129,9 @@ epm_install_names()
urpm-rpm)
sudocmd urpmi $URPMOPTIONS $@
return ;;
packagekit-*)
docmd pkcon install $@
return ;;
pkgsrc)
sudocmd pkg_add -r $@
return ;;
......@@ -230,6 +233,9 @@ epm_ni_install_names()
# FIXME: returns true ever no package found, need check for "no found", "Nothing to do."
yes | sudocmd zypper --non-interactive $ZYPPEROPTIONS install $@
return ;;
packagekit-*)
docmd pkcon install --noninteractive $@
return ;;
pkgsrc)
sudocmd pkg_add -r $@
return ;;
......@@ -315,9 +321,9 @@ epm_install_files()
# TODO: check read permissions
# sudo test -r FILE
# do not fallback to install_names if we have no permissions
case "$DISTRNAME" in
"ALTLinux")
case $PMTYPE in
apt-rpm)
# TODO: replace with name changed function
__epm_check_if_try_install_deb $@ && return
......@@ -334,7 +340,9 @@ epm_install_files()
# use install_names
;;
esac
case $PMTYPE in
apt-dpkg|aptitude-dpkg)
# the new version of the conf. file is installed with a .dpkg-dist suffix
if [ -n "$non_interactive" ] ; then
......@@ -358,34 +366,7 @@ epm_install_files()
return
;;
yum-rpm|dnf-rpm)
__epm_check_if_try_install_deb $@ && return
sudocmd rpm -Uvh $force $nodeps $@ && return
# if run with --nodeps, do not fallback on hi level
__epm_check_if_rpm_already_installed $@ && return
[ -n "$nodeps" ] && return
YUMOPTIONS=--nogpgcheck
# use install_names
;;
zypper-rpm)
__epm_check_if_try_install_deb $@ && return
sudocmd rpm -Uvh $force $nodeps $@ && return
local RES=$?
__epm_check_if_rpm_already_installed $@ && return
# if run with --nodeps, do not fallback on hi level
[ -n "$nodeps" ] && return $RES
ZYPPEROPTIONS=$(__use_zypper_no_gpg_checks)
# use install_names
;;
urpm-rpm)
*-rpm)
__epm_check_if_try_install_deb $@ && return
sudocmd rpm -Uvh $force $nodeps $@ && return
local RES=$?
......@@ -395,9 +376,27 @@ epm_install_files()
# if run with --nodeps, do not fallback on hi level
[ -n "$nodeps" ] && return $RES
URPMOPTIONS=--no-verify-rpm
# use install_names
case $PMTYPE in
yum-rpm|dnf-rpm)
YUMOPTIONS=--nogpgcheck
# use install_names
;;
zypper-rpm)
ZYPPEROPTIONS=$(__use_zypper_no_gpg_checks)
# use install_names
;;
urpm-rpm)
URPMOPTIONS=--no-verify-rpm
# use install_names
;;
*)
# use install_names
;;
esac
;;
packagekit-*)
docmd pkcon install-local $@
return ;;
pkgsrc)
sudocmd pkg_add $@
return ;;
......@@ -518,6 +517,9 @@ epm_print_install_names_command()
zypper-rpm)
echo "zypper --non-interactive $ZYPPEROPTIONS install $*"
return ;;
packagekit-*)
echo "pkcon --noninteractive $*"
return ;;
pacman)
echo "pacman -S --noconfirm $force $*"
return ;;
......
......@@ -84,6 +84,9 @@ case $PMTYPE in
[ -n "$short" ] && CMD="rpm -qa --queryformat %{name}\n $pkg_filenames"
docmd $CMD
return ;;
packagekit-*)
docmd pkcon get-packages --filter installed
;;
emerge)
CMD="qlist -I -C"
# print with colors for console output
......
......@@ -34,8 +34,8 @@ case $PMTYPE in
apt-rpm)
docmd apt-cache policy $pkg_names
;;
apt-dpkg)
docmd apt-cache policy $pkg_names
packagekit-*)
docmd pkcon resolve $pkg_names
;;
*)
fatal "Have no suitable command for $PMTYPE"
......
......@@ -33,6 +33,10 @@ epm_reinstall_names()
aptitude-dpkg)
sudocmd aptitude reinstall $@
return ;;
packagekit-*)
warning "Please send me the correct command form for it"
docmd pkcon install --allow-reinstall $@
return ;;
yum-rpm)
sudocmd yum reinstall $@
return ;;
......
......@@ -326,6 +326,9 @@ epm_release_upgrade()
assure_exists do-release-upgrade update-manager-core
sudocmd do-release-upgrade
;;
packagekit-*)
docmd pkcon upgrade-system $pkg_filenames
;;
yum-rpm)
docmd epm install rpm yum
sudocmd yum clean all
......
......@@ -72,6 +72,9 @@ epm_remove_names()
apt-rpm)
sudocmd apt-get remove $APTOPTIONS $@
return ;;
packagekit-*)
docmd pkcon remove $@
return ;;
deepsolver-rpm)
sudocmd ds-remove $@
return ;;
......@@ -164,6 +167,9 @@ epm_remove_nonint()
apt-rpm)
sudocmd apt-get -y --force-yes remove $@
return ;;
packagekit-*)
docmd pkcon remove --noninteractive $@
return ;;
urpm-rpm)
sudocmd urpme --auto $@
return ;;
......@@ -204,6 +210,9 @@ epm_print_remove_command()
apt-dpkg|aptitude-dpkg)
echo "dpkg -P $*"
;;
packagekit-*)
echo "pkcon remove --noninteractive $*"
;;
pkgsrc)
echo "pkg_delete -r $*"
;;
......
#!/bin/sh
#
# Copyright (C) 2012, 2016 Etersoft
# Copyright (C) 2012, 2016 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012, 2016, 2019 Etersoft
# Copyright (C) 2012, 2016, 2019 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
......@@ -54,6 +54,9 @@ case $PMTYPE in
zypper-rpm)
docmd zypper sl -d
;;
packagekit-*)
docmd pkcon repo-list
;;
emerge)
docmd eselect profile list
docmd layman -L
......
#!/bin/sh
#
# Copyright (C) 2012-2013, 2016, 2018 Etersoft
# Copyright (C) 2012-2013, 2016, 2018 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012-2013, 2016, 2018, 2019 Etersoft
# Copyright (C) 2012-2013, 2016, 2018, 2019 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
......@@ -61,7 +61,9 @@ case $PMTYPE in
#return
CMD="apt-cache depends"
fi
;;
packagekit-*)
CMD="pkcon required-by"
;;
#zypper-rpm)
# # FIXME: use hi level commands
......
#!/bin/sh
#
# Copyright (C) 2012, 2013, 2016-2018 Etersoft
# Copyright (C) 2012, 2013, 2016-2018 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012, 2013, 2016-2019 Etersoft
# Copyright (C) 2012, 2013, 2016-2019 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
......@@ -34,6 +34,9 @@ case $PMTYPE in
deepsolver-rpm)
CMD="ds-require --"
;;
packagekit-*)
CMD="pkcon search name"
;;
urpm-rpm)
# urpmq does not support --
CMD="urpmq -y"
......
#!/bin/sh
#
# Copyright (C) 2012, 2016, 2017 Etersoft
# Copyright (C) 2012, 2016, 2017 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012, 2016, 2017, 2019 Etersoft
# Copyright (C) 2012, 2016, 2017, 2019 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
......@@ -61,6 +61,9 @@ case $PMTYPE in
sudocmd apt-file update
docmd apt-file search $pkg_filenames
return ;;
packagekit-*)
CMD="pkcon search file"
;;
yum-rpm)
# TODO
info "Search by full packages list is not implemented yet"
......
......@@ -475,12 +475,16 @@ if [ -n "$FORCEPM" ] ; then
return
fi
# TODO: in more appropriate way
#which pkcon 2>/dev/null >/dev/null && info "You can run $ PMTYPE=packagekit epm to use packagekit backend"
# TODO: move it in distr_vendor?
# FIXME: some problems with multibased distros (Server Edition on CentOS and Desktop Edition on Ubuntu)
case $DISTRNAME in
ALTLinux)
CMD="apt-rpm"
#which ds-install 2>/dev/null >/dev/null && CMD=deepsolver-rpm
#which pkcon 2>/dev/null >/dev/null && CMD=packagekit-rpm
;;
PCLinux)
CMD="apt-rpm"
......
......@@ -38,6 +38,9 @@ case $PMTYPE in
#sudocmd apt-get -f install || exit
#sudocmd apt-get autoremove
;;
packagekit-*)
docmd pkcon refresh
;;
#snappy)
# sudocmd snappy
# ;;
......
#!/bin/sh
#
# Copyright (C) 2012, 2014, 2016 Etersoft
# Copyright (C) 2012, 2014, 2016 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012, 2014, 2016, 2019 Etersoft
# Copyright (C) 2012, 2014, 2016, 2019 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
......@@ -41,6 +41,10 @@ epm_upgrade()
aptitude-dpkg)
CMD="aptitude dist-upgrade"
;;
packagekit-*)
docmd pkcon update
return
;;
yum-rpm)
local OPTIONS="$(subst_option non_interactive -y)"
# can do update repobase automagically
......
......@@ -44,6 +44,9 @@ case $PMTYPE in
aptitude-dpkg)
CMD="aptitude why"
;;
packagekit-*)
CMD="pkcon depends-on"
;;
yum-rpm)
CMD="repoquery --whatrequires"
;;
......
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