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
2deb3c37
Commit
2deb3c37
authored
Apr 15, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add confirm, assure_root, regexp_subst functions
parent
6aa42f5f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
epm-checksystem
bin/epm-checksystem
+1
-1
epm-sh-functions
bin/epm-sh-functions
+27
-0
No files found.
bin/epm-checksystem
View file @
2deb3c37
...
...
@@ -38,7 +38,7 @@ epm_checksystem_ALTLinux()
epm_checksystem
()
{
[
-n
"
$SUDO
"
]
||
fatal
"Do not use checksystem under root"
[
$EFFUID
=
"0"
]
&&
fatal
"Do not use checksystem under root"
case
$DISTRNAME
in
ALTLinux
)
...
...
bin/epm-sh-functions
View file @
2deb3c37
...
...
@@ -304,6 +304,33 @@ __get_package_for_command()
esac
}
# TODO:
confirm
()
{
local
response
# call with a prompt string or use a default
read
-r
-p
"
${
1
:-
Are
you sure? [y/N]
}
"
response
case
$response
in
[
yY][eE][sS]|[yY]
)
true
;;
*
)
false
;;
esac
}
assure_root
()
{
[
"
$EFFUID
"
=
0
]
||
fatal
"run me only under root"
}
regexp_subst
()
{
local
expression
=
"
$1
"
shift
sed
-i
-r
-e
"
$expression
"
"
$@
"
}
# TODO: we we can't use epm directly?
assure_exists
()
{
...
...
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