summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2018-08-21 12:05:04 -0400
committerRichard Hughes <richard@hughsie.com>2018-08-21 17:45:20 +0100
commitb904036c4225ab7de64f59c44b1dab9cdf1e06f6 (patch)
treed3db8e7b4448f55e47c16dab341331cd9b071723
parentdbcab49e529eb9db20a4525107e37b3c255d5ccd (diff)
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 <ajax@redhat.com>
-rw-r--r--contrib/command-not-found/PackageKit.sh.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/command-not-found/PackageKit.sh.in b/contrib/command-not-found/PackageKit.sh.in
index ea582c251..3e9477572 100644
--- a/contrib/command-not-found/PackageKit.sh.in
+++ b/contrib/command-not-found/PackageKit.sh.in
@@ -21,6 +21,9 @@ command_not_found_handle () {
# don't run if bash command completion is being run
[[ -n ${COMP_CWORD-} ]] && 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