From 01077f04e33ec4a5609a24ae24eab6a6ddb7eaa9 Mon Sep 17 00:00:00 2001 From: Ondrej Nosek Date: Jan 27 2022 00:13:40 +0000 Subject: Return bash-completion back because of compatibility Keep the bash-completion script in the package. This allows running both versions of completion (based on post-install settings). Signed-off-by: Ondrej Nosek --- diff --git a/setup.py b/setup.py index 5bb33d0..c7bef6d 100755 --- a/setup.py +++ b/setup.py @@ -4,6 +4,17 @@ import os from setuptools import find_packages, setup +try: + from subprocess import getstatusoutput +except ImportError: + from commands import getstatusoutput + + +def bash_completion_dir(): + (sts, output) = getstatusoutput( + 'pkg-config --variable=completionsdir bash-completion') + return output if not sts and output else '/etc/bash_completion.d' + project_dir = os.path.dirname(os.path.realpath(__file__)) requirements = os.path.join(project_dir, 'requirements.txt') @@ -21,7 +32,7 @@ with open(tests_requirements, 'r') as f: setup( name="fedpkg", - version="1.41", + version="1.42", author="Dennis Gilmore", author_email="dgilmore@fedoraproject.org", description=("Fedora plugin to rpkg to manage " @@ -29,7 +40,8 @@ setup( license="GPLv2+", url="https://pagure.io/fedpkg", packages=find_packages(), - data_files=[('/etc/rpkg', ['conf/etc/rpkg/fedpkg.conf', + data_files=[(bash_completion_dir(), ['conf/bash-completion/fedpkg.bash']), + ('/etc/rpkg', ['conf/etc/rpkg/fedpkg.conf', 'conf/etc/rpkg/fedpkg-stage.conf']), ('/usr/share/zsh/site-functions', ['conf/zsh-completion/_fedpkg']), ],