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,11 +443,10 @@ def get_bash_completion_path(root, share, info):
try: try:
path = check_output('pkg-config --variable=completionsdir bash-completion'.split()).strip().partition(os.pathsep)[0] path = check_output('pkg-config --variable=completionsdir bash-completion'.split()).strip().partition(os.pathsep)[0]
except Exception: except Exception:
info('Failed to find directory to install bash completions, skipping.') info('Failed to find directory to install bash completions, using default.')
return None path = '/usr/share/bash-completion/completions'
else: if path and os.path.exists(path) and os.path.isdir(path):
if os.path.exists(path): return os.path.join(path, 'calibre')
return os.path.join(path, 'calibre')
else: else:
# Use the default bash-completion dir under staging_share # Use the default bash-completion dir under staging_share
return os.path.join(share, 'bash-completion', 'completions', 'calibre') return os.path.join(share, 'bash-completion', 'completions', 'calibre')