Commit d13689e5 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm release-upgrade: fixes

parent da7aa866
...@@ -123,11 +123,8 @@ get_fix_release_pkg() ...@@ -123,11 +123,8 @@ get_fix_release_pkg()
if [ "$TO" = "Sisyphus" ] ; then if [ "$TO" = "Sisyphus" ] ; then
TO="sisyphus" TO="sisyphus"
echo "apt-conf-$TO" echo "apt-conf-$TO"
elif [ "$TO" = "p10" ] ; then
true
#echo "apt-conf-$TO"
else else
epmqp apt-conf-branch >/dev/null 2>/dev/null || echo "apt-conf-branch" epm installed apt-conf-branch && echo "apt-conf-branch"
fi fi
if [ "$FORCE" == "--force" ] ; then if [ "$FORCE" == "--force" ] ; then
...@@ -149,11 +146,15 @@ get_fix_release_pkg() ...@@ -149,11 +146,15 @@ get_fix_release_pkg()
# workaround against obsoleted altlinux-release-sisyphus package from 2008 year # workaround against obsoleted altlinux-release-sisyphus package from 2008 year
[ "$TOINSTALL" = "altlinux-release-sisyphus" ] && TOINSTALL="branding-alt-sisyphus-release" [ "$TOINSTALL" = "altlinux-release-sisyphus" ] && TOINSTALL="branding-alt-sisyphus-release"
# update if installed (just print package name here to include in the install list) if epm installed etersoft-gpgkeys ; then
epm --quiet --short installed alt-gpgkeys 2>/dev/null # TODO: we don't support LINUX@Etersoft for now
if epm --quiet --short -q etersoft-gpgkeys 2>/dev/null >/dev/null ; then
# leave etersoft-gpgkeys only if we have LINUX@Etersoft repo # leave etersoft-gpgkeys only if we have LINUX@Etersoft repo
epm rl | grep -q "LINUX@Etersoft" && echo etersoft-gpgkeys || echo alt-gpgkeys #epm repo list | grep -q "LINUX@Etersoft" && echo "etersoft-gpgkeys" || echo "alt-gpgkeys"
epm --quiet repo comment "LINUX@Etersoft"
echo "alt-gpgkeys"
else
# update if installed (just print package name here to include in the install list)
epm query --short alt-gpgkeys 2>/dev/null
fi fi
if [ -n "$TOINSTALL" ] ; then if [ -n "$TOINSTALL" ] ; then
......
...@@ -47,7 +47,7 @@ __epm_removerepo_alt_grepremove() ...@@ -47,7 +47,7 @@ __epm_removerepo_alt_grepremove()
__epm_removerepo_alt() __epm_removerepo_alt()
{ {
local repo="$*" local repo="$*"
[ -n "$repo" ] || fatal "No such repo or task. Use epm repo remove <autoimports|archive|tasks|TASKNUMBER>" [ -n "$repo" ] || fatal "No such repo or task. Use epm repo remove <regexp|autoimports|archive|tasks|TASKNUMBER>"
assure_exists apt-repo assure_exists apt-repo
......
...@@ -79,7 +79,7 @@ EOF ...@@ -79,7 +79,7 @@ EOF
epm_addrepo "$@" epm_addrepo "$@"
epm update epm update
;; ;;
rm|remove) # HELPCMD: remove repository from sources list (epm repo remove all for all) rm|remove) # HELPCMD: remove repository from the sources lists (epm repo remove all for all)
load_helper epm-removerepo load_helper epm-removerepo
epm_removerepo "$@" epm_removerepo "$@"
;; ;;
......
...@@ -25,6 +25,8 @@ __replace_text_in_alt_repo() ...@@ -25,6 +25,8 @@ __replace_text_in_alt_repo()
local i local i
for i in /etc/apt/sources.list /etc/apt/sources.list.d/*.list ; do for i in /etc/apt/sources.list /etc/apt/sources.list.d/*.list ; do
[ -s "$i" ] || continue [ -s "$i" ] || continue
# TODO: don't change file if untouched
#grep -q -- "$1" "$i" || continue
regexp_subst "$1" "$i" regexp_subst "$1" "$i"
done done
} }
...@@ -60,7 +62,7 @@ __replace_alt_version_in_repo() ...@@ -60,7 +62,7 @@ __replace_alt_version_in_repo()
local i local i
assure_exists apt-repo assure_exists apt-repo
#echo "Upgrading $DISTRNAME from $1 to $2 ..." #echo "Upgrading $DISTRNAME from $1 to $2 ..."
a='' apt-repo list | sed -e "s|\($1\)|{\1}->{$2}|g" | grep -E --color -- "$1" a='' apt-repo list | sed -E -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
__replace_text_in_alt_repo "/^ *#/! s!$1!$2!g" __replace_text_in_alt_repo "/^ *#/! s!$1!$2!g"
...@@ -83,7 +85,6 @@ __alt_repofix() ...@@ -83,7 +85,6 @@ __alt_repofix()
{ {
local TO="$1" local TO="$1"
epm --quiet repo fix >/dev/null epm --quiet repo fix >/dev/null
if [ -n "$TO" ] ; then if [ -n "$TO" ] ; then
# TODO: switch it in repo code # TODO: switch it in repo code
TO="$(__repofix_filter_vendor "$TO")" TO="$(__repofix_filter_vendor "$TO")"
...@@ -98,8 +99,12 @@ epm_reposwitch() ...@@ -98,8 +99,12 @@ epm_reposwitch()
[ -n "$TO" ] || fatal "run repo switch with arg (p9, p10, Sisyphus)" [ -n "$TO" ] || fatal "run repo switch with arg (p9, p10, Sisyphus)"
__replace_alt_version_in_repo "Sisyphus/" "$TO/branch/" __replace_alt_version_in_repo "Sisyphus/" "$TO/branch/"
__replace_alt_version_in_repo "[tpc][5-9]\.?[0-9]?/branch/" "$TO/branch/" __replace_alt_version_in_repo "[tpc][5-9]\.?[0-9]?/branch/" "$TO/branch/"
if [ "$TO" != "p10" ] ; then
__replace_alt_version_in_repo "p10\.?[0-9]?/branch/" "$TO/branch/" __replace_alt_version_in_repo "p10\.?[0-9]?/branch/" "$TO/branch/"
__alt_repofix $TO fi
__alt_repofix "$TO"
if [ "$TO" = "p10" ] ; then if [ "$TO" = "p10" ] ; then
echo '%_priority_distbranch p10' >/etc/rpm/macros.d/p10 echo '%_priority_distbranch p10' >/etc/rpm/macros.d/p10
else else
......
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