Commit d13689e5 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm release-upgrade: fixes

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