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
3de98e80
Commit
3de98e80
authored
Jul 16, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-play: improve options parsing
parent
9cd80fc9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
31 deletions
+27
-31
epm-play
bin/epm-play
+26
-30
common.sh
play.d/common.sh
+1
-1
No files found.
bin/epm-play
View file @
3de98e80
...
@@ -40,25 +40,30 @@ __remove_installed_app()
...
@@ -40,25 +40,30 @@ __remove_installed_app()
return
0
return
0
}
}
__
check_installed_app
()
__
run_script
()
{
{
local
script
=
"
$psdir
/
$1
.sh"
local
script
=
"
$psdir
/
$1
.sh"
[
-x
"
$script
"
]
||
return
[
-x
"
$script
"
]
||
return
$script
--installed
shift
$script
"
$@
"
return
return
}
[
-s
$epm_vardir
/installed-app
]
||
return
1
__get_app_package
()
grep
-q
--
"^
$1
\$
"
$epm_vardir
/installed-app
{
__run_script
"
$1
"
--package-name
"
$2
"
2>/dev/null
}
}
__
get_app_version
()
__
check_installed_app
()
{
{
local
script
=
"
$psdir
/
$1
.sh"
__run_script
"
$1
"
--installed
"
$2
"
[
-x
"
$script
"
]
||
return
$script
--installed-version
return
return
[
-s
$epm_vardir
/installed-app
]
||
return
1
grep
-q
--
"^
$1
\$
"
$epm_vardir
/installed-app
}
}
__list_all_app
()
__list_all_app
()
{
{
for
i
in
$psdir
/
*
.sh
;
do
for
i
in
$psdir
/
*
.sh
;
do
...
@@ -101,19 +106,10 @@ __list_installed_app()
...
@@ -101,19 +106,10 @@ __list_installed_app()
cat
$epm_vardir
/installed-app 2>/dev/null
cat
$epm_vardir
/installed-app 2>/dev/null
}
}
__get_app_package
()
{
local
script
=
"
$psdir
/
$1
.sh"
[
-x
"
$script
"
]
||
return
$script
--package
2>/dev/null
}
__get_app_description
()
__get_app_description
()
{
{
local
script
=
"
$psdir
/
$1
.sh"
__run_script
"
$1
"
--description
2>/dev/null
[
-x
"
$script
"
]
||
return
$script
--description
2>/dev/null
}
}
__check_play_script
()
__check_play_script
()
...
@@ -262,23 +258,23 @@ fi
...
@@ -262,23 +258,23 @@ fi
if
[
"
$1
"
=
"--installed"
]
||
[
"
$1
"
=
"installed"
]
;
then
if
[
"
$1
"
=
"--installed"
]
||
[
"
$1
"
=
"installed"
]
;
then
shift
shift
__check_installed_app
"
$1
"
__check_installed_app
"
$1
"
"
$2
"
#[ -n "$quiet" ] && exit
#[ -n "$quiet" ] && exit
exit
exit
fi
fi
if
[
"
$1
"
=
"--installed-version"
]
||
[
"
$1
"
=
"installed-version"
]
;
then
# common internal options
shift
case
"
$1
"
in
__get_app_version
"
$1
"
"--installed-version"
|
"--package-name"
|
"--product-alternatives"
)
#[ -n "$quiet" ] && exit
__run_script
"
$2
"
"
$1
"
"
$3
"
exit
exit
fi
;;
"--help"
|
"help"
)
__run_script
"
$2
"
"
$1
"
"
$3
"
exit
;;
esac
if
[
"
$1
"
=
"--package-name"
]
||
[
"
$1
"
=
"package-name"
]
;
then
shift
__get_app_package
"
$1
"
exit
fi
if
[
"
$1
"
=
"--list"
]
||
[
"
$1
"
=
"--list-installed"
]
||
[
"
$1
"
=
"list"
]
||
[
"
$1
"
=
"list-installed"
]
;
then
if
[
"
$1
"
=
"--list"
]
||
[
"
$1
"
=
"--list-installed"
]
||
[
"
$1
"
=
"list"
]
||
[
"
$1
"
=
"list-installed"
]
;
then
__epm_play_list_installed
__epm_play_list_installed
...
...
play.d/common.sh
View file @
3de98e80
...
@@ -32,7 +32,7 @@ case "$1" in
...
@@ -32,7 +32,7 @@ case "$1" in
[
-n
"
$TIPS
"
]
&&
echo
"
$TIPS
"
[
-n
"
$TIPS
"
]
&&
echo
"
$TIPS
"
exit
exit
;;
;;
"--package"
)
"--package
-name
"
)
echo
"
$PKGNAME
"
echo
"
$PKGNAME
"
exit
exit
;;
;;
...
...
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