diff options
author | Robby Russell <robby@planetargon.com> | 2015-02-10 11:21:36 -0800 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2015-02-10 11:21:36 -0800 |
commit | 9b8e88d5acf8b06d5a600c2aaeea76925ca3f29f (patch) | |
tree | 592ed7647dc6e5f6389ff83ee860b1494b314fc5 | |
parent | d2667bd0a29f308d528b42bca9cd3b79cd11a8ae (diff) | |
parent | f997ed7ed8028e400216cfac9bee64b53017e588 (diff) | |
download | zsh-9b8e88d5acf8b06d5a600c2aaeea76925ca3f29f.tar.gz zsh-9b8e88d5acf8b06d5a600c2aaeea76925ca3f29f.tar.bz2 zsh-9b8e88d5acf8b06d5a600c2aaeea76925ca3f29f.zip |
Merge pull request #3483 from ai/fedora-not-found
Add Fedora support for command-not-found plugin
-rw-r--r-- | plugins/command-not-found/command-not-found.plugin.zsh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh index f3d7ec2df..797554a13 100644 --- a/plugins/command-not-found/command-not-found.plugin.zsh +++ b/plugins/command-not-found/command-not-found.plugin.zsh @@ -7,3 +7,19 @@ # Arch Linux command-not-found support, you must have package pkgfile installed # https://wiki.archlinux.org/index.php/Pkgfile#.22Command_not_found.22_hook [[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && source /usr/share/doc/pkgfile/command-not-found.zsh + +# Fedora command-not-found support +if [ -f /usr/libexec/pk-command-not-found ]; then + command_not_found_handler () { + runcnf=1 + retval=127 + [ ! -S /var/run/dbus/system_bus_socket ] && runcnf=0 + [ ! -x /usr/libexec/packagekitd ] && runcnf=0 + if [ $runcnf -eq 1 ] + then + /usr/libexec/pk-command-not-found $@ + retval=$? + fi + return $retval + } +fi |