From 5cf0358086ece8277a1d86ce9834d25d3507a7f2 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 3 Jun 2013 16:45:08 -0400 Subject: [PATCH] command-not-found: If we get uninstalled while running, don't complain Check that the client command is executable before executing it, otherwise you get: $ foo -bash: /usr/libexec/pk-command-not-found: No such file or directory Signed-off-by: Adam Jackson --- contrib/command-not-found/PackageKit.sh.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/command-not-found/PackageKit.sh.in b/contrib/command-not-found/PackageKit.sh.in index 4c7e020..5068745 100644 --- a/contrib/command-not-found/PackageKit.sh.in +++ b/contrib/command-not-found/PackageKit.sh.in @@ -16,6 +16,9 @@ command_not_found_handle () { # don't run if packagekitd doesn't exist in the _system_ root [ ! -x /usr/libexec/packagekitd ] && runcnf=0 + # don't run if we've been uninstalled since the shell was launched + [ ! -x @LIBEXECDIR@/pk-command-not-found ] && runcnf=0 + # run the command, or just print a warning if [ $runcnf -eq 1 ]; then @LIBEXECDIR@/pk-command-not-found $@ -- 1.8.2.1