Commit 4cc5729d authored by Vitaly Lipatov's avatar Vitaly Lipatov

rewrite release-upgrade

parent a7829414
...@@ -268,7 +268,7 @@ check_command() ...@@ -268,7 +268,7 @@ check_command()
full-upgrade) # HELPCMD: update all system packages and kernel full-upgrade) # HELPCMD: update all system packages and kernel
epm_cmd=full_upgrade epm_cmd=full_upgrade
;; ;;
release-upgrade|upgrade-release|upgrade-system) # HELPCMD: update whole system to the release in arg (default: next (latest) release) release-upgrade|upgrade-release|upgrade-system|release-switch) # HELPCMD: upgrade/switch whole system to the release in arg (default: next (latest) release)
epm_cmd=release_upgrade epm_cmd=release_upgrade
;; ;;
kernel-update|kernel-upgrade|update-kernel|upgrade-kernel) # HELPCMD: update system kernel to the last repo version kernel-update|kernel-upgrade|update-kernel|upgrade-kernel) # HELPCMD: update system kernel to the last repo version
......
...@@ -29,12 +29,27 @@ __repofix_check_vendor() ...@@ -29,12 +29,27 @@ __repofix_check_vendor()
return 1 return 1
} }
__repofix_filter_vendor()
{
local br="$1"
br="$(echo "$br" | sed -e "s|\..*||")"
case $br in
c8)
br="cert8"
;;
c9)
br="cert9"
;;
esac
echo "$br"
}
# source-list vendor path # source-list vendor path
# example: /etc/apt/source.list p7 ALTLinux\/Sisyphus # example: /etc/apt/source.list p7 ALTLinux\/Sisyphus
__try_fix_apt_source_list() __try_fix_apt_source_list()
{ {
local list="$1" local list="$1"
local br="$2" local br="$(__repofix_filter_vendor "$2")"
local path="$3" local path="$3"
if grep -q -e "^[^#].*$path" $list ; then if grep -q -e "^[^#].*$path" $list ; then
if __repofix_check_vendor $br ; then if __repofix_check_vendor $br ; then
...@@ -49,8 +64,8 @@ __try_fix_apt_source_list() ...@@ -49,8 +64,8 @@ __try_fix_apt_source_list()
__fix_alt_sources_list() __fix_alt_sources_list()
{ {
# for beauty spaces # for beauty spaces
local SUBST_ALT_RULE1='s!^(.*)[/ ](ALTLinux|LINUX\@Etersoft)[/ ]*(Sisyphus)[/ ](x86_64|i586|x86_64-i586|noarch) !\1 \2/\3/\4 !gi' local SUBST_ALT_RULE1='s!^(.*)[/ ](ALTLinux|LINUX\@Etersoft)[/ ]*(Sisyphus)[/ ](x86_64|i586|x86_64-i586|noarch|aarch64) !\1 \2/\3/\4 !gi'
local SUBST_ALT_RULE2='s!^(.*)[/ ](ALTLinux|LINUX\@Etersoft)[/ ]*([tcp][6-9][/ ]branch|[tcp]1[012][/ ]branch)[/ ](x86_64|i586|x86_64-i586|noarch) !\1 \2/\3/\4 !gi' local SUBST_ALT_RULE2='s!^(.*)[/ ](ALTLinux|LINUX\@Etersoft)[/ ]*([tcp][6-9]\.?[0-9]?[/ ]branch|[tcp]1[012][/ ]branch)[/ ](x86_64|i586|x86_64-i586|noarch|aarch64) !\1 \2/\3/\4 !gi'
local i local i
assure_root assure_root
for i in "$@" ; do for i in "$@" ; do
......
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