Commit 85ee0720 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-upgrade: separate epm_upgrade_alt_tasks() function

parent eb4679db
...@@ -37,43 +37,56 @@ __check_upgrade_conditions() ...@@ -37,43 +37,56 @@ __check_upgrade_conditions()
return 0 return 0
} }
epm_upgrade_alt_tasks()
epm_upgrade()
{ {
local CMD
# it is useful for first time running
update_repo_if_needed
warmup_bases
if [ "$BASEDISTRNAME" = "alt" ] ; then
load_helper epm-sh-altlinux
if tasknumber "$@" >/dev/null ; then
load_helper epm-addrepo load_helper epm-addrepo
load_helper epm-reposave load_helper epm-reposave
load_helper epm-removerepo load_helper epm-removerepo
load_helper epm-Install load_helper epm-Install
local installlist="$(get_task_packages $*)" local installlist="$(get_task_packages "$@")"
# hack: drop -devel packages to avoid package provided by multiple packages
installlist="$(estrlist reg_exclude ".*-devel .*-devel-static" "$installlist")"
[ -n "$verbose" ] && info "Packages from task(s): $installlist" [ -n "$verbose" ] && info "Packages from task(s): $installlist"
if [ -z "$full" ] ; then
# hack: drop -devel packages to avoid package provided by multiple packages
installlist="$(estrlist reg_exclude ".*-devel .*-devel-static .*-checkinstall .*-debuginfo" "$installlist")"
fi
# install only installed packages (simulate upgrade packages) # install only installed packages (simulate upgrade packages)
installlist="$(get_only_installed_packages "$installlist")" installlist="$(get_only_installed_packages "$installlist")"
[ -n "$verbose" ] && info "Packages to upgrade: $installlist" [ -n "$verbose" ] && info "Packages to upgrade: $installlist"
if [ -z "$installlist" ] ; then if [ -z "$installlist" ] ; then
warning 'There is no installed packages for upgrade from task $*' warning 'There is no installed packages for upgrade from task $*'
return 22 return 22
fi fi
local res
try_change_alt_repo try_change_alt_repo
epm_addrepo "$@" epm_addrepo "$@"
__epm_update __epm_update
(pkg_names="$installlist" epm_install) || fatal "Can't update repo" (pkg_names="$installlist" epm_install)
res=$?
epm_removerepo "$@" epm_removerepo "$@"
end_change_alt_repo end_change_alt_repo
return $res
}
epm_upgrade()
{
local CMD
# it is useful for first time running
update_repo_if_needed
warmup_bases
if [ "$BASEDISTRNAME" = "alt" ] ; then
load_helper epm-sh-altlinux
if tasknumber "$@" >/dev/null ; then
epm_upgrade_alt_tasks "$@"
return return
fi fi
......
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