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
8d7ee232
Commit
8d7ee232
authored
3 years ago
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce is_root and sudoepm (run epm under root)
parent
c970af23
master
3.32.0
3.29.0
3.28.5
3.27.0
3.26.10
3.23.0
3.22.3
3.22.2
3.22.1
3.21.8
3.19.4
3.18.6
3.17.3-alt1
3.17.0
3.16.1
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
epm-checksystem
bin/epm-checksystem
+1
-1
epm-sh-functions
bin/epm-sh-functions
+17
-7
No files found.
bin/epm-checksystem
View file @
8d7ee232
...
@@ -38,7 +38,7 @@ epm_checksystem_ALTLinux()
...
@@ -38,7 +38,7 @@ epm_checksystem_ALTLinux()
epm_checksystem
()
epm_checksystem
()
{
{
[
$EFFUID
=
"0"
]
&&
fatal
"Do not use checksystem under root"
is_root
&&
fatal
"Do not use checksystem under root"
case
$PMTYPE
in
case
$PMTYPE
in
homebrew
)
homebrew
)
...
...
This diff is collapsed.
Click to expand it.
bin/epm-sh-functions
View file @
8d7ee232
...
@@ -109,7 +109,7 @@ showcmd()
...
@@ -109,7 +109,7 @@ showcmd()
if
[
-z
"
$quiet
"
]
;
then
if
[
-z
"
$quiet
"
]
;
then
set_boldcolor
$GREEN
set_boldcolor
$GREEN
local
PROMTSIG
=
"
\$
"
local
PROMTSIG
=
"
\$
"
[
"
$EFFUID
"
=
0
]
&&
PROMTSIG
=
"#"
is_root
&&
PROMTSIG
=
"#"
echo
"
$PROMTSIG
$*
"
echo
"
$PROMTSIG
$*
"
restore_color
restore_color
fi
>
&2
fi
>
&2
...
@@ -257,7 +257,14 @@ clean_store_output()
...
@@ -257,7 +257,14 @@ clean_store_output()
epm
()
epm
()
{
{
[
-n
"
$PROGNAME
"
]
||
fatal
"Can't use epm call from the piped script"
[
-n
"
$PROGNAME
"
]
||
fatal
"Can't use epm call from the piped script"
$PROGDIR
/
$PROGNAME
--inscript
$@
$PROGDIR
/
$PROGNAME
--inscript
"
$@
"
}
# run $SUDO epm, possible from side repo
sudoepm
()
{
[
-n
"
$PROGNAME
"
]
||
fatal
"Can't use epm call from the piped script"
sudorun
$PROGDIR
/
$PROGNAME
--inscript
"
$@
"
}
}
# Print error message and stop the program
# Print error message and stop the program
...
@@ -313,10 +320,8 @@ set_sudo()
...
@@ -313,10 +320,8 @@ set_sudo()
return
return
fi
fi
EFFUID
=
$(
id
-u
)
# if we are root, do not need sudo
# if we are root, do not need sudo
[
$EFFUID
=
"0"
]
&&
return
is_root
&&
return
# start error section
# start error section
SUDO_TESTED
=
"1"
SUDO_TESTED
=
"1"
...
@@ -412,10 +417,15 @@ confirm_info()
...
@@ -412,10 +417,15 @@ confirm_info()
}
}
is_root
()
{
local
EFFUID
=
"
$(
id
-u
)
"
[
"
$EFFUID
"
=
"0"
]
}
assure_root
()
assure_root
()
{
{
set_sudo
is_root
||
fatal
"run me only under root"
[
"
$EFFUID
"
=
0
]
||
fatal
"run me only under root"
}
}
regexp_subst
()
regexp_subst
()
...
...
This diff is collapsed.
Click to expand it.
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