Commit 67fa6d37 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm release-upgrade: initial support upgrade from p7 to p8 and p6 to p7

parent 0dc3d0de
......@@ -17,29 +17,65 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
__replace_alt_version_in_repo()
{
local i
assure_exists apt-repo
echo "Upgrading $DISTRNAME from $1 to $2 ..."
docmd apt-repo list | sed -e "s|\($1/branch\)|{\1}->$2/branch<|g" | egrep --color -- "$1/branch"
confirm "Are these correct changes?" || fatal "Exiting"
for i in /etc/apt/sources.list /etc/apt/sources.list.d/*.list ; do
[ -s "$i" ] || continue
# TODO: only for uncommended strings
#sed -i -r -e "s!$1/branch!$2/branch!g" $i
regexp_subst "/^ *#/! s!$1/branch!$2/branch!g" $i
# TODO: start with improve to [p8] - install some package firstly?
regexp_subst "/^ *#/! s s!\[$1\]![alt]/branch!g" $i
done
docmd apt-repo list
}
__update_alt_repo_to_next_distro()
{
case "$DISTRVERSION" in
# p7)
# ;;
p6)
__replace_alt_version_in_repo p6 p7
info "Run epm release-upgrade again for update to p8"
;;
p7)
__replace_alt_version_in_repo p7 p8
;;
*)
info "Have no idea how to update from $DISTRVERSION"
info "Have no idea how to update from $DISTRNAME $DISTRVERSION"
return 1
esac
}
epm_release_upgrade()
{
assure_root
info "Starting upgrade whole system to the next release"
info "Check also http://wiki.etersoft.ru/Admin/UpdateLinux"
case $PMTYPE in
apt-rpm)
case $DISTRNAME in
ALTLinux)
docmd epm update
docmd epm install apt rpm
pkg_filenames= epm_repofix
__update_alt_repo_to_next_distro || exit
docmd epm Upgrade
docmd epm update-kernel
return
;;
*)
;;
esac
case $PMTYPE in
apt-rpm)
docmd epm update
info "Have no idea how to upgrade $DISTRNAME"
;;
*-dpkg)
sudocmd do-release-upgrade -d
......@@ -85,5 +121,4 @@ epm_release_upgrade()
;;
esac
sudocmd $CMD $pkg_filenames
}
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