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
c89a8552
Commit
c89a8552
authored
Feb 22, 2014
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add epm assure for check if command is exists
parent
46e5b729
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
0 deletions
+65
-0
epm
bin/epm
+3
-0
epm-assure
bin/epm-assure
+62
-0
No files found.
bin/epm
View file @
c89a8552
...
@@ -198,6 +198,9 @@ check_command()
...
@@ -198,6 +198,9 @@ check_command()
programs
)
# HELPCMD: list of installed GUI program(s)
programs
)
# HELPCMD: list of installed GUI program(s)
epm_cmd
=
programs
epm_cmd
=
programs
;;
;;
assure
)
# HELPCMD: <command> <package>: install package if command does not exists
epm_cmd
=
assure
;;
# Repository control
# Repository control
update
)
# HELPCMD: update remote package repository databases
update
)
# HELPCMD: update remote package repository databases
...
...
bin/epm-assure
0 → 100644
View file @
c89a8552
#!/bin/sh
#
# Copyright (C) 2013, 2014 Etersoft
# Copyright (C) 2013, 2014 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
load_helper epm-install
__check_command_in_path
()
{
PATH
=
$PATH
:/sbin:/usr/sbin which
"
$1
"
2>/dev/null
}
# Do fast checking for command and install package if the command does not exist
# $1 - command name
# $2 - package name
__epm_assure
()
{
if
__check_command_in_path
"
$1
"
>
/dev/null
;
then
if
[
-n
"
$verbose
"
]
;
then
local
compath
=
"
$(
__check_command_in_path
"
$1
"
)
"
echo
"Command
$1
is exists:
$compath
"
epm qf
"
$compath
"
fi
return
fi
# TODO: use package name normalization
echo
"Install appropriate package for
$1
command..."
#epm install $2
# copied from epm_install
local
names
=
"
$(
echo
$2
| filter_out_installed_packages
)
"
non_interactive
=
1 epm_install_names
$names
}
epm_assure
()
{
[
-n
"
$pkg_filenames
"
]
||
fatal
"Run assure without params"
# use helper func for extract separate params
__epm_assure
$pkg_filenames
}
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