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