Commit cd3804cc authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play: optimize install checking with batch checking

parent 82a58f16
...@@ -61,16 +61,46 @@ __list_all_app() ...@@ -61,16 +61,46 @@ __list_all_app()
done done
} }
__list_installed_app() __list_all_packages()
{
local name
for name in $(__list_all_app) ; do
__get_app_package $name
done
}
# pkg app
__list_app_packages_table()
{ {
local name local name
for name in $(__list_all_app) ; do for name in $(__list_all_app) ; do
__check_installed_app $name && echo "$name" echo "$(__get_app_package $name) $name"
done
}
__list_installed_app()
{
local i
local tapt=$(mktemp) || fatal
__list_app_packages_table >$tapt
# get all installed packages and convert it to a apps list
for i in $(epm query --short $(cat $tapt | sed -e 's| .*$||') 2>/dev/null) ; do
grep "^$i " $tapt | sed -e 's|^.* ||'
done done
rm -f $tapt
return return
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" local script="$psdir/$1.sh"
......
...@@ -11,6 +11,11 @@ if [ "$1" = "--remove" ] ; then ...@@ -11,6 +11,11 @@ if [ "$1" = "--remove" ] ; then
exit exit
fi fi
if [ "$1" = "--package" ] ; then
echo "$PKGNAME"
exit
fi
if [ "$1" = "--installed" ] ; then if [ "$1" = "--installed" ] ; then
epm installed $PKGNAME epm installed $PKGNAME
exit exit
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment