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