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
5e90e4bd
Commit
5e90e4bd
authored
Oct 12, 2015
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skip update checking for non root users have no nopassword sudo
parent
8ba99b83
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
epm-check_updated_repo
bin/epm-check_updated_repo
+7
-3
epm-search
bin/epm-search
+1
-1
No files found.
bin/epm-check_updated_repo
View file @
5e90e4bd
...
...
@@ -22,8 +22,7 @@ __is_repo_info_downloaded()
case
$PMTYPE
in
apt-
*
)
if
[
-r
/var/cache/apt
]
;
then
# FIXME: only if root permissions, now skip for user
test
-r
/var/cache/apt/pkgcache.bin
||
return
$SUDO
test
-r
/var/cache/apt/pkgcache.bin
||
return
fi
;;
*
)
...
...
@@ -38,7 +37,6 @@ __is_repo_info_uptodate()
apt-
*
)
if
$SUDO
[
-r
/var/lib/apt/lists
]
;
then
local
LOCKFILE
=
/var/lib/apt/lists/lock
# FIXME: only if root permissions, now skip for user
$SUDO
test
-r
$LOCKFILE
||
return
# if repo older than 1 day, return false
# find print string if file is obsoleted
...
...
@@ -53,6 +51,12 @@ __is_repo_info_uptodate()
update_repo_if_needed
()
{
# check if we need skip update checking
if
[
"
$1
"
=
"soft"
]
&&
[
-n
"
$SUDO
"
]
;
then
# if sudo requires a password, skip autoupdate
sudo
-n
true
2>/dev/null
||
{
info
"sudo requires a password, skip repo status checking"
;
return
0
;
}
fi
if
!
__is_repo_info_downloaded
||
!
__is_repo_info_uptodate
;
then
load_helper epm-update
epm_update
...
...
bin/epm-search
View file @
5e90e4bd
...
...
@@ -155,7 +155,7 @@ epm_search()
[
-n
"
$pkg_filenames
"
]
||
fatal
"Search: missing search argument(s)"
# it is useful for first time running
update_repo_if_needed
update_repo_if_needed
soft
# FIXME: do it better
local
MGS
...
...
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