Commit 80d4b574 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.14.3

parent 2e4976a5
...@@ -961,7 +961,7 @@ case $PMTYPE in ...@@ -961,7 +961,7 @@ case $PMTYPE in
echo "We will try remove all installed packages which are missed in repositories" echo "We will try remove all installed packages which are missed in repositories"
warning "Use with caution!" warning "Use with caution!"
fi fi
epm upgrade || fatal epm Upgrade || fatal
local PKGLIST=$(__epm_orphan_altrpm \ local PKGLIST=$(__epm_orphan_altrpm \
| sed -e "s/\.32bit//g" \ | sed -e "s/\.32bit//g" \
| grep -v -- "^eepm$" \ | grep -v -- "^eepm$" \
...@@ -1293,14 +1293,6 @@ case $DISTRNAME in ...@@ -1293,14 +1293,6 @@ case $DISTRNAME in
docmd epm remove-old-kernels $(subst_option non_interactive --auto) docmd epm remove-old-kernels $(subst_option non_interactive --auto)
if which nvidia-clean-driver 2>/dev/null ; then
if [ -n "$non_interactive" ] ; then
yes | sudocmd nvidia-clean-driver
else
sudocmd nvidia-clean-driver
fi
fi
if [ -z "$direct" ] ; then if [ -z "$direct" ] ; then
echo echo
info "Also you can run 'epm autoremove --direct' to use epm implementation of autoremove (see --help)" info "Also you can run 'epm autoremove --direct' to use epm implementation of autoremove (see --help)"
...@@ -2059,18 +2051,21 @@ epm_downgrade() ...@@ -2059,18 +2051,21 @@ epm_downgrade()
case $PMTYPE in case $PMTYPE in
apt-rpm) apt-rpm)
local APTOPTIONS="$(subst_option non_interactive -y)"
__epm_add_alt_apt_downgrade_preferences || return
# pass pkg_filenames too # pass pkg_filenames too
if [ -n "$pkg_names" ] ; then if [ -n "$pkg_names" ] ; then
(pkg_names=$pkg_names epm_install) __epm_add_alt_apt_downgrade_preferences || return
(pkg_names=$(get_only_installed_packages $pkg_names) epm_install)
__epm_remove_apt_downgrade_preferences
elif [ -n "$pkg_files" ] ; then
(pkg_files=$pkg_files force="$force -F --oldpackage" epm_install)
else else
__epm_add_alt_apt_downgrade_preferences || return
epm_upgrade "$@" epm_upgrade "$@"
fi
__epm_remove_apt_downgrade_preferences __epm_remove_apt_downgrade_preferences
fi
;; ;;
apt-dpkg) apt-dpkg)
local APTOPTIONS="$(subst_option non_interactive -y)" local APTOPTIONS="$(subst_option non_interactive -y) $force_yes"
__epm_add_deb_apt_downgrade_preferences || return __epm_add_deb_apt_downgrade_preferences || return
if [ -n "$pkg_filenames" ] ; then if [ -n "$pkg_filenames" ] ; then
sudocmd apt-get $APTOPTIONS install $pkg_filenames sudocmd apt-get $APTOPTIONS install $pkg_filenames
...@@ -2346,12 +2341,8 @@ epm_epm_install() { ...@@ -2346,12 +2341,8 @@ epm_epm_install() {
# install epm by default # install epm by default
if [ -z "$pkglist" ] || [ "$pkglist" = "epm" ] || [ "$pkglist" = "eepm" ]; then if [ -z "$pkglist" ] || [ "$pkglist" = "epm" ] || [ "$pkglist" = "eepm" ]; then
if [ "$($DISTRVENDOR -s)" = "alt" ] ; then
pkglist="distro_info eepm"
else
pkglist="eepm" pkglist="eepm"
fi fi
fi
case "$pkglist" in case "$pkglist" in
--list*) --list*)
...@@ -3399,6 +3390,9 @@ epm_kernel_update() ...@@ -3399,6 +3390,9 @@ epm_kernel_update()
esac esac
case $PMTYPE in case $PMTYPE in
dnf-rpm)
docmd epm install kernel
;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
;; ;;
...@@ -3692,11 +3686,11 @@ fi ...@@ -3692,11 +3686,11 @@ fi
if [ "$1" = "--remove" ] ; then if [ "$1" = "--remove" ] ; then
shift shift
#__check_installed_app "$1" || fatal "$1 is not installed" #__check_installed_app "$1" || warning "$1 is not installed"
prescription="$1" prescription="$1"
shift shift
__epm_play_run $prescription --remove "$@" __epm_play_run $prescription --remove "$@"
__remove_installed_app "$@" __remove_installed_app "$prescription"
exit exit
fi fi
...@@ -4527,25 +4521,24 @@ __do_query_real_file() ...@@ -4527,25 +4521,24 @@ __do_query_real_file()
else else
TOFILE=$(which -- "$1" 2>/dev/null || echo "$1") TOFILE=$(which -- "$1" 2>/dev/null || echo "$1")
if [ "$TOFILE" != "$1" ] ; then if [ "$TOFILE" != "$1" ] ; then
info "Note: $1 is placed as $TOFILE" info " > $1 is placed as $TOFILE"
fi fi
fi fi
# get value of symbolic link
if [ -L "$TOFILE" ] ; then
local LINKTO
if [ -n "$short" ] ; then if [ -n "$short" ] ; then
__do_short_query "$TOFILE" __do_short_query "$TOFILE"
else else
__do_query "$TOFILE" __do_query "$TOFILE"
fi fi
LINKTO=$(readlink -f -- "$TOFILE")
info "Note: $TOFILE is link to $LINKTO" # get value of symbolic link
if [ -L "$TOFILE" ] ; then
local LINKTO
LINKTO=$(readlink -- "$TOFILE")
info " > $TOFILE is link to $LINKTO"
__do_query_real_file "$LINKTO" __do_query_real_file "$LINKTO"
return return
fi fi
FULLFILEPATH="$TOFILE"
} }
dpkg_print_name_version() dpkg_print_name_version()
...@@ -4654,14 +4647,10 @@ epm_query_file() ...@@ -4654,14 +4647,10 @@ epm_query_file()
res=0 res=0
for pkg in $pkg_filenames ; do for pkg in $pkg_filenames ; do
__do_query_real_file "$pkg" __do_query_real_file "$pkg" || res=$?
if [ -n "$short" ] ; then
__do_short_query "$FULLFILEPATH" || res=$?
else
__do_query "$FULLFILEPATH" || res=$?
fi
done done
[ "$res" = "0" ] || info "Try epm sf for search file in all packages in repository"
[ "$res" = "0" ] || info "Try epm sf for search file in all packages of the repositories"
#|| pkg_filenames="$FULLFILEPATH" epm_search_file #|| pkg_filenames="$FULLFILEPATH" epm_search_file
return $res return $res
} }
...@@ -4833,7 +4822,7 @@ epm_release_downgrade() ...@@ -4833,7 +4822,7 @@ epm_release_downgrade()
__alt_repofix __alt_repofix
__switch_alt_to_distro $DISTRVERSION $TARGET && info "Done. The system has been successfully downgraded to the previous release '$TO'." __switch_alt_to_distro $DISTRVERSION $TARGET && info "Done. The system has been successfully downgraded to the previous release '$TARGET'."
return 0 return 0
;; ;;
...@@ -4931,9 +4920,9 @@ assure_safe_run() ...@@ -4931,9 +4920,9 @@ assure_safe_run()
else else
warning "It is very dangerous to upgrade to next release from a GUI (your TERM=$TERM)." warning "It is very dangerous to upgrade to next release from a GUI (your TERM=$TERM)."
if is_installed screen ; then if is_installed screen ; then
warning "You have 'screen' already installed, just run upgrade via screen: '# screen epm release-upgrade'" warning "You have 'screen' already installed, just run upgrade via screen (check https://losst.ru/komanda-screen-linux if needed)."
else else
warning "It is recommended install 'screen' and run upgrade via screen: '# screen epm release-upgrade'" warning "It is recommended install 'screen' and run upgrade via screen (check https://losst.ru/komanda-screen-linux if needed)."
fi fi
fatal "or run me with --force if you understand the risk." fatal "or run me with --force if you understand the risk."
fi fi
...@@ -4954,7 +4943,8 @@ assure_safe_run() ...@@ -4954,7 +4943,8 @@ assure_safe_run()
warning "You force runnning even if systemd-logind kills screen on disconnect" warning "You force runnning even if systemd-logind kills screen on disconnect"
else else
docmd epm install systemd-settings-disable-kill-user-processes || fatal "Can't install the package above. Fix it or run with --force." docmd epm install systemd-settings-disable-kill-user-processes || fatal "Can't install the package above. Fix it or run with --force."
docmd serv systemd-logind restart || fatal "Can't restart systemd-logind service. Fix it or run with --force." # commented, will kick off the user from the system (ALT issue 50580)
#docmd serv systemd-logind restart || fatal "Can't restart systemd-logind service. Fix it or run with --force."
fatal "Now you need relogin to the system. In this session your screen still will be killed." fatal "Now you need relogin to the system. In this session your screen still will be killed."
fi fi
fi fi
...@@ -5066,7 +5056,7 @@ get_fix_release_pkg() ...@@ -5066,7 +5056,7 @@ get_fix_release_pkg()
true true
#echo "apt-conf-$TO" #echo "apt-conf-$TO"
else else
echo "apt-conf-branch" epmqp apt-conf-branch >/dev/null 2>/dev/null || echo "apt-conf-branch"
fi fi
if [ "$FORCE" == "--force" ] ; then if [ "$FORCE" == "--force" ] ; then
...@@ -5091,7 +5081,7 @@ get_fix_release_pkg() ...@@ -5091,7 +5081,7 @@ get_fix_release_pkg()
# update if installed (just print package name here to include in the install list) # update if installed (just print package name here to include in the install list)
epm --quiet --short installed alt-gpgkeys 2>/dev/null epm --quiet --short installed alt-gpgkeys 2>/dev/null
if epm --quiet --short -q etersoft-gpgkeys 2>/dev/null >/dev/null ; then if epm --quiet --short -q etersoft-gpgkeys 2>/dev/null >/dev/null ; then
# leave etersoft-gpgkeys only we have LINUX@Etersoft repo # leave etersoft-gpgkeys only if we have LINUX@Etersoft repo
epm rl | grep -q "LINUX@Etersoft" && echo etersoft-gpgkeys || echo alt-gpgkeys epm rl | grep -q "LINUX@Etersoft" && echo etersoft-gpgkeys || echo alt-gpgkeys
fi fi
...@@ -5128,9 +5118,11 @@ __check_system() ...@@ -5128,9 +5118,11 @@ __check_system()
fi fi
if [ "$TO" != "Sisyphus" ] ; then if [ "$TO" != "Sisyphus" ] ; then
# we could miss DISTRVENDOR script during downgrade, reread
set_distro_info
if [ "$($DISTRVENDOR -v)" != "$TO" ] || epm installed altlinux-release-sisyphus >/dev/null ; then if [ "$($DISTRVENDOR -v)" != "$TO" ] || epm installed altlinux-release-sisyphus >/dev/null ; then
warning "Target distro is $TO, but altlinux-release-sisyphus package is installed." warning "Current distro still is not $TO, or altlinux-release-sisyphus package is installed."
warning "Trying to replace it with altlinux-release-$TO" warning "Trying to fix with altlinux-release-$TO"
docmd epm install altlinux-release-$TO docmd epm install altlinux-release-$TO
fi fi
fi fi
...@@ -5190,6 +5182,11 @@ get_next_release() ...@@ -5190,6 +5182,11 @@ get_next_release()
esac esac
} }
__do_upgrade()
{
docmd epm $non_interactive $force_yes upgrade || fatal "Check the errors and run '# $0' again"
}
__switch_alt_to_distro() __switch_alt_to_distro()
{ {
local TO="$2" local TO="$2"
...@@ -5205,7 +5202,7 @@ __switch_alt_to_distro() ...@@ -5205,7 +5202,7 @@ __switch_alt_to_distro()
__switch_repo_to $TO __switch_repo_to $TO
__epm_ru_update || fatal __epm_ru_update || fatal
docmd epm install rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again" docmd epm install rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again"
docmd epm upgrade || fatal "Check the errors and run '# epm release-upgrade' again" __do_upgrade
end_change_alt_repo end_change_alt_repo
docmd epm update-kernel docmd epm update-kernel
info "Run epm release-upgrade again for update to p8" info "Run epm release-upgrade again for update to p8"
...@@ -5216,7 +5213,7 @@ __switch_alt_to_distro() ...@@ -5216,7 +5213,7 @@ __switch_alt_to_distro()
__switch_repo_to $TO __switch_repo_to $TO
__epm_ru_update || fatal __epm_ru_update || fatal
docmd epm install rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again" docmd epm install rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again"
docmd epm upgrade || fatal "Check the errors and run '# epm release-upgrade' again" __do_upgrade
end_change_alt_repo end_change_alt_repo
__check_system "$TO" __check_system "$TO"
docmd epm update-kernel || fatal docmd epm update-kernel || fatal
...@@ -5228,7 +5225,7 @@ __switch_alt_to_distro() ...@@ -5228,7 +5225,7 @@ __switch_alt_to_distro()
__switch_repo_to $TO __switch_repo_to $TO
__epm_ru_update || fatal __epm_ru_update || fatal
docmd epm install rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again" docmd epm install rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again"
docmd epm upgrade || fatal "Check the errors and run '# epm release-upgrade' again" __do_upgrade
end_change_alt_repo end_change_alt_repo
__check_system "$TO" __check_system "$TO"
docmd epm update-kernel || fatal docmd epm update-kernel || fatal
...@@ -5243,8 +5240,8 @@ __switch_alt_to_distro() ...@@ -5243,8 +5240,8 @@ __switch_alt_to_distro()
# glibc-core coflicts libcrypt # glibc-core coflicts libcrypt
docmd epm downgrade apt pam pam0_passwdqc glibc-core libcrypt- || fatal docmd epm downgrade apt pam pam0_passwdqc glibc-core libcrypt- || fatal
fi fi
docmd epm downgrade docmd epm $non_interactive $force_yes downgrade || fatal
docmd epm upgrade || fatal "Check the errors and run '# epm release-upgrade' again" __do_upgrade
end_change_alt_repo end_change_alt_repo
__check_system "$TO" __check_system "$TO"
docmd epm update-kernel || fatal docmd epm update-kernel || fatal
...@@ -5258,7 +5255,7 @@ __switch_alt_to_distro() ...@@ -5258,7 +5255,7 @@ __switch_alt_to_distro()
fi fi
__switch_repo_to $TO __switch_repo_to $TO
__epm_ru_update || fatal __epm_ru_update || fatal
docmd epm upgrade || fatal "Check the errors and run '# epm release-upgrade' again" __do_upgrade
end_change_alt_repo end_change_alt_repo
docmd epm install rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again" docmd epm install rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again"
__check_system "$TO" __check_system "$TO"
...@@ -5267,13 +5264,13 @@ __switch_alt_to_distro() ...@@ -5267,13 +5264,13 @@ __switch_alt_to_distro()
;; ;;
"p9"|"p9 p10"|"p10 p10") "p9"|"p9 p10"|"p10 p10")
info "Upgrade all packages to current $FROM repository" info "Upgrade all packages to current $FROM repository"
docmd epm upgrade || fatal __do_upgrade
confirm_info "Upgrade $DISTRNAME from $FROM to $TO ..." confirm_info "Upgrade $DISTRNAME from $FROM to $TO ..."
docmd epm install rpm apt "$(get_fix_release_pkg "$FROM")" || fatal docmd epm install rpm apt "$(get_fix_release_pkg "$FROM")" || fatal
__switch_repo_to $TO __switch_repo_to $TO
echo '%_priority_distbranch p10' >/etc/rpm/macros.d/p10 echo '%_priority_distbranch p10' >/etc/rpm/macros.d/p10
__epm_ru_update || fatal __epm_ru_update || fatal
docmd epm upgrade || fatal "Check the errors and run '# epm release-upgrade' again" __do_upgrade
end_change_alt_repo end_change_alt_repo
docmd epm install rpm apt "$(get_fix_release_pkg "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again" docmd epm install rpm apt "$(get_fix_release_pkg "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again"
__check_system "$TO" __check_system "$TO"
...@@ -5281,7 +5278,7 @@ __switch_alt_to_distro() ...@@ -5281,7 +5278,7 @@ __switch_alt_to_distro()
;; ;;
"p9 p8"|"c8.1 c8"|"c8.1 p8"|"p8 p8") "p9 p8"|"c8.1 c8"|"c8.1 p8"|"p8 p8")
confirm_info "Downgrade $DISTRNAME from $FROM to $TO ..." confirm_info "Downgrade $DISTRNAME from $FROM to $TO ..."
docmd epm install "$(get_fix_release_pkg "$FROM")" || fatal docmd epm install "$(get_fix_release_pkg "$FROM")"
__switch_repo_to $TO __switch_repo_to $TO
__epm_ru_update || fatal __epm_ru_update || fatal
docmd epm downgrade rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again" docmd epm downgrade rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again"
...@@ -5289,14 +5286,14 @@ __switch_alt_to_distro() ...@@ -5289,14 +5286,14 @@ __switch_alt_to_distro()
# glibc-core coflicts libcrypt # glibc-core coflicts libcrypt
docmd epm downgrade apt rpm pam pam0_passwdqc glibc-core libcrypt- || fatal docmd epm downgrade apt rpm pam pam0_passwdqc glibc-core libcrypt- || fatal
fi fi
docmd epm downgrade || fatal "Check the error and run '# epm downgrade'" docmd epm $force_yes $non_interactive downgrade || fatal "Check the error and run '# epm downgrade'"
end_change_alt_repo end_change_alt_repo
__check_system "$TO" __check_system "$TO"
docmd epm upgrade || fatal docmd epm upgrade || fatal
;; ;;
"p9 c8"|"p9 c8.1"|"p9 c8.2") "p9 c8"|"p9 c8.1"|"p9 c8.2")
confirm_info "Downgrade $DISTRNAME from $FROM to $TO ..." confirm_info "Downgrade $DISTRNAME from $FROM to $TO ..."
docmd epm install "$(get_fix_release_pkg "$FROM")" || fatal docmd epm install "$(get_fix_release_pkg "$FROM")"
__switch_repo_to $TO __switch_repo_to $TO
__epm_ru_update || fatal __epm_ru_update || fatal
docmd epm downgrade rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again" docmd epm downgrade rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again"
...@@ -5304,31 +5301,31 @@ __switch_alt_to_distro() ...@@ -5304,31 +5301,31 @@ __switch_alt_to_distro()
# # glibc-core coflicts libcrypt # # glibc-core coflicts libcrypt
# docmd epm downgrade apt rpm pam pam0_passwdqc glibc-core libcrypt- || fatal # docmd epm downgrade apt rpm pam pam0_passwdqc glibc-core libcrypt- || fatal
#fi #fi
docmd epm downgrade || fatal "Check the error and run '# epm downgrade'" docmd epm $force_yes $non_interactive downgrade || fatal "Check the error and run '# epm downgrade'"
end_change_alt_repo end_change_alt_repo
__check_system "$TO" __check_system "$TO"
docmd epm upgrade || fatal docmd epm upgrade || fatal
;; ;;
"p10 p9") "p10 p9")
confirm_info "Downgrade $DISTRNAME from $FROM to $TO ..." confirm_info "Downgrade $DISTRNAME from $FROM to $TO ..."
docmd epm install "$(get_fix_release_pkg "$FROM")" || fatal docmd epm install "$(get_fix_release_pkg "$FROM")"
__switch_repo_to $TO __switch_repo_to $TO
rm -fv /etc/rpm/macros.d/p10 rm -fv /etc/rpm/macros.d/p10
__epm_ru_update || fatal __epm_ru_update || fatal
docmd epm downgrade rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again" docmd epm downgrade rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again"
docmd epm downgrade || fatal "Check the error and run '# epm downgrade'" docmd epm $force_yes $non_interactive downgrade || fatal "Check the error and run '# epm downgrade'"
end_change_alt_repo end_change_alt_repo
__check_system "$TO" __check_system "$TO"
docmd epm upgrade || fatal docmd epm upgrade || fatal
;; ;;
"Sisyphus p8"|"Sisyphus p9"|"Sisyphus p10"|"Sisyphus c8"|"Sisyphus c8.1") "Sisyphus p8"|"Sisyphus p9"|"Sisyphus p10"|"Sisyphus c8"|"Sisyphus c8.1")
confirm_info "Downgrade $DISTRNAME from $FROM to $TO ..." confirm_info "Downgrade $DISTRNAME from $FROM to $TO ..."
docmd epm install "$(get_fix_release_pkg "$FROM")" || fatal docmd epm install "$(get_fix_release_pkg "$FROM")"
__switch_repo_to $TO __switch_repo_to $TO
[ "$TO" = "p10" ] && echo '%_priority_distbranch p10' >/etc/rpm/macros.d/p10 [ "$TO" = "p10" ] && echo '%_priority_distbranch p10' >/etc/rpm/macros.d/p10
__epm_ru_update || fatal __epm_ru_update || fatal
docmd epm install rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again" docmd epm install rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check the errors and run '# epm release-upgrade' again"
docmd epm downgrade || fatal "Check the error and run '# epm downgrade'" docmd epm $force_yes $non_interactive downgrade || fatal "Check the error and run '# epm downgrade'"
end_change_alt_repo end_change_alt_repo
__check_system "$TO" __check_system "$TO"
docmd epm upgrade || fatal docmd epm upgrade || fatal
...@@ -5345,8 +5342,8 @@ __switch_alt_to_distro() ...@@ -5345,8 +5342,8 @@ __switch_alt_to_distro()
#local ADDPKG #local ADDPKG
#ADDPKG=$(epm -q --short make-initrd sssd-ad 2>/dev/null) #ADDPKG=$(epm -q --short make-initrd sssd-ad 2>/dev/null)
#docmd epm install librpm7 librpm rpm apt $ADDPKG "$(get_fix_release_pkg --force "$TO")" ConsoleKit2- || fatal "Check an error and run again" #docmd epm install librpm7 librpm rpm apt $ADDPKG "$(get_fix_release_pkg --force "$TO")" ConsoleKit2- || fatal "Check an error and run again"
docmd epm upgrade || fatal "Check the error and run '# epm release-upgrade' again or just '# epm upgrade'" docmd epm $force_yes $non_interactive upgrade || fatal "Check the error and run '# epm release-upgrade' again or just '# epm upgrade'"
docmd epm downgrade docmd epm $force_yes $non_interactive downgrade || fatal "Check the error and run '# epm downgrade'"
end_change_alt_repo end_change_alt_repo
__check_system "$TO" __check_system "$TO"
docmd epm update-kernel || fatal docmd epm update-kernel || fatal
...@@ -5362,7 +5359,8 @@ __switch_alt_to_distro() ...@@ -5362,7 +5359,8 @@ __switch_alt_to_distro()
info "Also possible you need install altlinux-release-p? package for correct distro version detecting" info "Also possible you need install altlinux-release-p? package for correct distro version detecting"
return 1 return 1
esac esac
epm clean docmd epm clean
docmd epm update
info "Note: Also you can try '# epm autoremove' and '# epm autoorphans' commands to remove obsoleted and unused packages." info "Note: Also you can try '# epm autoremove' and '# epm autoorphans' commands to remove obsoleted and unused packages."
} }
...@@ -5373,7 +5371,7 @@ epm_release_upgrade() ...@@ -5373,7 +5371,7 @@ epm_release_upgrade()
info "Starting upgrade/switch whole system to other release" info "Starting upgrade/switch whole system to other release"
info "Check also http://wiki.etersoft.ru/Admin/UpdateLinux" info "Check also http://wiki.etersoft.ru/Admin/UpdateLinux"
cd /tmp || fatal cd / || fatal
# TODO: it is possible eatmydata does not do his work # TODO: it is possible eatmydata does not do his work
export EPMNOEATMYDATA=1 export EPMNOEATMYDATA=1
...@@ -5824,6 +5822,16 @@ epm_remove_old_kernels() ...@@ -5824,6 +5822,16 @@ epm_remove_old_kernels()
fi fi
assure_exists update-kernel update-kernel 0.9.9 assure_exists update-kernel update-kernel 0.9.9
sudocmd remove-old-kernels $(subst_option non_interactive -y) "$@" sudocmd remove-old-kernels $(subst_option non_interactive -y) "$@"
# remove unused nvidia drivers
if which nvidia-clean-driver 2>/dev/null ; then
if [ -n "$non_interactive" ] ; then
yes | sudocmd nvidia-clean-driver
else
sudocmd nvidia-clean-driver
fi
fi
return ;; return ;;
Ubuntu) Ubuntu)
if ! __epm_query_package linux-image >/dev/null ; then if ! __epm_query_package linux-image >/dev/null ; then
...@@ -8349,10 +8357,28 @@ epm_upgrade() ...@@ -8349,10 +8357,28 @@ epm_upgrade()
info "Running command for upgrade packages" info "Running command for upgrade packages"
case $PMTYPE in case $PMTYPE in
*-rpm)
# upgrade only install files from the list
if [ -n "$pkg_files" ] ; then
#sudocmd rpm -Fvh $pkg_files
(pkg_files=$pkg_files force="$force -F" epm_install)
return
elif [ -n "$pkg_names" ] ; then
# hack for https://bugzilla.altlinux.org/41225
case "$pkg_names" in
-*)
fatal "Option $pkg_names is not allowed here"
esac
(pkg_names=$(get_only_installed_packages $pkg_names) epm_install)
return
fi
;;
esac
case $PMTYPE in
apt-rpm|apt-dpkg) apt-rpm|apt-dpkg)
local APTOPTIONS="$(subst_option non_interactive -y) $(subst_option verbose "-o Debug::pkgMarkInstall=1 -o Debug::pkgProblemResolver=1")" local APTOPTIONS="$(subst_option non_interactive -y) $(subst_option verbose "-o Debug::pkgMarkInstall=1 -o Debug::pkgProblemResolver=1")"
# Функцию добавления параметра при условии CMD="apt-get $APTOPTIONS $noremove $force_yes dist-upgrade"
CMD="apt-get $APTOPTIONS dist-upgrade $noremove"
;; ;;
aptitude-dpkg) aptitude-dpkg)
CMD="aptitude dist-upgrade" CMD="aptitude dist-upgrade"
...@@ -10163,7 +10189,7 @@ Examples: ...@@ -10163,7 +10189,7 @@ Examples:
print_version() print_version()
{ {
echo "EPM package manager version 3.13.3 https://wiki.etersoft.ru/Epm" echo "EPM package manager version 3.14.3 https://wiki.etersoft.ru/Epm"
echo "Running on $($DISTRVENDOR -e) ('$PMTYPE' package manager uses '$PKGFORMAT' package format)" echo "Running on $($DISTRVENDOR -e) ('$PMTYPE' package manager uses '$PKGFORMAT' package format)"
echo "Copyright (c) Etersoft 2012-2021" echo "Copyright (c) Etersoft 2012-2021"
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."
...@@ -10173,7 +10199,7 @@ print_version() ...@@ -10173,7 +10199,7 @@ print_version()
Usage="Usage: epm [options] <command> [package name(s), package files]..." Usage="Usage: epm [options] <command> [package name(s), package files]..."
Descr="epm - EPM package manager" Descr="epm - EPM package manager"
EPMVERSION=3.13.3 EPMVERSION=3.14.3
verbose= verbose=
quiet= quiet=
nodeps= nodeps=
...@@ -10188,6 +10214,7 @@ short= ...@@ -10188,6 +10214,7 @@ short=
direct= direct=
sort= sort=
non_interactive= non_interactive=
force_yes=
skip_installed= skip_installed=
skip_missed= skip_missed=
show_command_only= show_command_only=
...@@ -10274,7 +10301,7 @@ check_command() ...@@ -10274,7 +10301,7 @@ check_command()
-i|install|add|i) # HELPCMD: install package(s) from remote repositories or from local file -i|install|add|i) # HELPCMD: install package(s) from remote repositories or from local file
epm_cmd=install epm_cmd=install
;; ;;
-e|-P|rm|del|remove|delete|uninstall|erase|e) # HELPCMD: remove (delete) package(s) from the database and the system -e|-P|rm|del|remove|delete|uninstall|erase|purge|e) # HELPCMD: remove (delete) package(s) from the database and the system
epm_cmd=remove epm_cmd=remove
;; ;;
-s|search|s) # HELPCMD: search in remote package repositories -s|search|s) # HELPCMD: search in remote package repositories
...@@ -10415,7 +10442,6 @@ check_command() ...@@ -10415,7 +10442,6 @@ check_command()
;; ;;
upgrade|dist-upgrade) # HELPCMD: performs upgrades of package software distributions upgrade|dist-upgrade) # HELPCMD: performs upgrades of package software distributions
epm_cmd=upgrade epm_cmd=upgrade
direct_args=1
;; ;;
Upgrade) # HELPCMD: force update package base, then run upgrade Upgrade) # HELPCMD: force update package base, then run upgrade
epm_cmd=Upgrade epm_cmd=Upgrade
...@@ -10534,6 +10560,9 @@ check_option() ...@@ -10534,6 +10560,9 @@ check_option()
--auto|--assumeyes|--non-interactive) # HELPOPT: non interactive mode --auto|--assumeyes|--non-interactive) # HELPOPT: non interactive mode
non_interactive="--auto" non_interactive="--auto"
;; ;;
--force-yes) # HELPOPT: force yes in a danger cases (f.i., during release upgrade)
force_yes="--force-yes"
;;
*) *)
return 1 return 1
;; ;;
...@@ -10559,6 +10588,7 @@ check_filenames() ...@@ -10559,6 +10588,7 @@ check_filenames()
pkg_urls="$pkg_urls $opt" pkg_urls="$pkg_urls $opt"
else else
has_space "$opt" && warning "There are space(s) in package name '$opt', it is not supported. Skipped." && continue has_space "$opt" && warning "There are space(s) in package name '$opt', it is not supported. Skipped." && continue
# TODO: don't add unknown options (like -y, --unknown) to pkg_names
pkg_names="$pkg_names $opt" pkg_names="$pkg_names $opt"
fi fi
quoted_args="$quoted_args \"$opt\"" quoted_args="$quoted_args \"$opt\""
......
...@@ -2955,7 +2955,7 @@ print_version() ...@@ -2955,7 +2955,7 @@ print_version()
local on_text="(host system)" local on_text="(host system)"
local virt="$($DISTRVENDOR -i)" local virt="$($DISTRVENDOR -i)"
[ "$virt" = "(unknown)" ] || [ "$virt" = "(host system)" ] || on_text="(under $virt)" [ "$virt" = "(unknown)" ] || [ "$virt" = "(host system)" ] || on_text="(under $virt)"
echo "Service manager version 3.13.3 https://wiki.etersoft.ru/Epm" echo "Service manager version 3.14.3 https://wiki.etersoft.ru/Epm"
echo "Running on $($DISTRVENDOR -e) $on_text with $SERVICETYPE" echo "Running on $($DISTRVENDOR -e) $on_text with $SERVICETYPE"
echo "Copyright (c) Etersoft 2012-2021" echo "Copyright (c) Etersoft 2012-2021"
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."
......
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