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
5c70c8c6
Commit
5c70c8c6
authored
Apr 15, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm play: refactoring
parent
7ffb0a31
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
69 deletions
+82
-69
epm-play
bin/epm-play
+79
-67
common.sh
play.d/common.sh
+3
-2
No files found.
bin/epm-play
View file @
5c70c8c6
...
@@ -340,20 +340,8 @@ __epm_play_install()
...
@@ -340,20 +340,8 @@ __epm_play_install()
return
$RES
return
$RES
}
}
__epm_play_initialize_ipfs
()
epm_play
()
{
{
[
"
$EPMMODE
"
=
"package"
-o
"
$EPMMODE
"
=
"git"
]
||
fatal
"epm play is not supported in single file mode"
local
psdir
=
"
$(
realpath
$CONFIGDIR
/play.d
)
"
local
prsdir
=
"
$(
realpath
$CONFIGDIR
/prescription.d
)
"
if
[
"
$1
"
=
"-h"
]
||
[
"
$1
"
=
"--help"
]
;
then
epm_play_help
exit
fi
if
[
"
$1
"
=
"--ipfs"
]
;
then
shift
if
[
-d
"
$(
dirname
"
$epm_ipfs_db
"
)
"
]
;
then
if
[
-d
"
$(
dirname
"
$epm_ipfs_db
"
)
"
]
;
then
export
EGET_IPFS_DB
=
"
$eget_ipfs_db
"
export
EGET_IPFS_DB
=
"
$eget_ipfs_db
"
if
[
!
-r
"
$EGET_IPFS_DB
"
]
;
then
if
[
!
-r
"
$EGET_IPFS_DB
"
]
;
then
...
@@ -367,87 +355,111 @@ if [ "$1" = "--ipfs" ] ; then
...
@@ -367,87 +355,111 @@ if [ "$1" = "--ipfs" ] ; then
else
else
warning
"ipfs db dir
$eget_ipfs_db
is not exists, skipping --ipfs"
warning
"ipfs db dir
$eget_ipfs_db
is not exists, skipping --ipfs"
fi
fi
fi
}
epm_play
()
{
[
"
$EPMMODE
"
=
"package"
-o
"
$EPMMODE
"
=
"git"
]
||
fatal
"epm play is not supported in single file mode"
local
psdir
=
"
$(
realpath
$CONFIGDIR
/play.d
)
"
local
prsdir
=
"
$(
realpath
$CONFIGDIR
/prescription.d
)
"
if
[
"
$1
"
=
"--remove"
]
||
[
"
$1
"
=
"remove"
]
;
then
if
[
-z
"
$1
"
]
;
then
shift
[
-n
"
$short
"
]
||
[
-n
"
$quiet
"
]
||
echo
"Available applications (for current arch
$(
$DISTRVENDOR
-a
)
):"
__epm_play_
remove
"
$@
"
__epm_play_
list
$psdir
exit
exit
fi
fi
if
[
"
$1
"
=
"--update"
]
;
then
while
[
-n
"
$1
"
]
;
do
shift
case
"
$1
"
in
local
CMDUPDATE
=
"--update"
-h
|
--help
)
[
-n
"
$force
"
]
&&
CMDUPDATE
=
"--run"
epm_play_help
exit
;;
if
[
-z
"
$1
"
]
;
then
--ipfs
)
fatal
"run --update with 'all' or a project name"
shift
fi
__epm_play_initialize_ipfs
;;
local
list
--remove
|
remove
)
if
[
"
$1
"
=
"all"
]
;
then
shift
shift
list
=
"
$(
__list_installed_app
)
"
__epm_play_remove
"
$@
"
else
exit
list
=
"
$*
"
;;
fi
__epm_play_update
$CMDUPDATE
$list
--update
)
exit
shift
local
CMDUPDATE
=
"--update"
[
-n
"
$force
"
]
&&
CMDUPDATE
=
"--run"
fi
if
[
-z
"
$1
"
]
;
then
fatal
"run --update with 'all' or a project name"
fi
if
[
"
$1
"
=
"--installed"
]
||
[
"
$1
"
=
"installed"
]
;
then
local
list
shift
if
[
"
$1
"
=
"all"
]
;
then
__is_app_installed
"
$1
"
"
$2
"
shift
#[ -n "$quiet" ] && exit
list
=
"
$(
__list_installed_app
)
"
exit
else
fi
list
=
"
$*
"
fi
__epm_play_update
$CMDUPDATE
$list
exit
;;
--installed
|
installed
)
shift
__is_app_installed
"
$1
"
"
$2
"
#[ -n "$quiet" ] && exit
exit
;;
case
"
$1
"
in
# internal options
# internal options
"--installed-version"
|
"--package-name"
|
"--product-alternatives"
)
--installed-version
|
--package-name
|
--product-alternatives
|
--info
)
__run_script
"
$2
"
"
$1
"
"
$3
"
__run_script
"
$2
"
"
$1
"
"
$3
"
exit
exit
;;
;;
"--list-installed-packages"
)
--list-installed-packages
)
__list_installed_packages
__list_installed_packages
exit
exit
;;
;;
"--list"
|
"--list-installed"
|
"list"
|
"list-installed"
)
--list
|
--list-installed
|
list|list-installed
)
__epm_play_list_installed
__epm_play_list_installed
exit
exit
;;
;;
# internal options
"--help"
|
"help"
)
--full-list-all
)
__run_script
"
$2
"
"
$1
"
"
$3
"
[
-n
"
$short
"
]
||
[
-n
"
$quiet
"
]
||
echo
"Available applications (for current arch
$(
$DISTRVENDOR
-a
)
):"
__epm_play_list
$psdir
extra
exit
exit
;;
;;
esac
if
[
"
$1
"
=
"--full-list-all"
]
;
then
--list-all
|
list-all
)
[
-n
"
$short
"
]
||
[
-n
"
$quiet
"
]
||
echo
"Available applications (for current arch
$(
$DISTRVENDOR
-a
)
):"
[
-n
"
$short
"
]
||
[
-n
"
$quiet
"
]
||
echo
"Available applications (for current arch
$(
$DISTRVENDOR
-a
)
):"
__epm_play_list
$psdir
extra
__epm_play_list
$psdir
exit
[
-n
"
$quiet
"
]
||
[
-n
"
$*
"
]
&&
exit
fi
echo
#echo "Run epm play --help for help"
if
[
"
$1
"
=
"--list-all"
]
||
[
"
$1
"
=
"list-all"
]
||
[
-z
"
$*
"
]
;
then
epm_play_help
[
-n
"
$short
"
]
||
[
-n
"
$quiet
"
]
||
echo
"Available applications (for current arch
$(
$DISTRVENDOR
-a
)
):"
exit
__epm_play_list
$psdir
;;
[
-n
"
$quiet
"
]
||
[
-n
"
$*
"
]
&&
exit
echo
#echo "Run epm play --help for help"
epm_play_help
exit
fi
if
[
"
$1
"
=
"--list-scripts"
]
||
[
"
$1
"
=
"list-scripts"
]
;
then
--list-scripts
|
list-scripts
)
[
-n
"
$short
"
]
||
[
-n
"
$quiet
"
]
||
echo
"Run with a name of a play script to run:"
[
-n
"
$short
"
]
||
[
-n
"
$quiet
"
]
||
echo
"Run with a name of a play script to run:"
__epm_play_list
$prsdir
__epm_play_list
$prsdir
exit
exit
fi
;;
-
*
)
fatal
"Unknown option
$1
"
;;
*
)
break
;;
esac
shift
done
__epm_play_install
$(
echo
"
$*
"
|
sed
-e
's|=| = |g'
)
__epm_play_install
$(
echo
"
$*
"
|
sed
-e
's|=| = |g'
)
}
}
play.d/common.sh
View file @
5c70c8c6
...
@@ -68,12 +68,13 @@ case "$1" in
...
@@ -68,12 +68,13 @@ case "$1" in
epm remove
$PKGNAME
epm remove
$PKGNAME
exit
exit
;;
;;
"--
help
"
)
"--
info
"
)
if
[
-n
"
$PRODUCTALT
"
]
;
then
if
[
-n
"
$PRODUCTALT
"
]
;
then
echo
"Help about additional parameters."
echo
"Help about additional parameters."
echo
"Use epm play
$(
basename
$0
.sh
)
[
$(
echo
"
$PRODUCTALT
"
|
sed
-e
's@ @|@g'
)
]"
echo
"Use epm play
$(
basename
$0
.sh
)
[
=
$(
echo
"
$PRODUCTALT
"
|
sed
-e
's@ @|@g'
)
]"
fi
fi
[
-n
"
$TIPS
"
]
&&
echo
"
$TIPS
"
[
-n
"
$TIPS
"
]
&&
echo
"
$TIPS
"
[
-n
"
$URL
"
]
&&
echo
"Url:
$URL
"
exit
exit
;;
;;
"--package-name"
)
"--package-name"
)
...
...
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