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
c58a5222
Commit
c58a5222
authored
Sep 04, 2021
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm reposave: fix run under user
parent
8d7ee232
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
epm-reposave
bin/epm-reposave
+22
-4
No files found.
bin/epm-reposave
View file @
c58a5222
...
@@ -20,9 +20,11 @@
...
@@ -20,9 +20,11 @@
load_helper epm-sh-altlinux
load_helper epm-sh-altlinux
# under root only
SAVELISTDIR
=
/tmp/eepm-etc-save
SAVELISTDIR
=
/tmp/eepm-etc-save
__save_alt_repo_lists
()
__save_alt_repo_lists
()
{
{
assure_root
info
"Creating copy of all sources lists to
$SAVELISTDIR
..."
info
"Creating copy of all sources lists to
$SAVELISTDIR
..."
local
i
local
i
rm
-rf
$verbose
$SAVELISTDIR
2>/dev/null
rm
-rf
$verbose
$SAVELISTDIR
2>/dev/null
...
@@ -34,8 +36,10 @@ __save_alt_repo_lists()
...
@@ -34,8 +36,10 @@ __save_alt_repo_lists()
done
done
}
}
# under root only
__restore_alt_repo_lists
()
__restore_alt_repo_lists
()
{
{
assure_root
info
"Restoring copy of all sources lists from
$SAVELISTDIR
..."
info
"Restoring copy of all sources lists from
$SAVELISTDIR
..."
local
i
local
i
[
-d
"
$SAVELISTDIR
/apt"
]
||
return
0
[
-d
"
$SAVELISTDIR
/apt"
]
||
return
0
...
@@ -52,10 +56,17 @@ __restore_alt_repo_lists()
...
@@ -52,10 +56,17 @@ __restore_alt_repo_lists()
done
done
}
}
# save and restore repo lists
__on_error_restore_alt_repo_lists
()
{
warning
"An error occurred..."
epm repo restore
}
try_change_alt_repo
()
try_change_alt_repo
()
{
{
__save_alt_repo_lists
epm repo save
trap
__restore_alt_repo_lists EXIT
trap
__
on_error_
restore_alt_repo_lists EXIT
}
}
end_change_alt_repo
()
end_change_alt_repo
()
...
@@ -64,11 +75,15 @@ end_change_alt_repo()
...
@@ -64,11 +75,15 @@ end_change_alt_repo()
}
}
epm_reposave
()
epm_reposave
()
{
{
case
$PMTYPE
in
case
$PMTYPE
in
apt-
*
)
apt-
*
)
assure_root
if
!
is_root
;
then
sudoepm repo save
return
fi
__save_alt_repo_lists
__save_alt_repo_lists
;;
;;
*
)
*
)
...
@@ -82,7 +97,10 @@ epm_reporestore()
...
@@ -82,7 +97,10 @@ epm_reporestore()
{
{
case
$PMTYPE
in
case
$PMTYPE
in
apt-
*
)
apt-
*
)
assure_root
if
!
is_root
;
then
sudoepm repo restore
return
fi
__restore_alt_repo_lists
__restore_alt_repo_lists
;;
;;
*
)
*
)
...
...
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