Commit b05e3737 authored by Vitaly Lipatov's avatar Vitaly Lipatov

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

parents 7cc72170 8e0da767
......@@ -349,7 +349,7 @@ check_option()
# TODO: how to read arg?
sort="$1"
;;
--auto) # HELPOPT: non interactive mode
--auto|--non-interactive) # HELPOPT: non interactive mode
non_interactive=1
;;
*)
......
......@@ -19,6 +19,15 @@
load_helper epm-query
confirm_info()
{
info "$*"
if [ -z "$non_interactive" ] ; then
confirm "Are you sure? [y/N]" || fatal "Exiting"
fi
}
__replace_text_in_alt_repo()
{
local i
......@@ -66,7 +75,6 @@ __replace_alt_version_in_repo()
docmd apt-repo list | sed -e "s|\($1\)|{\1}->{$2}|g" | grep -E --color -- "$1"
# ask and replace only we will have changes
if a='' apt-repo list | grep -E -q -- "$1" ; then
confirm "Are these correct changes? [y/N]" || fatal "Exiting"
__replace_text_in_alt_repo "/^ *#/! s!$1!$2!g"
fi
docmd apt-repo list
......@@ -97,8 +105,6 @@ get_fix_release_pkg()
local TO="$1"
echo "rpm apt"
if [ "$TO" = "Sisyphus" ] ; then
TO="sisyphus"
echo "apt-conf-$TO"
......@@ -138,7 +144,7 @@ __update_to_the_distro()
case "$TO" in
p7)
docmd epm update || fatal
docmd epm install "$(get_fix_release_pkg --force "$TO")" || fatal "Check an error and run epm release-upgrade again"
docmd epm install rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check an error and run epm release-upgrade again"
__alt_repofix
__replace_text_in_alt_repo "/^ *#/! s!\[updates\]![$TO]!g"
docmd epm update || fatal
......@@ -146,7 +152,7 @@ __update_to_the_distro()
;;
p8)
docmd epm update || fatal
docmd epm install "$(get_fix_release_pkg --force "$TO")" || fatal "Check an error and run epm release-upgrade again"
docmd epm install rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check an error and run epm release-upgrade again"
__alt_repofix
__replace_text_in_alt_repo "/^ *#/! s!\[updates\]![$TO]!g"
docmd epm update || fatal
......@@ -158,7 +164,7 @@ __update_to_the_distro()
;;
Sisyphus)
docmd epm update || fatal
docmd epm install librpm7 librpm "$(get_fix_release_pkg --force "$TO")" || fatal "Check an error and run again"
docmd epm install librpm7 librpm rpm apt "$(get_fix_release_pkg --force "$TO")" || fatal "Check an error and run again"
docmd epm upgrade || fatal "Check an error and run epm release-upgrade again"
;;
*)
......@@ -175,8 +181,8 @@ __update_alt_to_next_distro()
case "$*" in
"p6"|"p6 p7"|"t6 p7"|"c6 c7")
TO="p7"
info "Upgrade $DISTRNAME from $FROM to $TO ..."
docmd epm install "$(get_fix_release_pkg "$FROM")" || fatal
confirm_info "Upgrade $DISTRNAME from $FROM to $TO ..."
docmd epm install rpm apt "$(get_fix_release_pkg "$FROM")" || fatal
__replace_alt_version_in_repo "$FROM/branch/" "$TO/branch/"
__update_to_the_distro "$TO"
docmd epm update-kernel
......@@ -185,8 +191,8 @@ __update_alt_to_next_distro()
;;
"p7"|"p7 p8"|"t7 p8"|"c7 c8"|"p8 p8")
TO="p8"
info "Upgrade $DISTRNAME from $FROM to $TO ..."
docmd epm install "$(get_fix_release_pkg "$FROM")" || fatal
confirm_info "Upgrade $DISTRNAME from $FROM to $TO ..."
docmd epm install rpm apt "$(get_fix_release_pkg "$FROM")" || fatal
__replace_alt_version_in_repo $FROM/branch/ $TO/branch/
__update_to_the_distro $TO
docmd epm update-kernel || fatal
......@@ -194,9 +200,9 @@ __update_alt_to_next_distro()
;;
"Sisyphus p8")
TO="p8"
info "Downgrade $DISTRNAME from $FROM to $TO ..."
confirm_info "Downgrade $DISTRNAME from $FROM to $TO ..."
docmd epm install "$(get_fix_release_pkg "$FROM")" || fatal
__replace_alt_version_in_repo "$FROM/" "$FROM/branch/"
__replace_alt_version_in_repo "$FROM/" "$TO/branch/"
__replace_text_in_alt_repo "/^ *#/! s!\[alt\]![$TO]!g"
__update_to_the_distro $TO
docmd epm downgrade || fatal
......@@ -204,8 +210,8 @@ __update_alt_to_next_distro()
;;
"p8 Sisyphus"|"Sisyphus Sisyphus")
TO="Sisyphus"
info "Upgrade $DISTRNAME from $FROM to $TO ..."
docmd epm install "$(get_fix_release_pkg "$FROM")" || fatal
confirm_info "Upgrade $DISTRNAME from $FROM to $TO ..."
docmd epm install rpm apt "$(get_fix_release_pkg "$FROM")" || fatal
docmd epm upgrade || fatal
__replace_alt_version_in_repo "$FROM/branch/" "$TO/"
__alt_repofix
......@@ -237,7 +243,7 @@ epm_release_upgrade()
case $DISTRNAME in
ALTLinux)
docmd epm update
docmd epm update || fatal
# try to detect current release by repo
if [ "$DISTRVERSION" = "Sisyphus" ] || [ -z "$DISTRVERSION" ] ; then
......@@ -285,12 +291,15 @@ epm_release_upgrade()
docmd epm install dnf
sudocmd dnf clean all
assure_exists dnf-plugin-system-upgrade
sudocmd dnf system-upgrade
sudocmd dnf upgrade --refresh
local RELEASEVER="$pkg_filenames"
[ -n "$RELEASEVER" ] || RELEASEVER=$(($DISTRVERSION + 1))
#[ -n "$RELEASEVER" ] || fatal "Run me with new version"
info "Upgrate to $DISTRNAME/$RELEASEVER"
confirm_info "Upgrade to $DISTRNAME/$RELEASEVER"
sudocmd dnf system-upgrade download --refresh --releasever=$RELEASEVER
# TODO: from docs:
# dnf system-upgrade reboot
# FIXME: download all packages again
sudocmd dnf distro-sync --releasever=$RELEASEVER
info "Run epm autoorphans to remove orphaned packages"
;;
......
......@@ -173,6 +173,9 @@ epm_remove_nonint()
yum-rpm)
sudocmd yum -y remove $@
return ;;
dnf-rpm)
sudocmd dnf remove --assumeyes $@
return ;;
zypper-rpm)
sudocmd zypper --non-interactive remove --clean-deps $@
return ;;
......
# This spec is backported to ALTLinux p8 automatically by rpmbph script from etersoft-build-utils.
#
Name: eepm
Version: 2.3.1
Version: 2.3.2
Release: alt0.M80P.1
Summary: Etersoft EPM package manager
......@@ -73,9 +73,16 @@ rm -f %buildroot%_datadir/%name/tools_eget
%_sysconfdir/bash_completion.d/cerv
%changelog
* Sun Nov 19 2017 Vitaly Lipatov <lav@altlinux.ru> 2.3.1-alt0.M80P.1
* Fri Dec 01 2017 Vitaly Lipatov <lav@altlinux.ru> 2.3.2-alt0.M80P.1
- backport to ALTLinux p8 (by rpmbph script)
* Fri Dec 01 2017 Vitaly Lipatov <lav@altlinux.ru> 2.3.2-alt1
- fix --auto remove for dnf
- release_upgrade: do not update rpm apt when downgraded from Sisyphus
- release_upgrade: fix downgrade to p8
- release_upgrade: ask confirm before upgrade
- epm: add --non-interactive alias for --auto
* Sun Nov 19 2017 Vitaly Lipatov <lav@altlinux.ru> 2.3.1-alt1
- epm whatdepends: use rdepends
- repofix: fix signing when we have /
......
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