From 2ac2083f609eebd5d7c8baa5c29d603dc87cc469 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 10 Jul 2014 12:58:30 +0530 Subject: [PATCH] Also install bash completion on system where pkg-config is missing but the default bash completion dir exists --- src/calibre/linux.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/calibre/linux.py b/src/calibre/linux.py index 334ebf3366..ca99ac7dd5 100644 --- a/src/calibre/linux.py +++ b/src/calibre/linux.py @@ -443,11 +443,10 @@ def get_bash_completion_path(root, share, info): try: path = check_output('pkg-config --variable=completionsdir bash-completion'.split()).strip().partition(os.pathsep)[0] except Exception: - info('Failed to find directory to install bash completions, skipping.') - return None - else: - if os.path.exists(path): - return os.path.join(path, 'calibre') + info('Failed to find directory to install bash completions, using default.') + path = '/usr/share/bash-completion/completions' + if path and os.path.exists(path) and os.path.isdir(path): + return os.path.join(path, 'calibre') else: # Use the default bash-completion dir under staging_share return os.path.join(share, 'bash-completion', 'completions', 'calibre')