Commit fc93d22a authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm qf: don't parse args, fatal if the command is not found in PATH

parent b00ba6a8
...@@ -267,6 +267,7 @@ check_command() ...@@ -267,6 +267,7 @@ check_command()
;; ;;
-qf|qf|-S|wp|which|belongs) # HELPCMD: query package(s) owning file -qf|qf|-S|wp|which|belongs) # HELPCMD: query package(s) owning file
epm_cmd=query_file epm_cmd=query_file
direct_args=1
;; ;;
# HELPCMD: PART: Useful commands: # HELPCMD: PART: Useful commands:
......
...@@ -42,7 +42,9 @@ __do_query_real_file() ...@@ -42,7 +42,9 @@ __do_query_real_file()
TOFILE="$(__abs_filename "$1")" TOFILE="$(__abs_filename "$1")"
else else
TOFILE="$(print_command_path "$1" || echo "$1")" TOFILE="$(print_command_path "$1" || echo "$1")"
if [ "$TOFILE" != "$1" ] ; then if [ "$TOFILE" = "$1" ] ; then
fatal 'File '$TOFILE' is missing in '$PATH
else
# work against usrmerge # work against usrmerge
local t="$(realpath "$(dirname "$TOFILE")")/$(basename "$TOFILE")" #" local t="$(realpath "$(dirname "$TOFILE")")/$(basename "$TOFILE")" #"
if [ "$TOFILE" != "$t" ] ; then if [ "$TOFILE" != "$t" ] ; then
...@@ -182,13 +184,13 @@ __do_short_query() ...@@ -182,13 +184,13 @@ __do_short_query()
epm_query_file() epm_query_file()
{ {
# file can exists or not # file can exists or not
[ -n "$pkg_filenames" ] || fatal "Run query without file names" [ -n "$*" ] || fatal "Run query without file names"
#load_helper epm-search_file #load_helper epm-search_file
res=0 res=0
for pkg in $pkg_filenames ; do for pkg in "$@" ; do
__do_query_real_file "$pkg" || res=$? __do_query_real_file "$pkg" || res=$?
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