Commit 76382d2d authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-upgrade: add support for upgrade installed packages (and package files)

parent 726863b7
......@@ -324,7 +324,6 @@ check_command()
;;
upgrade|dist-upgrade) # HELPCMD: performs upgrades of package software distributions
epm_cmd=upgrade
direct_args=1
;;
Upgrade) # HELPCMD: force update package base, then run upgrade
epm_cmd=Upgrade
......
......@@ -89,6 +89,7 @@ epm_downgrade()
__epm_add_alt_apt_downgrade_preferences || return
load_helper epm-upgrade
epm_upgrade "$@"
__epm_remove_apt_downgrade_preferences
fi
;;
apt-dpkg)
......
......@@ -84,7 +84,7 @@ epm_release_downgrade()
__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
;;
......
......@@ -195,7 +195,7 @@ get_fix_release_pkg()
# update if installed (just print package name here to include in the install list)
epm --quiet --short installed alt-gpgkeys 2>/dev/null
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
fi
......@@ -232,6 +232,8 @@ __check_system()
fi
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
warning "Target distro is $TO, but altlinux-release-sisyphus package is installed."
warning "Trying to replace it with altlinux-release-$TO"
......@@ -490,7 +492,7 @@ epm_release_upgrade()
info "Starting upgrade/switch whole system to other release"
info "Check also http://wiki.etersoft.ru/Admin/UpdateLinux"
cd /tmp || fatal
cd / || fatal
# TODO: it is possible eatmydata does not do his work
export EPMNOEATMYDATA=1
......
......@@ -57,9 +57,24 @@ epm_upgrade()
info "Running command for upgrade packages"
case $PMTYPE in
*-rpm)
# upgrade only install files from the list
if [ -n "$pkg_files" ] ; then
load_helper epm-install
#sudocmd rpm -Fvh $pkg_files
(pkg_files=$pkg_files force="$force -F" epm_install)
return
elif [ -n "$pkg_names" ] ; then
load_helper epm-install
(pkg_names=$(get_only_installed_packages $pkg_names) epm_install)
return
fi
;;
esac
case $PMTYPE in
apt-rpm|apt-dpkg)
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"
;;
aptitude-dpkg)
......
......@@ -37,6 +37,7 @@ epm --auto --force --force-yes downgrade-release p10
# p10 -> p9
epm --auto --force --force-yes downgrade-release
restore_epm
# p9 -> p10
epm --auto --force --force-yes upgrade-release
......
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