Also install bash completion on system where pkg-config is missing but the default bash completion dir exists

This commit is contained in:
Kovid Goyal 2014-07-10 12:58:30 +05:30
parent a106f15d95
commit 2ac2083f60

View File

@ -443,10 +443,9 @@ 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):
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