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
b2c4caff
Commit
b2c4caff
authored
Mar 27, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm play: improve list and description out
parent
7e33ee9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
13 deletions
+27
-13
epm-play
bin/epm-play
+27
-13
No files found.
bin/epm-play
View file @
b2c4caff
#!/bin/sh
#
# Copyright (C) 2015, 2017, 2019, 2020 Etersoft
# Copyright (C) 2015, 2017, 2019, 2020 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2015, 2017, 2019, 2020
, 2022
Etersoft
# Copyright (C) 2015, 2017, 2019, 2020
, 2022
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
...
...
@@ -20,6 +20,7 @@
# TODO
epm_vardir
=
/var/lib/eepm
__save_installed_app
()
{
[
-d
"
$epm_vardir
"
]
||
return
0
...
...
@@ -48,6 +49,11 @@ __list_installed_app()
cat
$epm_vardir
/installed-app 2>/dev/null
}
__get_app_description
()
{
[
-x
"
$1
"
]
||
return
$1
--description
2>/dev/null
}
__epm_play_run
()
{
...
...
@@ -89,6 +95,7 @@ EOF
exit
fi
if
[
"
$1
"
=
"--remove"
]
;
then
shift
#__check_installed_app "$1" || warning "$1 is not installed"
...
...
@@ -99,6 +106,7 @@ if [ "$1" = "--remove" ] ; then
exit
fi
if
[
"
$1
"
=
"--update"
]
;
then
shift
if
[
"
$1
"
=
"all"
]
;
then
...
...
@@ -111,7 +119,7 @@ if [ "$1" = "--update" ] ; then
exit
fi
if
[
-z
"
$1
"
]
;
then
fatal
"run --update with 'all' or project name"
fatal
"run --update with 'all' or
a
project name"
fi
__check_installed_app
"
$1
"
||
fatal
"
$1
is not installed"
prescription
=
"
$1
"
...
...
@@ -120,6 +128,7 @@ if [ "$1" = "--update" ] ; then
exit
fi
if
[
"
$1
"
=
"--list"
]
||
[
"
$1
"
=
"--installed"
]
;
then
shift
local
i
...
...
@@ -131,37 +140,42 @@ if [ "$1" = "--list" ] || [ "$1" = "--installed" ] ; then
fi
echo
"Installed:"
for
i
in
$(
__list_installed_app
)
;
do
printf
" %-20s - %s
\n
"
"
$i
"
"
$(
$psdir
/
$i
.sh
--description
2>/dev/null
)
"
local
desc
=
"
$(
__get_app_description
$psdir
/
$i
.sh
)
"
[
-n
"
$desc
"
]
||
continue
printf
" %-20s - %s
\n
"
"
$i
"
"
$desc
"
done
exit
fi
[
"(
$DISTRVENDOR
-a)"
=
"x86_64"
]
&&
IGNOREi586
=
''
||
IGNOREi586
=
1
[
"
$
(
$DISTRVENDOR
-a
)
"
=
"x86_64"
]
&&
IGNOREi586
=
''
||
IGNOREi586
=
1
if
[
"
$1
"
=
"--list-all"
]
||
[
-z
"
$*
"
]
;
then
echo
"Run with a name of a play script to run:"
local
i
local
desc
if
[
-n
"
$short
"
]
;
then
for
i
in
$psdir
/
*
.sh
;
do
# print all
#desc="$($i --description 2>/dev/null)"
#[ -z "$desc" ] && continue
local
name
=
$(
basename
$i
.sh
)
[
-n
"
$IGNOREi586
"
]
&&
rhas
"
$name
"
"^i586-"
&&
continue
rhas
"
$name
"
"^common"
&&
continue
echo
"
$name
"
done
exit
fi
echo
"Run with a name of a play script to run:"
for
i
in
$psdir
/
*
.sh
;
do
desc
=
"
$(
$i
--description
2>/dev/null
)
"
[
-
z
"
$desc
"
]
&&
continue
local
desc
=
"
$(
__get_app_description
$i
)
"
[
-
n
"
$desc
"
]
||
continue
local
name
=
$(
basename
$i
.sh
)
[
-n
"
$IGNOREi586
"
]
&&
rhas
"
$name
"
"^i586-"
&&
continue
rhas
"
$name
"
"^common"
&&
continue
printf
" %-20s - %s
\n
"
"
$name
"
"
$desc
"
done
echo
echo
"run epm play --list to list installed only, or --remove to remove one, or --update to update [all] installed apps"
echo
"run epm play"
echo
" --list - to list installed only"
echo
" --list-all (default) - to list all app"
echo
" --remove <app> - to remove app"
echo
" --update <app|all> - to update app or all installed apps"
echo
" --short (with --list) - list names only"
exit
fi
...
...
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