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
f4051c4c
Commit
f4051c4c
authored
Feb 25, 2015
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit packed files
parent
a37be6cd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
18 deletions
+36
-18
epm.sh
packed/epm.sh
+23
-11
serv.sh
packed/serv.sh
+13
-7
No files found.
packed/epm.sh
View file @
f4051c4c
...
...
@@ -65,7 +65,7 @@ check_tty()
# egrep from busybox may not --color
# egrep from MacOS print help to stderr
if
egrep
--help
2>&1 |
grep
-q
--
"--color"
;
then
EGREPCOLOR
=
"--color"
export
EGREPCOLOR
=
"--color"
fi
which tput
>
/dev/null 2>/dev/null
||
return
...
...
@@ -264,8 +264,11 @@ set_sudo()
withtimeout
()
{
local
TO
=
$(
which
timeout
2>/dev/null
||
which gtimeout 2>/dev/null
)
[
-n
"
$TO
"
]
&&
$TO
$@
&&
return
# drop time arg
if
[
-x
"
$TO
"
]
;
then
$TO
$@
return
fi
# fallback: drop time arg and run without timeout
shift
$@
}
...
...
@@ -475,8 +478,6 @@ esac
# File bin/epm-assure:
__check_command_in_path
()
{
PATH
=
$PATH
:/sbin:/usr/sbin which
"
$1
"
2>/dev/null
...
...
@@ -499,6 +500,8 @@ __epm_assure()
# TODO: use package name normalization
info
"Installing appropriate package for
$1
command..."
load_helper epm-install
local
PACKAGE
=
"
$2
"
[
-n
"
$PACKAGE
"
]
||
PACKAGE
=
"
$1
"
#epm install $2
...
...
@@ -2172,7 +2175,6 @@ epm_query()
# File bin/epm-query_file:
__do_query_real_file
()
{
local
LINKTO1 LINKTO
...
...
@@ -2298,14 +2300,17 @@ epm_query_file()
# TODO: move to separate command?
# FIXME: it is possible use query
if
[
-n
"
$short
"
]
;
then
[
-n
"
$pkg_files
"
]
||
fatal
"Run query without file names (needed path to files)"
__do_short_query
$pkg_files
[
-n
"
$pkg_files
$pkg_dirs
"
]
||
fatal
"Run query without file names (needed path to files)"
__do_short_query
$pkg_files
$pkg_dirs
return
fi
# file can exists or not
[
-n
"
$pkg_filenames
"
]
||
fatal
"Run query without file names"
load_helper epm-search_file
for
pkg
in
$pkg_filenames
;
do
__do_query_real_file
"
$pkg
"
__do_query
$FULLFILEPATH
||
pkg_filenames
=
$FULLFILEPATH
epm_search_file
...
...
@@ -2666,7 +2671,7 @@ epm_removerepo()
case
$PMTYPE
in
apt-rpm
)
assure_exists apt-repo
sudocmd apt-repo
rm
"
$
pkg_filename
s
"
sudocmd apt-repo
rm
"
$
quoted_arg
s
"
;;
apt-dpkg|aptitude-dpkg
)
info
"You need remove repo from /etc/apt/sources.list"
...
...
@@ -3758,7 +3763,7 @@ $(get_help HELPOPT)
print_version
()
{
echo
"EPM package manager version 1.5.
8
"
echo
"EPM package manager version 1.5.
10
"
echo
"Running on
$(
$DISTRVENDOR
)
('
$PMTYPE
' package manager uses '
$PKGFORMAT
' package format)"
echo
"Copyright (c) Etersoft 2012-2014"
echo
"This program may be freely redistributed under the terms of the GNU AGPLv3."
...
...
@@ -3781,6 +3786,7 @@ skip_installed=
show_command_only
=
epm_cmd
=
pkg_files
=
pkg_dirs
=
pkg_names
=
pkg_urls
=
quoted_args
=
...
...
@@ -3791,6 +3797,9 @@ case $progname in
epmi
)
epm_cmd
=
install
;;
epmI
)
epm_cmd
=
Install
;;
epme
)
epm_cmd
=
remove
;;
...
...
@@ -4011,6 +4020,8 @@ check_filenames()
# files can be with full path or have extension via .
if
[
-f
"
$opt
"
]
&&
echo
"
$opt
"
|
grep
-q
"[/
\.
]"
;
then
pkg_files
=
"
$pkg_files
$opt
"
elif
[
-d
"
$opt
"
]
;
then
pkg_dirs
=
"
$pkg_dirs
$opt
"
elif
echo
"
$opt
"
|
grep
-q
"://"
;
then
pkg_urls
=
"
$pkg_names
$opt
"
else
...
...
@@ -4039,10 +4050,11 @@ if ! inputisatty ; then
fi
pkg_files
=
$(
strip_spaces
"
$pkg_files
"
)
pkg_dirs
=
$(
strip_spaces
"
$pkg_dirs
"
)
pkg_names
=
$(
strip_spaces
"
$pkg_names
"
)
pkg_urls
=
$(
strip_spaces
"
$pkg_urls
"
)
pkg_filenames
=
$(
strip_spaces
"
$pkg_files
$pkg_names
"
)
pkg_filenames
=
$(
strip_spaces
"
$pkg_files
$pkg_
dirs
$pkg_
names
"
)
# Just debug
#echover "command: $epm_cmd"
...
...
packed/serv.sh
View file @
f4051c4c
...
...
@@ -63,7 +63,7 @@ check_tty()
# egrep from busybox may not --color
# egrep from MacOS print help to stderr
if
egrep
--help
2>&1 |
grep
-q
--
"--color"
;
then
EGREPCOLOR
=
"--color"
export
EGREPCOLOR
=
"--color"
fi
which tput
>
/dev/null 2>/dev/null
||
return
...
...
@@ -262,8 +262,11 @@ set_sudo()
withtimeout
()
{
local
TO
=
$(
which
timeout
2>/dev/null
||
which gtimeout 2>/dev/null
)
[
-n
"
$TO
"
]
&&
$TO
$@
&&
return
# drop time arg
if
[
-x
"
$TO
"
]
;
then
$TO
$@
return
fi
# fallback: drop time arg and run without timeout
shift
$@
}
...
...
@@ -490,9 +493,11 @@ serv_enable()
case
$SERVICETYPE
in
service-chkconfig
)
sudocmd chkconfig
--add
$1
sudocmd chkconfig
--add
$1
||
return
sudocmd chkconfig
$1
on
;;
service-upstart
)
sudocmd chkconfig
--add
$1
||
return
sudocmd chkconfig
$1
on
;;
service-initd|service-update
)
...
...
@@ -616,10 +621,11 @@ is_service_autostart()
{
case
$SERVICETYPE
in
service-chkconfig|service-upstart
)
LANG
=
C
$SUDO
chkconfig
$1
--list
|
grep
-q
"5:on"
# FIXME: check for current runlevel
LANG
=
C
$SUDO
chkconfig
$1
--list
|
grep
-q
"[35]:on"
;;
service-initd|service-update
)
fatal
"FIXME: don't know how detect current startup state"
test
-L
$(
echo
/etc/rc5.d/S??
$1
)
;;
systemd
)
$SUDO
systemctl is-enabled
$1
...
...
@@ -1141,7 +1147,7 @@ $(get_help HELPOPT)
print_version
()
{
echo
"Service manager version 1.5.
8
"
echo
"Service manager version 1.5.
10
"
echo
"Running on
$(
$DISTRVENDOR
)
"
echo
"Copyright (c) Etersoft 2012, 2013"
echo
"This program may be freely redistributed under the terms of the GNU AGPLv3."
...
...
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