Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nurlan
eepm
Commits
98ce0d60
Commit
98ce0d60
authored
Nov 01, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-release_upgrade: drop signs if there are unknown vendor ID during update from repo
parent
8f2f68a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
17 deletions
+33
-17
epm-release_upgrade
bin/epm-release_upgrade
+33
-17
No files found.
bin/epm-release_upgrade
View file @
98ce0d60
...
@@ -81,22 +81,29 @@ __replace_alt_version_in_repo()
...
@@ -81,22 +81,29 @@ __replace_alt_version_in_repo()
docmd apt-repo list
docmd apt-repo list
}
}
__alt_replace_sign_name
()
{
local
TO
=
"
$1
"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
alt
\]
!
$TO
!g"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
sisyphus
\]
!
$TO
!g"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
updates
\]
!
$TO
!g"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
cert[789]
\]
!
$TO
!g"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
[tpc][6-9]
\.
?[0-9]?
\]
!
$TO
!g"
}
__alt_repofix
()
__alt_repofix
()
{
{
local
TO
=
"
$1
"
local
TO
=
"
$1
"
epm
--quiet
repo fix
>
/dev/null
epm
--quiet
repo fix
>
/dev/null
# TODO: switch it in repo code
TO
=
"
$(
__repofix_filter_vendor
"
$TO
"
)
"
# replace sign name
if
[
-n
"
$TO
"
]
;
then
if
[
-n
"
$TO
"
]
;
then
__replace_text_in_alt_repo
"/^ *#/! s!
\[
alt
\]
![
$TO
]!g"
# TODO: switch it in repo code
__replace_text_in_alt_repo
"/^ *#/! s!
\[
sisyphus
\]
![
$TO
]!g"
TO
=
"
$(
__repofix_filter_vendor
"
$TO
"
)
"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
updates
\]
![
$TO
]!g"
__alt_replace_sign_name
"[
$TO
]"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
[tpc][6-9]
\.
?[0-9]?
\]
![
$TO
]!g"
fi
fi
}
}
__get_conflict_release_pkg
()
__get_conflict_release_pkg
()
{
{
epm qf
--quiet
--short
/etc/fedora-release |
head
-n1
epm qf
--quiet
--short
/etc/fedora-release |
head
-n1
...
@@ -177,6 +184,15 @@ __check_system()
...
@@ -177,6 +184,15 @@ __check_system()
fi
fi
}
}
__epm_ru_update
()
{
docmd epm update
&&
return
epm update 2>&1 |
grep
"E: Unknown vendor ID"
||
return
info
"Drop vendor signs"
__alt_replace_sign_name
""
docmd epm update
}
get_next_release
()
get_next_release
()
{
{
local
FROM
=
"
$1
"
local
FROM
=
"
$1
"
...
@@ -214,7 +230,7 @@ __switch_alt_to_distro()
...
@@ -214,7 +230,7 @@ __switch_alt_to_distro()
confirm_info
"Upgrade
$DISTRNAME
from
$FROM
to
$TO
..."
confirm_info
"Upgrade
$DISTRNAME
from
$FROM
to
$TO
..."
docmd epm
install
rpm apt
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
docmd epm
install
rpm apt
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
__switch_repo_to
$TO
__switch_repo_to
$TO
docmd epm
update
||
fatal
__epm_ru_
update
||
fatal
docmd epm
install
rpm apt
"
$(
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"
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"
docmd epm update-kernel
docmd epm update-kernel
...
@@ -225,7 +241,7 @@ __switch_alt_to_distro()
...
@@ -225,7 +241,7 @@ __switch_alt_to_distro()
confirm_info
"Upgrade
$DISTRNAME
from
$FROM
to
$TO
..."
confirm_info
"Upgrade
$DISTRNAME
from
$FROM
to
$TO
..."
docmd epm
install
rpm apt
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
docmd epm
install
rpm apt
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
__switch_repo_to
$TO
__switch_repo_to
$TO
docmd epm
update
||
fatal
__epm_ru_
update
||
fatal
docmd epm
install
rpm apt
"
$(
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"
__check_system
__check_system
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"
...
@@ -236,7 +252,7 @@ __switch_alt_to_distro()
...
@@ -236,7 +252,7 @@ __switch_alt_to_distro()
confirm_info
"Upgrade
$DISTRNAME
from
$FROM
to
$TO
..."
confirm_info
"Upgrade
$DISTRNAME
from
$FROM
to
$TO
..."
docmd epm
install
rpm apt
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
docmd epm
install
rpm apt
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
__switch_repo_to
$TO
__switch_repo_to
$TO
docmd epm
update
||
fatal
__epm_ru_
update
||
fatal
docmd epm
install
rpm apt
"
$(
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"
__check_system
__check_system
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"
...
@@ -247,7 +263,7 @@ __switch_alt_to_distro()
...
@@ -247,7 +263,7 @@ __switch_alt_to_distro()
confirm_info
"Upgrade
$DISTRNAME
from
$FROM
to
$TO
..."
confirm_info
"Upgrade
$DISTRNAME
from
$FROM
to
$TO
..."
docmd epm
install
rpm apt
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
docmd epm
install
rpm apt
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
__switch_repo_to
$TO
__switch_repo_to
$TO
docmd epm
update
||
fatal
__epm_ru_
update
||
fatal
docmd epm
install
rpm apt
"
$(
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"
__check_system
__check_system
if
epm installed libcrypt
>
/dev/null
;
then
if
epm installed libcrypt
>
/dev/null
;
then
...
@@ -265,7 +281,7 @@ __switch_alt_to_distro()
...
@@ -265,7 +281,7 @@ __switch_alt_to_distro()
info
"Workaround for https://bugzilla.altlinux.org/show_bug.cgi?id=35492 ..."
info
"Workaround for https://bugzilla.altlinux.org/show_bug.cgi?id=35492 ..."
docmd epm remove gdb
||
fatal
docmd epm remove gdb
||
fatal
__switch_repo_to
$TO
__switch_repo_to
$TO
docmd epm
update
||
fatal
__epm_ru_
update
||
fatal
__check_system
__check_system
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"
docmd epm
install
rpm apt
"
$(
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"
...
@@ -276,7 +292,7 @@ __switch_alt_to_distro()
...
@@ -276,7 +292,7 @@ __switch_alt_to_distro()
confirm_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
__switch_repo_to
$TO
__switch_repo_to
$TO
docmd epm
update
||
fatal
__epm_ru_
update
||
fatal
docmd epm downgrade rpm apt
"
$(
get_fix_release_pkg
--force
"
$TO
"
)
"
||
fatal
"Check an error and run epm release-upgrade again"
docmd epm downgrade rpm apt
"
$(
get_fix_release_pkg
--force
"
$TO
"
)
"
||
fatal
"Check an error and run epm release-upgrade again"
__check_system
__check_system
if
epm installed libcrypt
>
/dev/null
;
then
if
epm installed libcrypt
>
/dev/null
;
then
...
@@ -291,7 +307,7 @@ __switch_alt_to_distro()
...
@@ -291,7 +307,7 @@ __switch_alt_to_distro()
confirm_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
__switch_repo_to
$TO
__switch_repo_to
$TO
docmd epm
update
||
fatal
__epm_ru_
update
||
fatal
docmd epm downgrade rpm apt
"
$(
get_fix_release_pkg
--force
"
$TO
"
)
"
||
fatal
"Check an error and run epm release-upgrade again"
docmd epm downgrade rpm apt
"
$(
get_fix_release_pkg
--force
"
$TO
"
)
"
||
fatal
"Check an error and run epm release-upgrade again"
__check_system
__check_system
#if epm installed libcrypt >/dev/null ; then
#if epm installed libcrypt >/dev/null ; then
...
@@ -306,7 +322,7 @@ __switch_alt_to_distro()
...
@@ -306,7 +322,7 @@ __switch_alt_to_distro()
confirm_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
__switch_repo_to
$TO
__switch_repo_to
$TO
docmd epm
update
||
fatal
__epm_ru_
update
||
fatal
docmd epm
install
rpm apt
"
$(
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"
__check_system
__check_system
docmd epm downgrade
docmd epm downgrade
...
@@ -319,7 +335,7 @@ __switch_alt_to_distro()
...
@@ -319,7 +335,7 @@ __switch_alt_to_distro()
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
"sisyphus"
__alt_repofix
"sisyphus"
docmd epm
update
||
fatal
__epm_ru_
update
||
fatal
docmd epm
install
rpm apt
"
$(
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"
#local ADDPKG
#local ADDPKG
#ADDPKG=$(epm -q --short make-initrd sssd-ad 2>/dev/null)
#ADDPKG=$(epm -q --short make-initrd sssd-ad 2>/dev/null)
...
@@ -353,7 +369,7 @@ epm_release_upgrade()
...
@@ -353,7 +369,7 @@ epm_release_upgrade()
case
$DISTRNAME
in
case
$DISTRNAME
in
ALTLinux
)
ALTLinux
)
docmd epm
update
||
fatal
__epm_ru_
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment