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
1ad3e100
Commit
1ad3e100
authored
Sep 01, 2021
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move save/restore repo to epm-reposave
parent
d4b3582a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
36 deletions
+41
-36
epm-release_upgrade
bin/epm-release_upgrade
+1
-29
epm-repo
bin/epm-repo
+0
-1
epm-reposave
bin/epm-reposave
+40
-6
No files found.
bin/epm-release_upgrade
View file @
1ad3e100
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
load_helper epm-query
load_helper epm-query
load_helper epm-repofix
load_helper epm-repofix
load_helper epm-reposave
assure_safe_run
()
assure_safe_run
()
{
{
...
@@ -64,35 +65,6 @@ assure_safe_run()
...
@@ -64,35 +65,6 @@ assure_safe_run()
}
}
SAVELISTDIR
=
/tmp/eepm-release_upgrade
__save_alt_repo_lists
()
{
info
"Creating copy of all sources lists to
$SAVELISTDIR
..."
local
i
rm
-rfv
$SAVELISTDIR
2>/dev/null
mkdir
-p
$SAVELISTDIR
/apt/
$SAVELISTDIR
/apt/sources.list.d/
for
i
in
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
;
do
[
-s
"
$i
"
]
||
continue
local
DD
=
"
$(
echo
"
$i
"
|
sed
-e
"s|/etc|
$SAVELISTDIR
|"
)
"
cp
-af
$verbose
"
$i
"
"
$DD
"
||
fatal
"Can't save apt source list files to
$SAVELISTDIR
"
done
}
__restore_alt_repo_lists
()
{
info
"Some error. Restoring copy of all sources lists from
$SAVELISTDIR
..."
local
i
[
-d
"
$SAVELISTDIR
/apt"
]
||
return
0
mkdir
-p
$SAVELISTDIR
/apt/
$SAVELISTDIR
/apt/sources.list.d/
for
i
in
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
;
do
[
-s
"
$i
"
]
||
continue
local
DD
=
"
$(
echo
"
$i
"
|
sed
-e
"s|/etc|
$SAVELISTDIR
|"
)
"
# restore only if there are differences
diff
-q
"
$DD
"
"
$i
"
>
/dev/null
||
continue
mv
$verbose
"
$DD
"
"
$i
"
||
warning
"Can't restore
$i
file"
done
}
__replace_text_in_alt_repo
()
__replace_text_in_alt_repo
()
{
{
local
i
local
i
...
...
bin/epm-repo
View file @
1ad3e100
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
load_helper epm-sh-altlinux
load_helper epm-sh-altlinux
# TODO: save/restore
epm_repo
()
epm_repo
()
{
{
local
CMD
=
"
$1
"
local
CMD
=
"
$1
"
...
...
bin/epm-reposave
View file @
1ad3e100
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2020 Etersoft
# Copyright (C) 2020
, 2021
Etersoft
# Copyright (C) 2020 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2020
, 2021
Vitaly Lipatov <lav@etersoft.ru>
#
#
# This program is free software: you can redistribute it and/or modify
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# it under the terms of the GNU Affero General Public License as published by
...
@@ -19,11 +19,44 @@
...
@@ -19,11 +19,44 @@
load_helper epm-sh-altlinux
load_helper epm-sh-altlinux
SAVELISTDIR
=
/tmp/eepm-etc-apt
__save_alt_repo_lists
()
{
info
"Creating copy of all sources lists to
$SAVELISTDIR
..."
local
i
rm
-rf
$verbose
$SAVELISTDIR
2>/dev/null
mkdir
-p
$SAVELISTDIR
/apt/
$SAVELISTDIR
/apt/sources.list.d/
for
i
in
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
;
do
[
-s
"
$i
"
]
||
continue
local
DD
=
"
$(
echo
"
$i
"
|
sed
-e
"s|/etc|
$SAVELISTDIR
|"
)
"
cp
-af
$verbose
"
$i
"
"
$DD
"
||
fatal
"Can't save apt source list files to
$SAVELISTDIR
"
done
}
__restore_alt_repo_lists
()
{
info
"Restoring copy of all sources lists from
$SAVELISTDIR
..."
local
i
[
-d
"
$SAVELISTDIR
/apt"
]
||
return
0
mkdir
-p
$SAVELISTDIR
/apt/
$SAVELISTDIR
/apt/sources.list.d/
for
i
in
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
;
do
[
-s
"
$i
"
]
||
continue
local
DD
=
"
$(
echo
"
$i
"
|
sed
-e
"s|/etc|
$SAVELISTDIR
|"
)
"
# restore only if there are differences
diff
-q
"
$DD
"
"
$i
"
>
/dev/null
||
continue
mv
$verbose
"
$DD
"
"
$i
"
||
warning
"Can't restore
$i
file"
done
}
epm_reposave
()
epm_reposave
()
{
{
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm
)
apt-
*
)
fatal
"TODO"
assure_root
__save_alt_repo_lists
;;
;;
*
)
*
)
fatal
"Have no suitable command for
$PMTYPE
"
fatal
"Have no suitable command for
$PMTYPE
"
...
@@ -35,8 +68,9 @@ esac
...
@@ -35,8 +68,9 @@ esac
epm_reporestore
()
epm_reporestore
()
{
{
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm
)
apt-
*
)
fatal
"TODO"
assure_root
__restore_alt_repo_lists
;;
;;
*
)
*
)
fatal
"Have no suitable command for
$PMTYPE
"
fatal
"Have no suitable command for
$PMTYPE
"
...
...
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