Commit b2fc79eb authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-play: package list refactoring

parent fba26a45
...@@ -146,23 +146,32 @@ __list_app_packages_table_old() ...@@ -146,23 +146,32 @@ __list_app_packages_table_old()
done done
} }
__get_all_alt_repacked_packages() __get_all_rpm_repacked_packages()
{ {
FORMAT="%{Name} %{Version} %{Packager}\n" FORMAT="%{Name} %{Version} %{Packager}\n"
a= rpmquery --queryformat "$FORMAT" -a | grep "EPM <support@e" a= rpmquery --queryformat "$FORMAT" -a | grep "EPM <support@e"
} }
__filter_by_installed_packages() __filter_by_repacked_rpm_packages()
{ {
local i local i
local tapt="$1" local tapt="$1"
local pkglist="$2" local pkglist="$2"
# hack for rpm based LC_ALL=C join -11 -21 $tapt $pkglist | uniq
if [ "$PKGFORMAT" = "rpm" ] ; then
LC_ALL=C join -11 -21 $tapt $pkglist | uniq # rpm on Fedora/CentOS no more print missed packages to stderr
return # get supported packages list and print lines with it
fi #for i in $(epm query --short $(cat $tapt | cut -f1 -d" ") 2>/dev/null) ; do
# grep "^$i " $tapt
#done
}
__filter_by_installed_packages()
{
local i
local tapt="$1"
local pkglist="$2"
# get intersect between full package list and available packages table # get intersect between full package list and available packages table
LC_ALL=C join -11 -21 $tapt $pkglist | uniq | while read -r package app ; do LC_ALL=C join -11 -21 $tapt $pkglist | uniq | while read -r package app ; do
...@@ -170,12 +179,6 @@ __filter_by_installed_packages() ...@@ -170,12 +179,6 @@ __filter_by_installed_packages()
echo "$package $app" echo "$package $app"
fi fi
done done
# 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() __get_installed_table()
...@@ -190,13 +193,17 @@ __get_installed_table() ...@@ -190,13 +193,17 @@ __get_installed_table()
remove_on_exit $pkglist remove_on_exit $pkglist
if [ "$PKGFORMAT" = "rpm" ] ; then if [ "$PKGFORMAT" = "rpm" ] ; then
__get_all_alt_repacked_packages | LC_ALL=C sort -u >$pkglist # fast hack to get all repacked packages
# it misses all thirdparty packages installed as is
__get_all_rpm_repacked_packages | LC_ALL=C sort -u >$pkglist
__list_app_packages_table $pkglist | LC_ALL=C sort -u >$tapt
__filter_by_repacked_rpm_packages $tapt $pkglist
else else
epm --short packages | LC_ALL=C sort -u >$pkglist epm --short packages | LC_ALL=C sort -u >$pkglist
__list_app_packages_table $pkglist | LC_ALL=C sort -u >$tapt
__filter_by_installed_packages $tapt $pkglist
fi fi
__list_app_packages_table $pkglist | LC_ALL=C sort -u >$tapt
__filter_by_installed_packages $tapt $pkglist
rm -f $tapt rm -f $tapt
rm -f $pkglist rm -f $pkglist
} }
......
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