Commit d35fa63b authored by Vitaly Lipatov's avatar Vitaly Lipatov

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

parents 9d4f5b26 b6cc559b
При удалении, если ошибка состоит в отсутствии пакета, не нужно переключаться на apt-get При удалении, если ошибка состоит в отсутствии пакета, не нужно переключаться на apt-get
Если удаляется несколько пакетов, и один из них отсутствует, не удалится ничего.
Параметр типа --skip-installed, но наоборот? (--skip-missed?) epme вызывает apt-get remove для пакетов, которых нет при удалении через rpm
apt-mark (для работы autoremove and autoorphans) - помечать то, что удалять не следует apt-mark (для работы autoremove and autoorphans) - помечать то, что удалять не следует
......
...@@ -98,6 +98,7 @@ direct= ...@@ -98,6 +98,7 @@ direct=
sort= sort=
non_interactive= non_interactive=
skip_installed= skip_installed=
skip_missed=
show_command_only= show_command_only=
epm_cmd= epm_cmd=
pkg_files= pkg_files=
...@@ -358,6 +359,9 @@ check_option() ...@@ -358,6 +359,9 @@ check_option()
--skip-installed) # HELPOPT: skip already installed packages during install --skip-installed) # HELPOPT: skip already installed packages during install
skip_installed=1 skip_installed=1
;; ;;
--skip-missed) # HELPOPT: skip not installed packages during remove
skip_missed=1
;;
--show-command-only) # HELPOPT: show command only, do not any action (supports install and remove ONLY) --show-command-only) # HELPOPT: show command only, do not any action (supports install and remove ONLY)
show_command_only=1 show_command_only=1
;; ;;
......
...@@ -18,52 +18,13 @@ ...@@ -18,52 +18,13 @@
# #
load_helper epm-sh-altlinux load_helper epm-sh-altlinux
load_helper epm-sh-install
load_helper epm-query load_helper epm-query
load_helper epm-assure load_helper epm-assure
load_helper epm-repack load_helper epm-repack
load_helper epm-check_updated_repo load_helper epm-check_updated_repo
load_helper epm-sh-warmup load_helper epm-sh-warmup
__fast_hack_for_filter_out_installed_rpm()
{
LANG=C LC_ALL=C xargs -n1 rpm -q 2>&1 | grep 'is not installed' |
sed -e 's|^.*package \(.*\) is not installed.*|\1|g'
}
# TODO: use when run install with epm --skip-installed install
filter_out_installed_packages()
{
[ -z "$skip_installed" ] && cat && return
case $PMTYPE in
yum-rpm|dnf-rpm)
if [ "$($DISTRVENDOR -a)" = "x86_64" ] ; then
# shellcheck disable=SC2013
for i in $(cat) ; do
is_installed "$(__print_with_arch_suffix $i .x86_64)" && continue
is_installed "$(__print_with_arch_suffix $i .noarch)" && continue
echo $i
done
else
__fast_hack_for_filter_out_installed_rpm
fi
;;
*-rpm)
__fast_hack_for_filter_out_installed_rpm
;;
# dpkg -l lists some non ii status (un, etc)
#"deb")
# LANG=C LC_ALL=C xargs -n1 dpkg -l 2>&1 | grep -i 'no packages found matching' |
# sed -e 's|\.\+$||g' -e 's|^.*[Nn]o packages found matching \(.*\)|\1|g'
# ;;
*)
# shellcheck disable=SC2013
for i in $(cat) ; do
is_installed $i || echo $i
done
;;
esac | sed -e "s|rpm-build-altlinux-compat[^ ]*||g" | filter_strip_spaces
}
# for zypper before SUSE/11.0 # for zypper before SUSE/11.0
__use_zypper_no_gpg_checks() __use_zypper_no_gpg_checks()
...@@ -591,6 +552,7 @@ epm_install() ...@@ -591,6 +552,7 @@ epm_install()
# to be filter happy # to be filter happy
warmup_lowbase warmup_lowbase
# Note: filter_out_installed_packages depends on skip_installed flag
local names="$(echo $pkg_names | filter_out_installed_packages)" local names="$(echo $pkg_names | filter_out_installed_packages)"
#local names="$(echo $pkg_names | exp_with_arch_suffix | filter_out_installed_packages)" #local names="$(echo $pkg_names | exp_with_arch_suffix | filter_out_installed_packages)"
local files="$(echo $pkg_files | filter_out_installed_packages)" local files="$(echo $pkg_files | filter_out_installed_packages)"
......
...@@ -21,6 +21,7 @@ load_helper epm-sh-altlinux ...@@ -21,6 +21,7 @@ load_helper epm-sh-altlinux
load_helper epm-query load_helper epm-query
load_helper epm-print load_helper epm-print
load_helper epm-sh-warmup load_helper epm-sh-warmup
load_helper epm-sh-install
# Try remove with low level removing # Try remove with low level removing
epm_remove_low() epm_remove_low()
...@@ -297,6 +298,10 @@ epm_remove() ...@@ -297,6 +298,10 @@ epm_remove()
esac esac
fi fi
if [ -n "$skip_missed" ] ; then
pkg_names="$(get_only_installed_packages $pkg_names)"
fi
epm_remove_low $pkg_names && return epm_remove_low $pkg_names && return
local STATUS=$? local STATUS=$?
# TODO: check if we need continue with hi level # TODO: check if we need continue with hi level
......
...@@ -85,7 +85,7 @@ __subst_with_etersoft_url() ...@@ -85,7 +85,7 @@ __subst_with_etersoft_url()
__fix_repo_to_etersoft() __fix_repo_to_etersoft()
{ {
local NN local NN
apt-repo list | grep -v debuginfo | grep -v etersoft | grep -v "file:/" | while read nn ; do a="" apt-repo list | grep -v debuginfo | grep -v etersoft | grep -v "file:/" | while read nn ; do
NN="$(__subst_with_etersoft_url "$nn")" NN="$(__subst_with_etersoft_url "$nn")"
epm addrepo "$NN" epm addrepo "$NN"
epm removerepo "$nn" epm removerepo "$nn"
......
...@@ -141,6 +141,6 @@ get_task_packages() ...@@ -141,6 +141,6 @@ get_task_packages()
for tn in $(tasknumber "$@") ; do for tn in $(tasknumber "$@") ; do
showcmd apt-repo list task "$tn" showcmd apt-repo list task "$tn"
a='' apt-repo list task "$tn" a='' apt-repo list task "$tn"
[ "$arch" = "x64_64" ] && get_task_arepo_packages "$tn" [ "$arch" = "x86_64" ] && get_task_arepo_packages "$tn"
done done
} }
...@@ -365,7 +365,7 @@ assure_exists() ...@@ -365,7 +365,7 @@ assure_exists()
local textpackage= local textpackage=
[ -n "$package" ] || package="$(__get_package_for_command "$1")" [ -n "$package" ] || package="$(__get_package_for_command "$1")"
[ -n "$3" ] && textpackage=" >= $3" [ -n "$3" ] && textpackage=" >= $3"
epm_assure "$1" $package $3 || fatal "Can't assure in '$1' command from $package$textpackage package" ( direct='' epm_assure "$1" $package $3 ) || fatal "Can't assure in '$1' command from $package$textpackage package"
} }
# will replaced within disabled_eget in packaged version # will replaced within disabled_eget in packaged version
......
#!/bin/sh
#
# Copyright (C) 2012-2020 Etersoft
# Copyright (C) 2012-2020 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-sh-altlinux
load_helper epm-query
__fast_hack_for_filter_out_installed_rpm()
{
LANG=C LC_ALL=C xargs -n1 rpm -q 2>&1 | grep 'is not installed' |
sed -e 's|^.*package \(.*\) is not installed.*|\1|g'
}
# pass only uninstalled packages
filter_out_installed_packages()
{
[ -z "$skip_installed" ] && cat && return
case $PMTYPE in
yum-rpm|dnf-rpm)
if [ "$($DISTRVENDOR -a)" = "x86_64" ] ; then
# shellcheck disable=SC2013
for i in $(cat) ; do
is_installed "$(__print_with_arch_suffix $i .x86_64)" && continue
is_installed "$(__print_with_arch_suffix $i .noarch)" && continue
echo $i
done
else
__fast_hack_for_filter_out_installed_rpm
fi
;;
*-rpm)
__fast_hack_for_filter_out_installed_rpm
;;
# dpkg -l lists some non ii status (un, etc)
#"deb")
# LANG=C LC_ALL=C xargs -n1 dpkg -l 2>&1 | grep -i 'no packages found matching' |
# sed -e 's|\.\+$||g' -e 's|^.*[Nn]o packages found matching \(.*\)|\1|g'
# ;;
*)
# shellcheck disable=SC2013
for i in $(cat) ; do
is_installed $i || echo $i
done
;;
esac | sed -e "s|rpm-build-altlinux-compat[^ ]*||g" | filter_strip_spaces
}
get_only_installed_packages()
{
local installlist="$*"
estrlist exclude "$(echo "$installlist" | (skip_installed='yes' filter_out_installed_packages))" "$installlist"
}
...@@ -43,7 +43,7 @@ epm_upgrade() ...@@ -43,7 +43,7 @@ epm_upgrade()
installlist="$(estrlist reg_exclude ".*-devel .*-devel-static" "$installlist")" installlist="$(estrlist reg_exclude ".*-devel .*-devel-static" "$installlist")"
[ -n "$verbose" ] && info "Packages from task(s): $installlist" [ -n "$verbose" ] && info "Packages from task(s): $installlist"
# install only installed packages (simulate upgrade packages) # install only installed packages (simulate upgrade packages)
installlist="$(estrlist exclude "$(echo "$installlist" | (skip_installed='yes' filter_out_installed_packages))" "$installlist")" #" installlist="$(get_only_installed_packages "$installlist")"
[ -n "$verbose" ] && info "Packages to upgrade: $installlist" [ -n "$verbose" ] && info "Packages to upgrade: $installlist"
(pkg_names="$installlist" epm_Install) (pkg_names="$installlist" epm_Install)
epm_removerepo "$pkg_names" epm_removerepo "$pkg_names"
......
...@@ -121,15 +121,25 @@ reg_wordremove() ...@@ -121,15 +121,25 @@ reg_wordremove()
strip_spaces "$RES" strip_spaces "$RES"
} }
reg_rqremove()
{
local i
local RES=""
for i in $2 ; do
[ "$i" = "$1" ] || RES="$RES $i"
done
strip_spaces "$RES"
}
# Args: LIST1 LIST2 # Args: LIST1 LIST2
# do_exclude_list print LIST2 list exclude fields contains also in LIST1 # do_exclude_list print LIST2 list exclude fields contains also in LIST1
# Example: exclude "1 3" "1 2 3 4" -> "2 4" # Example: exclude "1 3" "1 2 3 4" -> "2 4"
exclude() exclude()
{ {
local i local i
local RES="" local RES="$2"
for i in $2 ; do for i in $1 ; do
echo "$1" | grep -q -w "$i" || RES="$RES $i" RES="$(reg_rqremove "$i" "$RES")"
done done
strip_spaces "$RES" strip_spaces "$RES"
} }
...@@ -140,7 +150,7 @@ reg_exclude() ...@@ -140,7 +150,7 @@ reg_exclude()
local i local i
local RES="$2" local RES="$2"
for i in $1 ; do for i in $1 ; do
RES=$(reg_remove "$i" "$RES") RES="$(reg_remove "$i" "$RES")"
done done
strip_spaces "$RES" strip_spaces "$RES"
} }
......
...@@ -5,7 +5,6 @@ file ...@@ -5,7 +5,6 @@ file
findutils findutils
grep grep
less less
procps
rpm rpm
sed sed
sudo sudo
......
# 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: 3.3.1 Version: 3.3.3
Release: alt0.M80P.1 Release: alt0.M80P.1
Summary: Etersoft EPM package manager Summary: Etersoft EPM package manager
...@@ -106,9 +106,18 @@ rm -f %buildroot%_bindir/distr_info ...@@ -106,9 +106,18 @@ rm -f %buildroot%_bindir/distr_info
%_sysconfdir/bash_completion.d/cerv %_sysconfdir/bash_completion.d/cerv
%changelog %changelog
* Thu Oct 08 2020 Vitaly Lipatov <lav@altlinux.ru> 3.3.1-alt0.M80P.1 * Sun Oct 11 2020 Vitaly Lipatov <lav@altlinux.ru> 3.3.3-alt0.M80P.1
- backport to ALTLinux p8 (by rpmbph script) - backport to ALTLinux p8 (by rpmbph script)
* Sun Oct 11 2020 Vitaly Lipatov <lav@altlinux.ru> 3.3.3-alt1
- fix typo in get_task_packages
* Sat Oct 10 2020 Vitaly Lipatov <lav@altlinux.ru> 3.3.2-alt1
- mask direct in assure_exists
- epm-repofix: mask apt-repo using
- update tools_estrlist from estrlist package
- epm-remove: add --skip-missed
* Wed Oct 07 2020 Vitaly Lipatov <lav@altlinux.ru> 3.3.1-alt1 * Wed Oct 07 2020 Vitaly Lipatov <lav@altlinux.ru> 3.3.1-alt1
- get_task_packages: add arepo packages (i586) too - get_task_packages: add arepo packages (i586) too
- epm-upgrade: drop devel subpackages from upgrade from a task - epm-upgrade: drop devel subpackages from upgrade from a task
......
ALT Workstation K 9.0 BETA (Centaurea Ruthenica)
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