Commit 3fde8937 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm search: use direct args

parent 7cde2258
...@@ -155,6 +155,7 @@ case $PROGNAME in ...@@ -155,6 +155,7 @@ case $PROGNAME in
;; ;;
epms) # HELPSHORT: alias for epm search epms) # HELPSHORT: alias for epm search
epm_cmd=search epm_cmd=search
direct_args=1
;; ;;
epmsf) # HELPSHORT: alias for epm search file epmsf) # HELPSHORT: alias for epm search file
epm_cmd=search_file epm_cmd=search_file
...@@ -216,6 +217,7 @@ check_command() ...@@ -216,6 +217,7 @@ check_command()
;; ;;
-s|search|s|find|sr) # HELPCMD: search in remote package repositories -s|search|s|find|sr) # HELPCMD: search in remote package repositories
epm_cmd=search epm_cmd=search
direct_args=1
;; ;;
-qp|qp|query_package) # HELPCMD: search in the list of installed packages -qp|qp|query_package) # HELPCMD: search in the list of installed packages
epm_cmd=query_package epm_cmd=query_package
......
...@@ -222,23 +222,24 @@ __epm_search_make_grep() ...@@ -222,23 +222,24 @@ __epm_search_make_grep()
fi fi
} }
# we need internal implementation because regular epm_search uses quotes_args
__epm_search_internal() __epm_search_internal()
{ {
[ -n "$pkg_filenames" ] || fatal "Search: search argument(s) is missed" [ -n "$1" ] || fatal "Search: search argument(s) is missed"
# it is useful for first time running # it is useful for first time running
update_repo_if_needed soft update_repo_if_needed soft
warmup_bases warmup_bases
__epm_search_output $(get_firstarg $pkg_filenames) | grep "$pkg_filenames" __epm_search_output $(get_firstarg $@) | grep "$*"
} }
# copied from korinf/tools/run-script/scripts/search # copied from korinf/tools/run-script/scripts/search
epm_search() epm_search()
{ {
[ -n "$pkg_filenames" ] || fatal "Search: search argument(s) is missed" [ -n "$1" ] || fatal "Search: search argument(s) is missed"
# it is useful for first time running # it is useful for first time running
update_repo_if_needed soft update_repo_if_needed soft
......
...@@ -130,7 +130,7 @@ EOF ...@@ -130,7 +130,7 @@ EOF
# use verbose for get package status # use verbose for get package status
#pkg_filenames="$pkg-[0-9]" verbose=--verbose __epm_search_internal | grep -E "(installed|upgrade)" && continue #pkg_filenames="$pkg-[0-9]" verbose=--verbose __epm_search_internal | grep -E "(installed|upgrade)" && continue
#pkg_filenames="$pkg" verbose=--verbose __epm_search_internal | grep -E "(installed|upgrade)" && continue #pkg_filenames="$pkg" verbose=--verbose __epm_search_internal | grep -E "(installed|upgrade)" && continue
(pkg_filenames="$pkg" __epm_search_internal) | grep -q "^$pkg-[0-9]" && continue __epm_search_internal "$pkg" | grep -q "^$pkg-[0-9]" && continue
res=1 res=1
info "Package '$pkg' does not found in repository." info "Package '$pkg' does not found in repository."
done done
......
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