Commit def6b465 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play: restore separated installed app list

parent 02e4c644
......@@ -21,9 +21,14 @@
epm_vardir=/var/lib/eepm
__check_installed_app()
{
[ -s $epm_vardir/installed-app ] || return 1
grep -q -- "^$1\$" $epm_vardir/installed-app
}
__save_installed_app()
{
return 0 # stub
[ -d "$epm_vardir" ] || return 0
__check_installed_app "$1" && return 0
echo "$1" | sudorun tee -a $epm_vardir/installed-app >/dev/null
......@@ -31,7 +36,6 @@ __save_installed_app()
__remove_installed_app()
{
return 0 # stub
[ -s $epm_vardir/installed-app ] || return 0
local i
for i in $* ; do
......@@ -40,6 +44,13 @@ __remove_installed_app()
return 0
}
__is_app_installed()
{
__run_script "$1" --installed "$2"
return
}
__run_script()
{
local script="$psdir/$1.sh"
......@@ -54,14 +65,6 @@ __get_app_package()
__run_script "$1" --package-name "$2" 2>/dev/null
}
__check_installed_app()
{
__run_script "$1" --installed "$2"
return
[ -s $epm_vardir/installed-app ] || return 1
grep -q -- "^$1\$" $epm_vardir/installed-app
}
__list_all_app()
......@@ -215,7 +218,6 @@ fi
if [ "$1" = "--remove" ] || [ "$1" = "remove" ] ; then
shift
#__check_installed_app "$1" || warning "$1 is not installed"
prescription="$1"
shift
if __check_play_script "$prescription" ; then
......@@ -251,7 +253,7 @@ if [ "$1" = "--update" ] ; then
if [ -z "$1" ] ; then
fatal "run --update with 'all' or a project name"
fi
__check_installed_app "$1" || fatal "$1 is not installed"
__is_app_installed "$1" || fatal "$1 is not installed"
prescription="$1"
shift
__epm_play_run $prescription --update "$@"
......@@ -260,7 +262,7 @@ fi
if [ "$1" = "--installed" ] || [ "$1" = "installed" ] ; then
shift
__check_installed_app "$1" "$2"
__is_app_installed "$1" "$2"
#[ -n "$quiet" ] && exit
exit
fi
......@@ -303,7 +305,7 @@ prescription="$1"
shift
if __check_play_script "$prescription" ; then
#__check_installed_app "$prescription" && info "$$prescription is already installed (use --remove to remove)" && exit 1
#__is_app_installed "$prescription" && info "$$prescription is already installed (use --remove to remove)" && exit 1
__epm_play_run "$prescription" --run "$@" && __save_installed_app "$prescription" || fatal "There was some error during install the application."
else
psdir=$prsdir
......
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