__fish_print_packages: correct syntax for yum, improve yum/rpm pipelines

Closes #1269 (output to cache file).

Reworks the editing pipeline for both yum and rpm completions down to a
single sed command.
This commit is contained in:
David Adam 2014-01-29 12:47:56 +08:00
parent 60808a4820
commit 8fbffe250a

View file

@ -46,7 +46,7 @@ function __fish_print_packages
end
# Remove package version information from output and pipe into cache file
/usr/share/yum-cli/completion-helper.py list all -d 0 -C >$cache_file | cut -d '.' -f 1 | sed '1d' | sed '/^\s/d' | sed -e 's/$/'\t$package'/' &
/usr/share/yum-cli/completion-helper.py list all -d 0 -C | sed "s/\..*/\t$package/" >$cache_file &
end
# Rpm is too slow for this job, so we set it up to do completions
@ -67,7 +67,7 @@ function __fish_print_packages
end
# Remove package version information from output and pipe into cache file
rpm -qa | sed -e 's/-[^-]*-[^-]*$//' | sed -e 's/$/'\t$package'/' >$cache_file &
rpm -qa |sed -e 's/-[^-]*-[^-]*$/\t'$package'/' >$cache_file &
end
# This completes the package name from the portage tree.