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
etersoft
eepm
Commits
bcbac961
Commit
bcbac961
authored
Dec 01, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
release_upgrade: ask confirm before upgrade
parent
fdfa57a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
epm-release_upgrade
bin/epm-release_upgrade
+15
-7
No files found.
bin/epm-release_upgrade
View file @
bcbac961
...
...
@@ -19,6 +19,15 @@
load_helper epm-query
confirm_info
()
{
info
"
$*
"
if
[
-z
"
$non_interactive
"
]
;
then
confirm
"Are you sure? [y/N]"
||
fatal
"Exiting"
fi
}
__replace_text_in_alt_repo
()
{
local
i
...
...
@@ -66,7 +75,6 @@ __replace_alt_version_in_repo()
docmd apt-repo list |
sed
-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
confirm
"Are these correct changes? [y/N]"
||
fatal
"Exiting"
__replace_text_in_alt_repo
"/^ *#/! s!
$1
!
$2
!g"
fi
docmd apt-repo list
...
...
@@ -173,7 +181,7 @@ __update_alt_to_next_distro()
case
"
$*
"
in
"p6"
|
"p6 p7"
|
"t6 p7"
|
"c6 c7"
)
TO
=
"p7"
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
__replace_alt_version_in_repo
"
$FROM
/branch/"
"
$TO
/branch/"
__update_to_the_distro
"
$TO
"
...
...
@@ -183,7 +191,7 @@ __update_alt_to_next_distro()
;;
"p7"
|
"p7 p8"
|
"t7 p8"
|
"c7 c8"
|
"p8 p8"
)
TO
=
"p8"
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
__replace_alt_version_in_repo
$FROM
/branch/
$TO
/branch/
__update_to_the_distro
$TO
...
...
@@ -192,7 +200,7 @@ __update_alt_to_next_distro()
;;
"Sisyphus p8"
)
TO
=
"p8"
info
"Downgrade
$DISTRNAME
from
$FROM
to
$TO
..."
confirm_
info
"Downgrade
$DISTRNAME
from
$FROM
to
$TO
..."
docmd epm
install
"
$(
get_fix_release_pkg
"
$FROM
"
)
"
||
fatal
__replace_alt_version_in_repo
"
$FROM
/"
"
$TO
/branch/"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
alt
\]
![
$TO
]!g"
...
...
@@ -202,7 +210,7 @@ __update_alt_to_next_distro()
;;
"p8 Sisyphus"
|
"Sisyphus Sisyphus"
)
TO
=
"Sisyphus"
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 upgrade
||
fatal
__replace_alt_version_in_repo
"
$FROM
/branch/"
"
$TO
/"
...
...
@@ -235,7 +243,7 @@ epm_release_upgrade()
case
$DISTRNAME
in
ALTLinux
)
docmd epm update
docmd epm update
||
fatal
# try to detect current release by repo
if
[
"
$DISTRVERSION
"
=
"Sisyphus"
]
||
[
-z
"
$DISTRVERSION
"
]
;
then
...
...
@@ -287,7 +295,7 @@ epm_release_upgrade()
local
RELEASEVER
=
"
$pkg_filenames
"
[
-n
"
$RELEASEVER
"
]
||
RELEASEVER
=
$((
$DISTRVERSION
+
1
))
#[ -n "$RELEASEVER" ] || fatal "Run me with new version"
info
"Upgrade to
$DISTRNAME
/
$RELEASEVER
"
confirm_
info
"Upgrade to
$DISTRNAME
/
$RELEASEVER
"
sudocmd dnf system-upgrade download
--refresh
--releasever
=
$RELEASEVER
# TODO: from docs:
# dnf system-upgrade reboot
...
...
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