Commit ca5d65c6 authored by Vitaly Lipatov's avatar Vitaly Lipatov

introduce is_installed and use it instead epm_query internally

parent d7544747
......@@ -99,7 +99,7 @@ epm_changelog()
local pkg
for pkg in $pkg_names ; do
if pkg_names=$pkg epm_query ; then
if is_installed $pkg ; then
__epm_changelog_local_names $pkg
else
__epm_changelog_unlocal_names $pkg
......
......@@ -67,7 +67,7 @@ __epm_filelist_name()
CMD="pacman -Ql"
;;
slackpkg)
epm_query >/dev/null || fatal "Query filelist for non installed packages does not realized"
is_installed $pkg_names || fatal "Query filelist for non installed packages does not realized"
docmd awk 'BEGIN{desk=1}{if(/^FILE LIST:$/){desk=0} else if (desk==0) {print}}' /var/log/packages/${pkg_filenames}*
return
;;
......@@ -77,7 +77,7 @@ __epm_filelist_name()
esac
docmd $CMD $pkg_names && return
epm_query >/dev/null || fatal "Query filelist for non installed packages does not realized"
is_installed $pkg_names || fatal "Query filelist for non installed packages does not realized"
}
......
......@@ -26,7 +26,7 @@ __epm_info_rpm_low()
docmd rpm -qip $pkg_files
fi
[ -z "$pkg_names" ] && return
pkg_filenames=$pkg_names epm_query >/dev/null && docmd rpm -qi $pkg_names && return
is_installed $pkg_names && docmd rpm -qi $pkg_names && return
}
epm_info()
......@@ -41,7 +41,7 @@ case $PMTYPE in
docmd dpkg -I $pkg_files
fi
[ -z "$pkg_names" ] && return
pkg_filenames=$pkg_names epm_query >/dev/null && docmd dpkg -p $pkg_names && return
is_installed $pkg_names && docmd dpkg -p $pkg_names && return
docmd apt-cache show $pkg_names
;;
yum-rpm)
......
......@@ -23,7 +23,7 @@ filter_out_installed_packages()
{
[ -z "$skip_installed" ] && cat && return
# TODO: rewrite with use epm_query
# TODO: rewrite with use is_installed
# TODO: use this more effectively way
#for i in $(cat) ; do
# rpm -q $i >/dev/null && continue
......
......@@ -56,7 +56,7 @@ __epm_query_file()
;;
esac
docmd $CMD $pkg_files
docmd $CMD $@
}
__epm_query_name()
......@@ -77,17 +77,22 @@ __epm_query_name()
#return
;;
npackd)
CMD="npackdcl path --package=$pkg_names"
CMD="npackdcl path --package=$@"
;;
*)
_query_via_packages_list $pkg_names
_query_via_packages_list $@
return
;;
esac
docmd $CMD $pkg_names
docmd $CMD $@
}
# check if pkg is installed
is_installed()
{
pkg_filenames="$@" epm_query >/dev/null
}
epm_query()
{
......
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