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()
return
$RES
}
epm_play
()
__epm_play_initialize_ipfs
()
{
[
"
$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
export
EGET_IPFS_DB
=
"
$eget_ipfs_db
"
if
[
!
-r
"
$EGET_IPFS_DB
"
]
;
then
...
...
@@ -367,87 +355,111 @@ if [ "$1" = "--ipfs" ] ; then
else
warning
"ipfs db dir
$eget_ipfs_db
is not exists, skipping --ipfs"
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
shift
__epm_play_
remove
"
$@
"
if
[
-z
"
$1
"
]
;
then
[
-n
"
$short
"
]
||
[
-n
"
$quiet
"
]
||
echo
"Available applications (for current arch
$(
$DISTRVENDOR
-a
)
):"
__epm_play_
list
$psdir
exit
fi
if
[
"
$1
"
=
"--update"
]
;
then
shift
local
CMDUPDATE
=
"--update"
[
-n
"
$force
"
]
&&
CMDUPDATE
=
"--run"
while
[
-n
"
$1
"
]
;
do
case
"
$1
"
in
-h
|
--help
)
epm_play_help
exit
;;
if
[
-z
"
$1
"
]
;
then
fatal
"run --update with 'all' or a project name"
fi
--ipfs
)
shift
__epm_play_initialize_ipfs
;;
local
list
if
[
"
$1
"
=
"all"
]
;
then
--remove
|
remove
)
shift
list
=
"
$(
__list_installed_app
)
"
else
list
=
"
$*
"
fi
__epm_play_remove
"
$@
"
exit
;;
__epm_play_update
$CMDUPDATE
$list
exit
--update
)
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
shift
__is_app_installed
"
$1
"
"
$2
"
#[ -n "$quiet" ] && exit
exit
fi
local
list
if
[
"
$1
"
=
"all"
]
;
then
shift
list
=
"
$(
__list_installed_app
)
"
else
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
"--installed-version"
|
"--package-name"
|
"--product-alternatives"
)
--installed-version
|
--package-name
|
--product-alternatives
|
--info
)
__run_script
"
$2
"
"
$1
"
"
$3
"
exit
;;
"--list-installed-packages"
)
--list-installed-packages
)
__list_installed_packages
exit
;;
"--list"
|
"--list-installed"
|
"list"
|
"list-installed"
)
--list
|
--list-installed
|
list|list-installed
)
__epm_play_list_installed
exit
;;
# internal options
"--help"
|
"help"
)
__run_script
"
$2
"
"
$1
"
"
$3
"
--full-list-all
)
[
-n
"
$short
"
]
||
[
-n
"
$quiet
"
]
||
echo
"Available applications (for current arch
$(
$DISTRVENDOR
-a
)
):"
__epm_play_list
$psdir
extra
exit
;;
esac
if
[
"
$1
"
=
"--full-list-all"
]
;
then
[
-n
"
$short
"
]
||
[
-n
"
$quiet
"
]
||
echo
"Available applications (for current arch
$(
$DISTRVENDOR
-a
)
):"
__epm_play_list
$psdir
extra
exit
fi
if
[
"
$1
"
=
"--list-all"
]
||
[
"
$1
"
=
"list-all"
]
||
[
-z
"
$*
"
]
;
then
[
-n
"
$short
"
]
||
[
-n
"
$quiet
"
]
||
echo
"Available applications (for current arch
$(
$DISTRVENDOR
-a
)
):"
__epm_play_list
$psdir
[
-n
"
$quiet
"
]
||
[
-n
"
$*
"
]
&&
exit
echo
#echo "Run epm play --help for help"
epm_play_help
exit
fi
--list-all
|
list-all
)
[
-n
"
$short
"
]
||
[
-n
"
$quiet
"
]
||
echo
"Available applications (for current arch
$(
$DISTRVENDOR
-a
)
):"
__epm_play_list
$psdir
[
-n
"
$quiet
"
]
||
[
-n
"
$*
"
]
&&
exit
echo
#echo "Run epm play --help for help"
epm_play_help
exit
;;
if
[
"
$1
"
=
"--list-scripts"
]
||
[
"
$1
"
=
"list-scripts"
]
;
then
[
-n
"
$short
"
]
||
[
-n
"
$quiet
"
]
||
echo
"Run with a name of a play script to run:"
__epm_play_list
$prsdir
exit
fi
--list-scripts
|
list-scripts
)
[
-n
"
$short
"
]
||
[
-n
"
$quiet
"
]
||
echo
"Run with a name of a play script to run:"
__epm_play_list
$prsdir
exit
;;
-
*
)
fatal
"Unknown option
$1
"
;;
*
)
break
;;
esac
shift
done
__epm_play_install
$(
echo
"
$*
"
|
sed
-e
's|=| = |g'
)
}
play.d/common.sh
View file @
5c70c8c6
...
...
@@ -68,12 +68,13 @@ case "$1" in
epm remove
$PKGNAME
exit
;;
"--
help
"
)
"--
info
"
)
if
[
-n
"
$PRODUCTALT
"
]
;
then
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
[
-n
"
$TIPS
"
]
&&
echo
"
$TIPS
"
[
-n
"
$URL
"
]
&&
echo
"Url:
$URL
"
exit
;;
"--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