Commit d58d6139 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play: rewrite packages list operation via join

parent 09421439
......@@ -96,35 +96,48 @@ __list_app_packages_table()
done
}
__list_installed_app()
__filter_by_installed_packages()
{
local i
local tapt="$1"
local pkglist
pkglist="$(mktemp)" || fatal
remove_on_exit $pkglist
# get intersect between full package list and available packages table
epm --short packages | LANG=C sort -u >$pkglist
LANG=C join -11 -21 $tapt $pkglist | uniq
rm -f $pkglist
# rpm on Fedora/CentOS no more print missed packages to stderr
# get supported packages list and print lines with it
#for i in $(epm query --short $(cat $tapt | cut -f1 -d" ") 2>/dev/null) ; do
# grep "^$i " $tapt
#done
}
__get_installed_table()
{
local i
local tapt
tapt="$(mktemp)" || fatal
remove_on_exit $tapt
__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
__list_app_packages_table | LANG=C sort -u >$tapt
__filter_by_installed_packages $tapt
rm -f $tapt
return
}
cat $epm_vardir/installed-app 2>/dev/null
__list_installed_app()
{
# get all installed packages and convert it to a apps list
__get_installed_table | cut -f2 -d" "
}
__list_installed_packages()
{
local i
local tapt
tapt="$(mktemp)" || fatal
remove_on_exit $tapt
__list_app_packages_table >$tapt
# get all installed packages
for i in $(epm query --short $(cat $tapt | sed -e 's| .*$||') 2>/dev/null) ; do
grep "^$i " $tapt | cut -f1 -d" "
done
rm -f $tapt
__get_installed_table | cut -f1 -d" "
}
......
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