Commit 726863b7 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-release-upgrade: pass --auto and --force-yes to epm upgrade/downgrade

parent d98bc120
...@@ -301,6 +301,11 @@ get_next_release() ...@@ -301,6 +301,11 @@ get_next_release()
esac esac
} }
__do_upgrade()
{
docmd epm $non_interactive $force_yes upgrade || fatal "Check the errors and run '# $0' again"
}
# TODO: install new conf without signs? # TODO: install new conf without signs?
__switch_alt_to_distro() __switch_alt_to_distro()
{ {
...@@ -317,7 +322,7 @@ __switch_alt_to_distro() ...@@ -317,7 +322,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"
...@@ -328,7 +333,7 @@ __switch_alt_to_distro() ...@@ -328,7 +333,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
...@@ -340,7 +345,7 @@ __switch_alt_to_distro() ...@@ -340,7 +345,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
...@@ -355,8 +360,8 @@ __switch_alt_to_distro() ...@@ -355,8 +360,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
...@@ -370,7 +375,7 @@ __switch_alt_to_distro() ...@@ -370,7 +375,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"
...@@ -379,13 +384,13 @@ __switch_alt_to_distro() ...@@ -379,13 +384,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"
...@@ -401,7 +406,7 @@ __switch_alt_to_distro() ...@@ -401,7 +406,7 @@ __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
...@@ -416,7 +421,7 @@ __switch_alt_to_distro() ...@@ -416,7 +421,7 @@ __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
...@@ -428,7 +433,7 @@ __switch_alt_to_distro() ...@@ -428,7 +433,7 @@ __switch_alt_to_distro()
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
...@@ -440,7 +445,7 @@ __switch_alt_to_distro() ...@@ -440,7 +445,7 @@ __switch_alt_to_distro()
[ "$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
...@@ -457,8 +462,8 @@ __switch_alt_to_distro() ...@@ -457,8 +462,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
......
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