From ca8be6b8661174268a597e78e422d97e03a9f36b Mon Sep 17 00:00:00 2001 From: Enzo Candotti Date: Tue, 3 Jan 2023 15:32:29 -0300 Subject: [PATCH] Fix fm command bash dynamic completion For dynamic bash completion, instead of using the legacy /etc/bash_completiond.d, the current bash-completion can use a dynamic mechanism in which the customized completion is called upon completion activation. The new location that is already pointed by the .bashrc file, also engaged by the /etc/bash_completion, is /usr/share/bash-completion/completions. However, the bash file was placed under a subfolder with the name of the command which is not necessary since the file already contains the command name. Also, the proper file name shall contain .bash extension. Closes-Bug: 2001553 Test Plan: PASS: Build python-fmclient package. PASS: Build Debian image and install it successfully. Verify fm.bash is installed under /usr/share/bash-completion/completions PASS: Verify bash completion is working as expected: Signed-off-by: Enzo Candotti Change-Id: I3b796d26633459b98d7555e48e0bf5ea01c630d3 --- python-fmclient/debian/deb_folder/copyright | 4 ++-- python-fmclient/debian/deb_folder/python3-fmclient.dirs | 1 + python-fmclient/debian/deb_folder/python3-fmclient.install | 2 +- python-fmclient/debian/deb_folder/rules | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 python-fmclient/debian/deb_folder/python3-fmclient.dirs diff --git a/python-fmclient/debian/deb_folder/copyright b/python-fmclient/debian/deb_folder/copyright index 73f9e244..64ded9aa 100644 --- a/python-fmclient/debian/deb_folder/copyright +++ b/python-fmclient/debian/deb_folder/copyright @@ -3,7 +3,7 @@ Upstream-Name: python-fmclient Source: https://opendev.org/starlingx/fault Files: * -Copyright: (c) 2013-2021 Wind River Systems, Inc +Copyright: (c) 2013-2023 Wind River Systems, Inc Copyright: Others (See individual files for more details) License: Apache-2 Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,7 +24,7 @@ License: Apache-2 # If you want to use GPL v2 or later for the /debian/* files use # the following clauses, or change it to suit. Delete these two lines Files: debian/* -Copyright: 2021 Wind River Systems, Inc +Copyright: 2021-2023 Wind River Systems, Inc License: Apache-2 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/python-fmclient/debian/deb_folder/python3-fmclient.dirs b/python-fmclient/debian/deb_folder/python3-fmclient.dirs new file mode 100644 index 00000000..e584b125 --- /dev/null +++ b/python-fmclient/debian/deb_folder/python3-fmclient.dirs @@ -0,0 +1 @@ +usr/share/bash-completion/completions diff --git a/python-fmclient/debian/deb_folder/python3-fmclient.install b/python-fmclient/debian/deb_folder/python3-fmclient.install index 134be15e..82db8ddb 100644 --- a/python-fmclient/debian/deb_folder/python3-fmclient.install +++ b/python-fmclient/debian/deb_folder/python3-fmclient.install @@ -1 +1 @@ -tools/fm.bash_completion usr/share/bash-completion/completions/fm +usr/share/bash-completion/completions/fm.bash diff --git a/python-fmclient/debian/deb_folder/rules b/python-fmclient/debian/deb_folder/rules index a13d829b..6708a82a 100755 --- a/python-fmclient/debian/deb_folder/rules +++ b/python-fmclient/debian/deb_folder/rules @@ -11,4 +11,5 @@ export ROOT=$(CURDIR)/debian/tmp override_dh_install: python3 setup.py install -f --install-layout=deb --root=$(ROOT) python3 setup.py bdist_wheel --universal -d ${CURDIR}/debian/python-fmclient-wheel/usr/share/python-wheels + install -p -D -m 644 tools/fm.bash_completion ${ROOT}/usr/share/bash-completion/completions/fm.bash dh_install