Commit 6dafd74d authored by Vitaly Lipatov's avatar Vitaly Lipatov

backported to p8 as 3.1.0-alt0.M80P.1 (with rpmbph script)

parents 41d45e06 dc885073
...@@ -116,15 +116,19 @@ fi ...@@ -116,15 +116,19 @@ fi
# ALT Linux based # ALT Linux based
if distro altlinux-release ; then if distro altlinux-release ; then
# TODO: use os-release firsly
DISTRIB_ID="ALTLinux" DISTRIB_ID="ALTLinux"
if has Sisyphus ; then DISTRIB_RELEASE="Sisyphus" if has Sisyphus ; then DISTRIB_RELEASE="Sisyphus"
elif has "ALT Linux 7." ; then DISTRIB_RELEASE="p7" elif has "ALT Linux 7." ; then DISTRIB_RELEASE="p7"
elif has "ALT Linux t7." ; then DISTRIB_RELEASE="t7" elif has "ALT Linux t7." ; then DISTRIB_RELEASE="t7"
elif has "ALT Linux 8." ; then DISTRIB_RELEASE="p8" elif has "ALT Linux 8." ; then DISTRIB_RELEASE="p8"
elif has "ALT .*8.[0-9]" ; then DISTRIB_RELEASE="p8" elif has "ALT .*8.[0-9]" ; then DISTRIB_RELEASE="p8"
elif has "ALT .*9.[0-9]" ; then DISTRIB_RELEASE="p9"
elif has "ALT p9 p9" ; then DISTRIB_RELEASE="p9"
elif has "Simply Linux 6." ; then DISTRIB_RELEASE="p6" elif has "Simply Linux 6." ; then DISTRIB_RELEASE="p6"
elif has "Simply Linux 7." ; then DISTRIB_RELEASE="p7" elif has "Simply Linux 7." ; then DISTRIB_RELEASE="p7"
elif has "Simply Linux 8." ; then DISTRIB_RELEASE="p8" elif has "Simply Linux 8." ; then DISTRIB_RELEASE="p8"
elif has "Simply Linux 9." ; then DISTRIB_RELEASE="p9"
elif has "ALT Linux 6." ; then DISTRIB_RELEASE="p6" elif has "ALT Linux 6." ; then DISTRIB_RELEASE="p6"
elif has "ALT Linux p8" ; then DISTRIB_RELEASE="p8" elif has "ALT Linux p8" ; then DISTRIB_RELEASE="p8"
elif has "ALT Linux p7" ; then DISTRIB_RELEASE="p7" elif has "ALT Linux p7" ; then DISTRIB_RELEASE="p7"
......
...@@ -232,7 +232,7 @@ check_command() ...@@ -232,7 +232,7 @@ check_command()
assure) # HELPCMD: <command> [package]: install package if command does not exist assure) # HELPCMD: <command> [package]: install package if command does not exist
epm_cmd=assure epm_cmd=assure
;; ;;
policy) # HELPCMD: print detailed information about the priority selection of package policy|resolve) # HELPCMD: print detailed information about the priority selection of package
epm_cmd=policy epm_cmd=policy
;; ;;
...@@ -252,7 +252,10 @@ check_command() ...@@ -252,7 +252,10 @@ check_command()
removerepo|rr) # HELPCMD: remove package repo removerepo|rr) # HELPCMD: remove package repo
epm_cmd=removerepo epm_cmd=removerepo
;; ;;
release-upgrade|upgrade-release) # HELPCMD: update whole system to the release in arg (default: next (latest) release) full-upgrade) # HELPCMD: update all system packages and kernel
epm_cmd=full_upgrade
;;
release-upgrade|upgrade-release|upgrade-system) # HELPCMD: update whole system to the release in arg (default: next (latest) release)
epm_cmd=release_upgrade epm_cmd=release_upgrade
;; ;;
kernel-update|kernel-upgrade|update-kernel|upgrade-kernel) # HELPCMD: update system kernel to the last repo version kernel-update|kernel-upgrade|update-kernel|upgrade-kernel) # HELPCMD: update system kernel to the last repo version
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2013 Etersoft # Copyright (C) 2013, 2019 Etersoft
# Copyright (C) 2013 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2013, 2019 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -28,16 +28,9 @@ epm_Install() ...@@ -28,16 +28,9 @@ epm_Install()
[ -z "$files$names" ] && info "Install: Skip empty install list." && return 22 [ -z "$files$names" ] && info "Install: Skip empty install list." && return 22
# do update only if really need install something (pkg_filenames='' epm_update) || return
case $PMTYPE in
yum-rpm)
;;
*)
pkg_filenames='' epm_update || return
;;
esac
epm_install_names $names || return epm_install_names $names || return
epm_install_files $files
epm_install_files $files
} }
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2013 Etersoft # Copyright (C) 2013, 2019 Etersoft
# Copyright (C) 2013 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2013, 2019 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -22,13 +22,7 @@ load_helper epm-upgrade ...@@ -22,13 +22,7 @@ load_helper epm-upgrade
epm_Upgrade() epm_Upgrade()
{ {
case $PMTYPE in (pkg_filenames='' epm_update)
yum-rpm)
;;
*)
pkg_filenames='' epm_update || return
;;
esac
epm_upgrade epm_upgrade
} }
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012, 2017 Etersoft # Copyright (C) 2012, 2017, 2019 Etersoft
# Copyright (C) 2012, 2017 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2017, 2019 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -19,6 +19,27 @@ ...@@ -19,6 +19,27 @@
load_helper epm-sh-altlinux load_helper epm-sh-altlinux
ETERSOFTPUBURL=http://download.etersoft.ru/pub
ALTLINUXPUBURL=http://ftp.altlinux.org/pub/distributions
__epm_addrepo_rhel()
{
local repo="$@"
if [ -z "$repo" ] ; then
echo "Add repo."
echo "1. Use with repository URL, f.i. http://www.example.com/example.repo"
echo "2. Use with epel to add EPEL repository"
return 1
fi
case "$1" in
epel)
epm install epel-release
return 1
;;
esac
return 0
}
__epm_addrepo_altlinux() __epm_addrepo_altlinux()
{ {
local repo="$@" local repo="$@"
...@@ -38,11 +59,11 @@ __epm_addrepo_altlinux() ...@@ -38,11 +59,11 @@ __epm_addrepo_altlinux()
# TODO: use apt-repo add ? # TODO: use apt-repo add ?
echo "" | sudocmd tee -a /etc/apt/sources.list echo "" | sudocmd tee -a /etc/apt/sources.list
echo "# added with eepm addrepo etersoft" | sudocmd tee -a /etc/apt/sources.list echo "# added with eepm addrepo etersoft" | sudocmd tee -a /etc/apt/sources.list
echo "rpm [etersoft] http://download.etersoft.ru/pub/Etersoft LINUX@Etersoft/$branch/$arch addon" | sudocmd tee -a /etc/apt/sources.list echo "rpm [etersoft] $ETERSOFTPUBURL/Etersoft LINUX@Etersoft/$branch/$arch addon" | sudocmd tee -a /etc/apt/sources.list
if [ "$arch" = "x86_64" ] ; then if [ "$arch" = "x86_64" ] ; then
echo "rpm [etersoft] http://download.etersoft.ru/pub/Etersoft LINUX@Etersoft/$branch/$arch-i586 addon" | sudocmd tee -a /etc/apt/sources.list echo "rpm [etersoft] $ETERSOFTPUBURL/Etersoft LINUX@Etersoft/$branch/$arch-i586 addon" | sudocmd tee -a /etc/apt/sources.list
fi fi
echo "rpm [etersoft] http://download.etersoft.ru/pub/Etersoft LINUX@Etersoft/$branch/noarch addon" | sudocmd tee -a /etc/apt/sources.list echo "rpm [etersoft] $ETERSOFTPUBURL/Etersoft LINUX@Etersoft/$branch/noarch addon" | sudocmd tee -a /etc/apt/sources.list
repo="$DISTRVERSION" repo="$DISTRVERSION"
return 0 return 0
;; ;;
...@@ -51,6 +72,7 @@ __epm_addrepo_altlinux() ...@@ -51,6 +72,7 @@ __epm_addrepo_altlinux()
repo="$repo.$(echo "$DISTRVERSION" | tr "[:upper:]" "[:lower:]")" repo="$repo.$(echo "$DISTRVERSION" | tr "[:upper:]" "[:lower:]")"
;; ;;
archive) archive)
[ -n "$DISTRVERSION" ] || fatal "Empty DISTRVERSION"
datestr="$2" datestr="$2"
echo "$datestr" | grep -Eq "^20[0-2][0-9]/[01][0-9]/[0-3][0-9]$" || fatal "use follow date format: 2017/12/31" echo "$datestr" | grep -Eq "^20[0-2][0-9]/[01][0-9]/[0-3][0-9]$" || fatal "use follow date format: 2017/12/31"
# TODO: func? # TODO: func?
...@@ -60,11 +82,11 @@ __epm_addrepo_altlinux() ...@@ -60,11 +82,11 @@ __epm_addrepo_altlinux()
local distrversion="$(echo "$DISTRVERSION" | tr "[:upper:]" "[:lower:]")" local distrversion="$(echo "$DISTRVERSION" | tr "[:upper:]" "[:lower:]")"
local rpmsign='[alt]' local rpmsign='[alt]'
[ "$distrversion" != "sisyphus" ] && rpmsign="[$distrversion]" [ "$distrversion" != "sisyphus" ] && rpmsign="[$distrversion]"
echo "rpm $rpmsign http://ftp.altlinux.org/pub/distributions archive/$distrversion/date/$datestr/$arch classic" | sudocmd tee -a /etc/apt/sources.list echo "rpm $rpmsign $ALTLINUXPUBURL archive/$distrversion/date/$datestr/$arch classic" | sudocmd tee -a /etc/apt/sources.list
if [ "$arch" = "x86_64" ] ; then if [ "$arch" = "x86_64" ] ; then
echo "rpm $rpmsign http://ftp.altlinux.org/pub/distributions archive/$distrversion/date/$datestr/$arch-i586 classic" | sudocmd tee -a /etc/apt/sources.list echo "rpm $rpmsign $ALTLINUXPUBURL archive/$distrversion/date/$datestr/$arch-i586 classic" | sudocmd tee -a /etc/apt/sources.list
fi fi
echo "rpm $rpmsign http://ftp.altlinux.org/pub/distributions archive/$distrversion/date/$datestr/noarch classic" | sudocmd tee -a /etc/apt/sources.list echo "rpm $rpmsign $ALTLINUXPUBURL archive/$distrversion/date/$datestr/noarch classic" | sudocmd tee -a /etc/apt/sources.list
return 0 return 0
;; ;;
esac esac
...@@ -79,11 +101,13 @@ __epm_addrepo_altlinux() ...@@ -79,11 +101,13 @@ __epm_addrepo_altlinux()
if [ -z "$repo" ] ; then if [ -z "$repo" ] ; then
info "Add branch repo. Use follow params:" info "Add branch repo. Use follow params:"
sudocmd apt-repo add branch sudocmd apt-repo add branch
echo "etersoft (for LINUX@Etersoft repo)" echo "etersoft - for LINUX@Etersoft repo"
echo "archive 2018/02/09 (for archive from that date)" echo "archive 2018/02/09 - for archive from that date"
return return
fi fi
# TODO: add other mirror (mirror.yandex.ru)
# TODO: apt-repo supports archive
sudocmd apt-repo add "$repo" sudocmd apt-repo add "$repo"
} }
...@@ -113,8 +137,13 @@ case $PMTYPE in ...@@ -113,8 +137,13 @@ case $PMTYPE in
;; ;;
yum-rpm) yum-rpm)
assure_exists yum-utils assure_exists yum-utils
__epm_addrepo_rhel "$repo" || return
sudocmd yum-config-manager --add-repo "$repo" sudocmd yum-config-manager --add-repo "$repo"
;; ;;
dnf-rpm)
__epm_addrepo_rhel "$repo" || return
sudocmd dnf config-manager --add-repo "$repo"
;;
urpm-rpm) urpm-rpm)
sudocmd urpmi.addmedia "$repo" sudocmd urpmi.addmedia "$repo"
;; ;;
......
...@@ -197,6 +197,9 @@ case $PMTYPE in ...@@ -197,6 +197,9 @@ case $PMTYPE in
fi fi
sudocmd aura -Oj sudocmd aura -Oj
;; ;;
packagekit-*)
docmd pkcon repair --autoremove
;;
yum-rpm) yum-rpm)
# cleanup orphanes? # cleanup orphanes?
while true ; do while true ; do
......
...@@ -37,6 +37,9 @@ case $PMTYPE in ...@@ -37,6 +37,9 @@ case $PMTYPE in
sudocmd apt-get -f install || return sudocmd apt-get -f install || return
#sudocmd apt-get autoremove #sudocmd apt-get autoremove
;; ;;
packagekit-*)
docmd pkcon repair
;;
aptitude-dpkg) aptitude-dpkg)
sudocmd aptitude -f install || return sudocmd aptitude -f install || return
#sudocmd apt-get autoremove #sudocmd apt-get autoremove
......
...@@ -62,7 +62,7 @@ update_repo_if_needed() ...@@ -62,7 +62,7 @@ update_repo_if_needed()
if ! __is_repo_info_downloaded || ! __is_repo_info_uptodate ; then if ! __is_repo_info_downloaded || ! __is_repo_info_uptodate ; then
load_helper epm-update load_helper epm-update
# FIXME: cleans!!! # FIXME: cleans!!!
$(pkg_filenames='' epm_update) (pkg_filenames='' epm_update)
fi fi
cd - >/dev/null || fatal cd - >/dev/null || fatal
......
...@@ -49,9 +49,8 @@ try_fix_apt_rpm_dupls() ...@@ -49,9 +49,8 @@ try_fix_apt_rpm_dupls()
epm_dedup() epm_dedup()
{ {
case $PMTYPE in case "$DISTRNAME" in
apt-rpm) "ALTLinux")
# ALT Linux only
assure_exists /usr/share/apt/scripts apt-scripts assure_exists /usr/share/apt/scripts apt-scripts
if [ -f /usr/share/apt/scripts/dedup.lua ] ; then if [ -f /usr/share/apt/scripts/dedup.lua ] ; then
"Check for duplicates via apt-get dedup from apt-scripts" "Check for duplicates via apt-get dedup from apt-scripts"
......
...@@ -184,8 +184,8 @@ epm_download() ...@@ -184,8 +184,8 @@ epm_download()
{ {
local CMD local CMD
case $DISTRNAME in case $DISTRNAME-$PMTYPE in
ALTLinux) ALTLinux-apt-rpm)
__epm_download_alt $pkg_filenames __epm_download_alt $pkg_filenames
return return
;; ;;
...@@ -198,6 +198,10 @@ epm_download() ...@@ -198,6 +198,10 @@ epm_download()
aptcyg) aptcyg)
sudocmd apt-cyg download $pkg_filenames sudocmd apt-cyg download $pkg_filenames
;; ;;
packagekit-*)
# TODO: force
docmd pkcon download $pkg_filenames
;;
yum-rpm) yum-rpm)
# TODO: check yum install --downloadonly --downloaddir=/tmp <package-name> # TODO: check yum install --downloadonly --downloaddir=/tmp <package-name>
assure_exists yumdownloader yum-utils assure_exists yumdownloader yum-utils
......
...@@ -67,6 +67,9 @@ __epm_filelist_remote() ...@@ -67,6 +67,9 @@ __epm_filelist_remote()
fi fi
docmd_foreach __deb_local_content_filelist "$@" docmd_foreach __deb_local_content_filelist "$@"
;; ;;
packagekit-*)
docmd pkcon get-files "$@"
;;
yum-rpm) yum-rpm)
assure_exists yum-utils || return assure_exists yum-utils || return
docmd repoquery -q -l "$@" docmd repoquery -q -l "$@"
...@@ -120,6 +123,9 @@ __epm_filelist_name() ...@@ -120,6 +123,9 @@ __epm_filelist_name()
*-dpkg) *-dpkg)
CMD="dpkg -L" CMD="dpkg -L"
;; ;;
packagekit-*)
CMD="pkcon get-files"
;;
android) android)
CMD="pm list packages -f" CMD="pm list packages -f"
;; ;;
......
#!/bin/sh
#
# Copyright (C) 2019 Etersoft
# Copyright (C) 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
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
load_helper epm-update
load_helper epm-upgrade
load_helper epm-kernel_update
epm_full_upgrade()
{
(pkg_filenames='' epm_update) || return
epm_upgrade || return
epm_kernel_update || return
}
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012, 2014, 2016 Etersoft # Copyright (C) 2012, 2014, 2016, 2019 Etersoft
# Copyright (C) 2012, 2014, 2016 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2014, 2016, 2019 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -48,10 +48,6 @@ __epm_info_by_pkgtype() ...@@ -48,10 +48,6 @@ __epm_info_by_pkgtype()
__epm_info_by_pmtype() __epm_info_by_pmtype()
{ {
case $PMTYPE in case $PMTYPE in
apt-rpm)
__epm_info_rpm_low && return
docmd apt-cache show $pkg_names
;;
apt-dpkg) apt-dpkg)
if [ -n "$pkg_files" ] ; then if [ -n "$pkg_files" ] ; then
docmd dpkg -I $pkg_files docmd dpkg -I $pkg_files
...@@ -67,21 +63,35 @@ case $PMTYPE in ...@@ -67,21 +63,35 @@ case $PMTYPE in
[ -z "$pkg_names" ] && return [ -z "$pkg_names" ] && return
docmd aptitude show $pkg_names docmd aptitude show $pkg_names
;; ;;
yum-rpm) *-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)
__epm_info_rpm_low && return __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) pacman)
is_installed $pkg_names && docmd pacman -Qi $pkg_names && return is_installed $pkg_names && docmd pacman -Qi $pkg_names && return
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012-2018 Etersoft # Copyright (C) 2012-2019 Etersoft
# Copyright (C) 2012-2018 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012-2019 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -129,6 +129,9 @@ epm_install_names() ...@@ -129,6 +129,9 @@ epm_install_names()
urpm-rpm) urpm-rpm)
sudocmd urpmi $URPMOPTIONS $@ sudocmd urpmi $URPMOPTIONS $@
return ;; return ;;
packagekit-*)
docmd pkcon install $@
return ;;
pkgsrc) pkgsrc)
sudocmd pkg_add -r $@ sudocmd pkg_add -r $@
return ;; return ;;
...@@ -230,6 +233,9 @@ epm_ni_install_names() ...@@ -230,6 +233,9 @@ epm_ni_install_names()
# FIXME: returns true ever no package found, need check for "no found", "Nothing to do." # FIXME: returns true ever no package found, need check for "no found", "Nothing to do."
yes | sudocmd zypper --non-interactive $ZYPPEROPTIONS install $@ yes | sudocmd zypper --non-interactive $ZYPPEROPTIONS install $@
return ;; return ;;
packagekit-*)
docmd pkcon install --noninteractive $@
return ;;
pkgsrc) pkgsrc)
sudocmd pkg_add -r $@ sudocmd pkg_add -r $@
return ;; return ;;
...@@ -315,9 +321,9 @@ epm_install_files() ...@@ -315,9 +321,9 @@ epm_install_files()
# TODO: check read permissions # TODO: check read permissions
# sudo test -r FILE # sudo test -r FILE
# do not fallback to install_names if we have no permissions # 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 # TODO: replace with name changed function
__epm_check_if_try_install_deb $@ && return __epm_check_if_try_install_deb $@ && return
...@@ -334,7 +340,9 @@ epm_install_files() ...@@ -334,7 +340,9 @@ epm_install_files()
# use install_names # use install_names
;; ;;
esac
case $PMTYPE in
apt-dpkg|aptitude-dpkg) apt-dpkg|aptitude-dpkg)
# the new version of the conf. file is installed with a .dpkg-dist suffix # the new version of the conf. file is installed with a .dpkg-dist suffix
if [ -n "$non_interactive" ] ; then if [ -n "$non_interactive" ] ; then
...@@ -358,20 +366,7 @@ epm_install_files() ...@@ -358,20 +366,7 @@ epm_install_files()
return return
;; ;;
yum-rpm|dnf-rpm) *-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 __epm_check_if_try_install_deb $@ && return
sudocmd rpm -Uvh $force $nodeps $@ && return sudocmd rpm -Uvh $force $nodeps $@ && return
local RES=$? local RES=$?
...@@ -379,25 +374,29 @@ epm_install_files() ...@@ -379,25 +374,29 @@ epm_install_files()
__epm_check_if_rpm_already_installed $@ && return __epm_check_if_rpm_already_installed $@ && return
# if run with --nodeps, do not fallback on hi level # if run with --nodeps, do not fallback on hi level
[ -n "$nodeps" ] && return $RES [ -n "$nodeps" ] && return $RES
ZYPPEROPTIONS=$(__use_zypper_no_gpg_checks)
# use install_names
;;
urpm-rpm) case $PMTYPE in
__epm_check_if_try_install_deb $@ && return yum-rpm|dnf-rpm)
sudocmd rpm -Uvh $force $nodeps $@ && return YUMOPTIONS=--nogpgcheck
local RES=$? # use install_names
;;
__epm_check_if_rpm_already_installed $@ && return zypper-rpm)
ZYPPEROPTIONS=$(__use_zypper_no_gpg_checks)
# if run with --nodeps, do not fallback on hi level # use install_names
[ -n "$nodeps" ] && return $RES ;;
urpm-rpm)
URPMOPTIONS=--no-verify-rpm URPMOPTIONS=--no-verify-rpm
# use install_names # use install_names
;;
*)
# use install_names
;;
esac
;; ;;
packagekit-*)
docmd pkcon install-local $@
return ;;
pkgsrc) pkgsrc)
sudocmd pkg_add $@ sudocmd pkg_add $@
return ;; return ;;
...@@ -443,10 +442,10 @@ epm_print_install_command() ...@@ -443,10 +442,10 @@ epm_print_install_command()
#[ -z "$1" ] && return #[ -z "$1" ] && return
[ -z "$1" ] && [ -n "$pkg_names" ] && return [ -z "$1" ] && [ -n "$pkg_names" ] && return
case $PMTYPE in case $PMTYPE in
apt-rpm|yum-rpm|urpm-rpm|zypper-rpm|dnf-rpm) *-rpm)
echo "rpm -Uvh --force $nodeps $*" echo "rpm -Uvh --force $nodeps $*"
;; ;;
apt-dpkg|aptitude-dpkg) *-dpkg)
echo "dpkg -i $*" echo "dpkg -i $*"
;; ;;
pkgsrc) pkgsrc)
...@@ -518,6 +517,9 @@ epm_print_install_names_command() ...@@ -518,6 +517,9 @@ epm_print_install_names_command()
zypper-rpm) zypper-rpm)
echo "zypper --non-interactive $ZYPPEROPTIONS install $*" echo "zypper --non-interactive $ZYPPEROPTIONS install $*"
return ;; return ;;
packagekit-*)
echo "pkcon --noninteractive $*"
return ;;
pacman) pacman)
echo "pacman -S --noconfirm $force $*" echo "pacman -S --noconfirm $force $*"
return ;; return ;;
...@@ -539,7 +541,10 @@ epm_install() ...@@ -539,7 +541,10 @@ epm_install()
if tasknumber "$pkg_names" >/dev/null ; then if tasknumber "$pkg_names" >/dev/null ; then
assure_distr ALTLinux "install with task number" assure_distr ALTLinux "install with task number"
assure_exists apt-repo assure_exists apt-repo
sudocmd apt-repo test $(tasknumber "$pkg_names") local task
for task in $(tasknumber "$pkg_names") ; do
sudocmd apt-repo test $task
done
return return
fi fi
......
...@@ -35,8 +35,8 @@ epm_kernel_update() ...@@ -35,8 +35,8 @@ epm_kernel_update()
fi fi
assure_exists update-kernel update-kernel 0.9.9 assure_exists update-kernel update-kernel 0.9.9
update_repo_if_needed update_repo_if_needed
sudocmd update-kernel $pkg_filenames || return sudocmd update-kernel $(subst_option non_interactive -y) $pkg_filenames || return
docmd epm remove-old-kernels $pkg_filenames || fatal docmd epm remove-old-kernels $(subst_option non_interactive -y) $pkg_filenames || fatal
return ;; return ;;
esac esac
......
...@@ -23,12 +23,12 @@ __epm_packages_sort() ...@@ -23,12 +23,12 @@ __epm_packages_sort()
{ {
# FIXME: sort depends on --sort value # FIXME: sort depends on --sort value
case $PMTYPE in case $PMTYPE in
apt-rpm|yum-rpm|urpm-rpm|zypper-rpm|dnf-rpm) *-rpm)
# FIXME: space with quotes problems, use point instead # FIXME: space with quotes problems, use point instead
warmup_rpmbase warmup_rpmbase
docmd rpm -qa --queryformat "%{size}@%{name}-%{version}-%{release}\n" $pkg_filenames | sed -e "s|@| |g" | sort -n -k1 docmd rpm -qa --queryformat "%{size}@%{name}-%{version}-%{release}\n" $pkg_filenames | sed -e "s|@| |g" | sort -n -k1
;; ;;
apt-dpkg) *-dpkg)
warmup_dpkgbase warmup_dpkgbase
docmd dpkg-query -W --showformat="\${Installed-Size}@\${Package}-\${Version}:\${Architecture}\n" $pkg_filenames | sed -e "s|@| |g" | sort -n -k1 docmd dpkg-query -W --showformat="\${Installed-Size}@\${Package}-\${Version}:\${Architecture}\n" $pkg_filenames | sed -e "s|@| |g" | sort -n -k1
;; ;;
...@@ -57,13 +57,6 @@ epm_packages() ...@@ -57,13 +57,6 @@ epm_packages()
[ -n "$sort" ] && __epm_packages_sort && return [ -n "$sort" ] && __epm_packages_sort && return
case $PMTYPE in case $PMTYPE in
apt-rpm)
warmup_rpmbase
# FIXME: strong equal
CMD="rpm -qa $pkg_filenames"
[ -n "$short" ] && CMD="rpm -qa --queryformat %{name}\n $pkg_filenames"
docmd $CMD
return ;;
*-dpkg) *-dpkg)
warmup_dpkgbase warmup_dpkgbase
# FIXME: strong equal # FIXME: strong equal
...@@ -74,16 +67,19 @@ case $PMTYPE in ...@@ -74,16 +67,19 @@ case $PMTYPE in
showcmd $CMD showcmd $CMD
$CMD | grep "^i" | sed -e "s|.* ||g" | __fo_pfn $CMD | grep "^i" | sed -e "s|.* ||g" | __fo_pfn
return ;; return ;;
snappy) *-rpm)
CMD="snappy info"
;;
yum-rpm|urpm-rpm|zypper-rpm|dnf-rpm)
warmup_rpmbase warmup_rpmbase
# FIXME: strong equal # FIXME: strong equal
CMD="rpm -qa $pkg_filenames" CMD="rpm -qa $pkg_filenames"
[ -n "$short" ] && CMD="rpm -qa --queryformat %{name}\n $pkg_filenames" [ -n "$short" ] && CMD="rpm -qa --queryformat %{name}\n $pkg_filenames"
docmd $CMD docmd $CMD
return ;; return ;;
packagekit-*)
docmd pkcon get-packages --filter installed
;;
snappy)
CMD="snappy info"
;;
emerge) emerge)
CMD="qlist -I -C" CMD="qlist -I -C"
# print with colors for console output # print with colors for console output
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2015, 2017 Etersoft # Copyright (C) 2015, 2017, 2019 Etersoft
# Copyright (C) 2015, 2017 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2015, 2017, 2019 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -31,11 +31,11 @@ warmup_bases ...@@ -31,11 +31,11 @@ warmup_bases
pkg_names=$(__epm_get_hilevel_name $pkg_names) pkg_names=$(__epm_get_hilevel_name $pkg_names)
case $PMTYPE in case $PMTYPE in
apt-rpm) apt-*)
docmd apt-cache policy $pkg_names docmd apt-cache policy $pkg_names
;; ;;
apt-dpkg) packagekit-*)
docmd apt-cache policy $pkg_names docmd pkcon resolve $pkg_names
;; ;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
......
...@@ -88,12 +88,12 @@ _shortquery_via_packages_list() ...@@ -88,12 +88,12 @@ _shortquery_via_packages_list()
# Note: double call due stderr redirect # Note: double call due stderr redirect
# Note: we use short=1 here due grep by ^name$ # Note: we use short=1 here due grep by ^name$
# separate first line for print out command # separate first line for print out command
short=1 pkg_filenames=$firstpkg epm_packages | grep -- "$grepexp" && res=0 || res=1 (short=1 pkg_filenames=$firstpkg epm_packages | grep -- "$grepexp") && res=0 || res=1
local pkg local pkg
for pkg in "$@" ; do for pkg in "$@" ; do
grepexp=$(_get_grep_exp $pkg) grepexp=$(_get_grep_exp $pkg)
short=1 pkg_filenames=$pkg epm_packages 2>/dev/null | grep -- "$grepexp" || res=1 (short=1 pkg_filenames=$pkg epm_packages 2>/dev/null) | grep -- "$grepexp" || res=1
done done
# TODO: print in query (for user): 'warning: package $pkg is not installed' # TODO: print in query (for user): 'warning: package $pkg is not installed'
...@@ -116,12 +116,12 @@ _query_via_packages_list() ...@@ -116,12 +116,12 @@ _query_via_packages_list()
# Note: double call due stderr redirect # Note: double call due stderr redirect
# Note: we use short=1 here due grep by ^name$ # Note: we use short=1 here due grep by ^name$
# separate first line for print out command # separate first line for print out command
short=1 pkg_filenames=$firstpkg epm_packages | grep -q -- "$grepexp" && quiet=1 pkg_filenames=$firstpkg epm_packages && res=0 || res=1 (short=1 pkg_filenames=$firstpkg epm_packages) | grep -q -- "$grepexp" && (quiet=1 pkg_filenames=$firstpkg epm_packages) && res=0 || res=1
local pkg local pkg
for pkg in "$@" ; do for pkg in "$@" ; do
grepexp=$(_get_grep_exp $pkg) grepexp=$(_get_grep_exp $pkg)
short=1 pkg_filenames=$pkg epm_packages 2>/dev/null | grep -q -- "$grepexp" && quiet=1 pkg_filenames=$pkg epm_packages || res=1 (short=1 pkg_filenames=$pkg epm_packages 2>/dev/null) | grep -q -- "$grepexp" && (quiet=1 pkg_filenames=$pkg epm_packages) || res=1
done done
return $res return $res
......
...@@ -78,17 +78,11 @@ __do_query() ...@@ -78,17 +78,11 @@ __do_query()
{ {
local CMD local CMD
case $PMTYPE in case $PMTYPE in
apt-rpm)
CMD="rpm -qf"
;;
*-dpkg) *-dpkg)
showcmd dpkg -S "$1" showcmd dpkg -S "$1"
dpkg_print_name_version "$(dpkg -S $1 | grep -v "^diversion by" | sed -e "s|:.*||")" dpkg_print_name_version "$(dpkg -S $1 | grep -v "^diversion by" | sed -e "s|:.*||")"
return ;; return ;;
yum-rpm|dnf-rpm|urpm-rpm) *-rpm)
CMD="rpm -qf"
;;
zypper-rpm)
CMD="rpm -qf" CMD="rpm -qf"
;; ;;
emerge) emerge)
......
...@@ -33,6 +33,10 @@ epm_reinstall_names() ...@@ -33,6 +33,10 @@ epm_reinstall_names()
aptitude-dpkg) aptitude-dpkg)
sudocmd aptitude reinstall $@ sudocmd aptitude reinstall $@
return ;; return ;;
packagekit-*)
warning "Please send me the correct command form for it"
docmd pkcon install --allow-reinstall $@
return ;;
yum-rpm) yum-rpm)
sudocmd yum reinstall $@ sudocmd yum reinstall $@
return ;; return ;;
......
...@@ -85,7 +85,7 @@ __alt_repofix() ...@@ -85,7 +85,7 @@ __alt_repofix()
local TO="$1" local TO="$1"
load_helper epm-repofix load_helper epm-repofix
showcmd epm repofix showcmd epm repofix
quiet=1 pkg_filenames='' epm_repofix >/dev/null (quiet=1 pkg_filenames='' epm_repofix >/dev/null)
# replace sign name # replace sign name
if [ -n "$TO" ] ; then if [ -n "$TO" ] ; then
__replace_text_in_alt_repo "/^ *#/! s!\[alt\]![$TO]!g" __replace_text_in_alt_repo "/^ *#/! s!\[alt\]![$TO]!g"
...@@ -97,7 +97,7 @@ __alt_repofix() ...@@ -97,7 +97,7 @@ __alt_repofix()
__get_conflict_release_pkg() __get_conflict_release_pkg()
{ {
epmqf --quiet --short /etc/fedora-release | head -n1 epm qf --quiet --short /etc/fedora-release | head -n1
} }
get_fix_release_pkg() get_fix_release_pkg()
...@@ -132,6 +132,9 @@ get_fix_release_pkg() ...@@ -132,6 +132,9 @@ get_fix_release_pkg()
# workaround against obsoleted altlinux-release-sisyphus package from 2008 year # workaround against obsoleted altlinux-release-sisyphus package from 2008 year
[ "$TOINSTALL" = "altlinux-release-sisyphus" ] && TOINSTALL="branding-alt-sisyphus-release" [ "$TOINSTALL" = "altlinux-release-sisyphus" ] && TOINSTALL="branding-alt-sisyphus-release"
# update if installed (just print package name here to include in the install list)
epm --quiet --short -q etersoft-gpgkeys 2>/dev/null
if [ -n "$TOINSTALL" ] ; then if [ -n "$TOINSTALL" ] ; then
echo "$TOINSTALL" echo "$TOINSTALL"
...@@ -323,6 +326,9 @@ epm_release_upgrade() ...@@ -323,6 +326,9 @@ epm_release_upgrade()
assure_exists do-release-upgrade update-manager-core assure_exists do-release-upgrade update-manager-core
sudocmd do-release-upgrade sudocmd do-release-upgrade
;; ;;
packagekit-*)
docmd pkcon upgrade-system $pkg_filenames
;;
yum-rpm) yum-rpm)
docmd epm install rpm yum docmd epm install rpm yum
sudocmd yum clean all sudocmd yum clean all
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012-2014, 2016, 2017 Etersoft # Copyright (C) 2012-2014, 2016, 2017, 2019 Etersoft
# Copyright (C) 2012-2014, 2016, 2017 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012-2014, 2016, 2017, 2019 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -30,10 +30,10 @@ epm_remove_low() ...@@ -30,10 +30,10 @@ epm_remove_low()
warmup_lowbase warmup_lowbase
case $PMTYPE in case $PMTYPE in
apt-rpm|yum-rpm|zypper-rpm|urpm-rpm|dnf-rpm) *-rpm)
sudocmd rpm -ev $nodeps $@ sudocmd rpm -ev $nodeps $@
return ;; return ;;
apt-dpkg|aptitude-dpkg) *-dpkg|-dpkg)
# shellcheck disable=SC2046 # shellcheck disable=SC2046
sudocmd dpkg -P $(subst_option nodeps --force-all) $(print_name "$@") sudocmd dpkg -P $(subst_option nodeps --force-all) $(print_name "$@")
return ;; return ;;
...@@ -72,6 +72,9 @@ epm_remove_names() ...@@ -72,6 +72,9 @@ epm_remove_names()
apt-rpm) apt-rpm)
sudocmd apt-get remove $APTOPTIONS $@ sudocmd apt-get remove $APTOPTIONS $@
return ;; return ;;
packagekit-*)
docmd pkcon remove $@
return ;;
deepsolver-rpm) deepsolver-rpm)
sudocmd ds-remove $@ sudocmd ds-remove $@
return ;; return ;;
...@@ -164,6 +167,9 @@ epm_remove_nonint() ...@@ -164,6 +167,9 @@ epm_remove_nonint()
apt-rpm) apt-rpm)
sudocmd apt-get -y --force-yes remove $@ sudocmd apt-get -y --force-yes remove $@
return ;; return ;;
packagekit-*)
docmd pkcon remove --noninteractive $@
return ;;
urpm-rpm) urpm-rpm)
sudocmd urpme --auto $@ sudocmd urpme --auto $@
return ;; return ;;
...@@ -198,12 +204,15 @@ epm_remove_nonint() ...@@ -198,12 +204,15 @@ epm_remove_nonint()
epm_print_remove_command() epm_print_remove_command()
{ {
case $PMTYPE in case $PMTYPE in
apt-rpm|yum-rpm|zypper-rpm|urpm-rpm|dnf-rpm) *-rpm)
echo "rpm -ev $nodeps $*" echo "rpm -ev $nodeps $*"
;; ;;
apt-dpkg|aptitude-dpkg) *-dpkg)
echo "dpkg -P $*" echo "dpkg -P $*"
;; ;;
packagekit-*)
echo "pkcon remove --noninteractive $*"
;;
pkgsrc) pkgsrc)
echo "pkg_delete -r $*" echo "pkg_delete -r $*"
;; ;;
......
...@@ -32,7 +32,7 @@ epm_remove_old_kernels() ...@@ -32,7 +32,7 @@ epm_remove_old_kernels()
return return
fi fi
assure_exists update-kernel update-kernel 0.9.9 assure_exists update-kernel update-kernel 0.9.9
sudocmd remove-old-kernels $pkg_filenames sudocmd remove-old-kernels $(subst_option non_interactive -y) $pkg_filenames
return ;; return ;;
Ubuntu) Ubuntu)
load_helper epm-query_package load_helper epm-query_package
......
...@@ -55,7 +55,7 @@ case $DISTRNAME in ...@@ -55,7 +55,7 @@ case $DISTRNAME in
;; ;;
esac esac
[ -n "$repo" ] || fatal "No such repo or task. Use epm remove repo [autoimports|archive|TASK]" [ -n "$repo" ] || fatal "No such repo or task. Use epm remove repo [autoimports|archive|tasks/TASKNUMBER]"
assure_exists apt-repo assure_exists apt-repo
sudocmd apt-repo rm "$repo" sudocmd apt-repo rm "$repo"
return return
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012, 2016 Etersoft # Copyright (C) 2012, 2016, 2019 Etersoft
# Copyright (C) 2012, 2016 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2016, 2019 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -54,6 +54,9 @@ case $PMTYPE in ...@@ -54,6 +54,9 @@ case $PMTYPE in
zypper-rpm) zypper-rpm)
docmd zypper sl -d docmd zypper sl -d
;; ;;
packagekit-*)
docmd pkcon repo-list
;;
emerge) emerge)
docmd eselect profile list docmd eselect profile list
docmd layman -L docmd layman -L
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012-2013, 2016, 2018 Etersoft # Copyright (C) 2012-2013, 2016, 2018, 2019 Etersoft
# Copyright (C) 2012-2013, 2016, 2018 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012-2013, 2016, 2018, 2019 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -61,7 +61,9 @@ case $PMTYPE in ...@@ -61,7 +61,9 @@ case $PMTYPE in
#return #return
CMD="apt-cache depends" CMD="apt-cache depends"
fi fi
;;
packagekit-*)
CMD="pkcon required-by"
;; ;;
#zypper-rpm) #zypper-rpm)
# # FIXME: use hi level commands # # FIXME: use hi level commands
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012, 2013, 2016-2018 Etersoft # Copyright (C) 2012, 2013, 2016-2019 Etersoft
# Copyright (C) 2012, 2013, 2016-2018 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2013, 2016-2019 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -34,6 +34,9 @@ case $PMTYPE in ...@@ -34,6 +34,9 @@ case $PMTYPE in
deepsolver-rpm) deepsolver-rpm)
CMD="ds-require --" CMD="ds-require --"
;; ;;
packagekit-*)
CMD="pkcon search name"
;;
urpm-rpm) urpm-rpm)
# urpmq does not support -- # urpmq does not support --
CMD="urpmq -y" CMD="urpmq -y"
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012, 2016, 2017 Etersoft # Copyright (C) 2012, 2016, 2017, 2019 Etersoft
# Copyright (C) 2012, 2016, 2017 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2016, 2017, 2019 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -61,6 +61,9 @@ case $PMTYPE in ...@@ -61,6 +61,9 @@ case $PMTYPE in
sudocmd apt-file update sudocmd apt-file update
docmd apt-file search $pkg_filenames docmd apt-file search $pkg_filenames
return ;; return ;;
packagekit-*)
CMD="pkcon search file"
;;
yum-rpm) yum-rpm)
# TODO # TODO
info "Search by full packages list is not implemented yet" info "Search by full packages list is not implemented yet"
......
...@@ -118,7 +118,7 @@ get_local_alt_contents_index() ...@@ -118,7 +118,7 @@ get_local_alt_contents_index()
tasknumber() tasknumber()
{ {
local num="$(echo "$*" | sed -e "s| *#*||g")" local num="$(echo "$1" | sed -e "s| *#*||g")"
isnumber "$num" && echo "$num" isnumber "$num" && echo "$*"
} }
...@@ -475,12 +475,16 @@ if [ -n "$FORCEPM" ] ; then ...@@ -475,12 +475,16 @@ if [ -n "$FORCEPM" ] ; then
return return
fi 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? # TODO: move it in distr_vendor?
# FIXME: some problems with multibased distros (Server Edition on CentOS and Desktop Edition on Ubuntu) # FIXME: some problems with multibased distros (Server Edition on CentOS and Desktop Edition on Ubuntu)
case $DISTRNAME in case $DISTRNAME in
ALTLinux) ALTLinux)
CMD="apt-rpm" CMD="apt-rpm"
#which ds-install 2>/dev/null >/dev/null && CMD=deepsolver-rpm #which ds-install 2>/dev/null >/dev/null && CMD=deepsolver-rpm
#which pkcon 2>/dev/null >/dev/null && CMD=packagekit-rpm
;; ;;
PCLinux) PCLinux)
CMD="apt-rpm" CMD="apt-rpm"
...@@ -550,18 +554,16 @@ esac ...@@ -550,18 +554,16 @@ esac
PMTYPE=$CMD PMTYPE=$CMD
} }
# https://unix.stackexchange.com/questions/196166/how-to-find-out-if-a-system-uses-sysv-upstart-or-systemd-initsystem
is_active_systemd() is_active_systemd()
{ {
local a local a
SYSTEMCTL=/bin/systemctl SYSTEMCTL=/bin/systemctl
SYSTEMD_CGROUP_DIR=/sys/fs/cgroup/systemd #[ -x "$SYSTEMCTL" ] || return
[ -x "$SYSTEMCTL" ] || return [ -d /run/systemd/system ] || return
[ -d "$SYSTEMD_CGROUP_DIR" ] || return #SYSTEMD_CGROUP_DIR=/sys/fs/cgroup/systemd
#a='' mountpoint -q "$SYSTEMD_CGROUP_DIR" || return #[ -d "$SYSTEMD_CGROUP_DIR" ] || return
cat /proc/1/cmdline | grep -q 'systemd' && return #cat /proc/1/comm | grep -q 'systemd' && return
cat /proc/1/cmdline | grep -q '/sbin/init' || return
readlink /sbin/init | grep -q 'systemd' || return
} }
assure_distr() assure_distr()
......
...@@ -127,7 +127,7 @@ EOF ...@@ -127,7 +127,7 @@ EOF
# use verbose for get package status # use verbose for get package status
#pkg_filenames="$pkg-[0-9]" verbose=--verbose __epm_search_internal | egrep "(installed|upgrade)" && continue #pkg_filenames="$pkg-[0-9]" verbose=--verbose __epm_search_internal | egrep "(installed|upgrade)" && continue
#pkg_filenames="$pkg" verbose=--verbose __epm_search_internal | egrep "(installed|upgrade)" && continue #pkg_filenames="$pkg" verbose=--verbose __epm_search_internal | egrep "(installed|upgrade)" && continue
pkg_filenames="$pkg" __epm_search_internal | grep -q "^$pkg-[0-9]" && continue (pkg_filenames="$pkg" __epm_search_internal) | grep -q "^$pkg-[0-9]" && continue
res=1 res=1
info "Package '$pkg' does not found in repository." info "Package '$pkg' does not found in repository."
done done
......
...@@ -38,6 +38,9 @@ case $PMTYPE in ...@@ -38,6 +38,9 @@ case $PMTYPE in
#sudocmd apt-get -f install || exit #sudocmd apt-get -f install || exit
#sudocmd apt-get autoremove #sudocmd apt-get autoremove
;; ;;
packagekit-*)
docmd pkcon refresh
;;
#snappy) #snappy)
# sudocmd snappy # sudocmd snappy
# ;; # ;;
...@@ -45,14 +48,12 @@ case $PMTYPE in ...@@ -45,14 +48,12 @@ case $PMTYPE in
sudocmd aptitude update || return sudocmd aptitude update || return
;; ;;
yum-rpm) yum-rpm)
info "update command is stubbed for yum" # just skipped
# yum makecache [ -n "$verbose" ] && info "update command is stubbed for yum"
#sudocmd yum check-update
;; ;;
dnf-rpm) dnf-rpm)
info "update command is stubbed for dnf" # just skipped
# dnf makecache [ -n "$verbose" ] && info "update command is stubbed for dnf"
#sudocmd dnf check-update
;; ;;
urpm-rpm) urpm-rpm)
sudocmd urpmi.update -a sudocmd urpmi.update -a
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012, 2014, 2016 Etersoft # Copyright (C) 2012, 2014, 2016, 2019 Etersoft
# Copyright (C) 2012, 2014, 2016 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2014, 2016, 2019 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -41,6 +41,10 @@ epm_upgrade() ...@@ -41,6 +41,10 @@ epm_upgrade()
aptitude-dpkg) aptitude-dpkg)
CMD="aptitude dist-upgrade" CMD="aptitude dist-upgrade"
;; ;;
packagekit-*)
docmd pkcon update
return
;;
yum-rpm) yum-rpm)
local OPTIONS="$(subst_option non_interactive -y)" local OPTIONS="$(subst_option non_interactive -y)"
# can do update repobase automagically # can do update repobase automagically
......
...@@ -44,6 +44,9 @@ case $PMTYPE in ...@@ -44,6 +44,9 @@ case $PMTYPE in
aptitude-dpkg) aptitude-dpkg)
CMD="aptitude why" CMD="aptitude why"
;; ;;
packagekit-*)
CMD="pkcon depends-on"
;;
yum-rpm) yum-rpm)
CMD="repoquery --whatrequires" CMD="repoquery --whatrequires"
;; ;;
......
...@@ -127,11 +127,20 @@ $(get_help HELPOPT) ...@@ -127,11 +127,20 @@ $(get_help HELPOPT)
" "
} }
detect_virt()
{
which systemd-detect-virt >/dev/null 2>/dev/null || return
a= systemd-detect-virt
}
print_version() print_version()
{ {
local on_text="(host system)"
local virt="$(detect_virt)"
[ "$virt" = "none" ] || [ "$virt" = "" ] || on_text="(under $virt)"
echo "Service manager version @VERSION@" echo "Service manager version @VERSION@"
echo "Running on $($DISTRVENDOR) with $SERVICETYPE" echo "Running on $($DISTRVENDOR) $on_text with $SERVICETYPE"
echo "Copyright (c) Etersoft 2012-2018" echo "Copyright (c) Etersoft 2012-2019"
echo "This program may be freely redistributed under the terms of the GNU AGPLv3." echo "This program may be freely redistributed under the terms of the GNU AGPLv3."
} }
......
# This spec is backported to ALTLinux p8 automatically by rpmbph script from etersoft-build-utils. # This spec is backported to ALTLinux p8 automatically by rpmbph script from etersoft-build-utils.
# #
Name: eepm Name: eepm
Version: 2.6.0 Version: 3.1.0
Release: alt0.M80P.1 Release: alt0.M80P.1
Summary: Etersoft EPM package manager Summary: Etersoft EPM package manager
...@@ -90,9 +90,27 @@ rm -f %buildroot%_datadir/%name/tools_eget ...@@ -90,9 +90,27 @@ rm -f %buildroot%_datadir/%name/tools_eget
%_sysconfdir/bash_completion.d/cerv %_sysconfdir/bash_completion.d/cerv
%changelog %changelog
* Tue Oct 01 2019 Vitaly Lipatov <lav@altlinux.ru> 2.6.0-alt0.M80P.1 * Fri Nov 08 2019 Vitaly Lipatov <lav@altlinux.ru> 3.1.0-alt0.M80P.1
- backport to ALTLinux p8 (by rpmbph script) - backport to ALTLinux p8 (by rpmbph script)
* Fri Nov 08 2019 Vitaly Lipatov <lav@altlinux.ru> 3.1.0-alt1
- add epm full-upgrade
- kernel update/remove: add --auto support (non interactive)
- is_active_systemd: rewrite systemd detection
- serv: add print out virtualization type (via systemd helper)
* Tue Nov 05 2019 Vitaly Lipatov <lav@altlinux.ru> 3.0.0-alt1
- distr_info: p9 support
- addrepo: add check for empty DISTRVERSION
- epm install: add support for several task numbers
- fix tasknumber checking
- addrepo: add support for dnf, add support for epel repo add
- release_upgrade: install etersoft-gpgkeys firstly if used one
- epm: add alias for policy (resolve) and release-upgrade (upgrade-system)
- add initial packagekit (pkcon) support
- more clean and strict rules
- workaround against ALT bug 37272
* Sat Sep 28 2019 Vitaly Lipatov <lav@altlinux.ru> 2.6.0-alt1 * Sat Sep 28 2019 Vitaly Lipatov <lav@altlinux.ru> 2.6.0-alt1
- add repack.d/XenDesktopVDA.sh (ALT bug 37167) - add repack.d/XenDesktopVDA.sh (ALT bug 37167)
- fix systemd detection - fix systemd detection
......
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