File xen.bb9afb7a465d3b7b438f2e11105409d24400f8f4.patch of Package xen
From: Olaf Hering <olaf@aepfle.de>
Date: Tue, 20 Oct 2020 14:39:28 +0200
Subject: bb9afb7a465d3b7b438f2e11105409d24400f8f4
tools/xl: use proper name for bash_completion file
Files in the bash-completion dirs should be named like the commands,
without suffix. Without this change 'xl' will not be recognized as a
command with completion support if BASH_COMPLETION_DIR is set to
/usr/share/bash-completion/completions.
Fixes: 9136a919b ("xl: Add basic bash completion for xl command.")
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
tools/libxl/Makefile | 2 +-
tools/libxl/bash-completion | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -311,25 +311,25 @@ install: all
$(INSTALL_DIR) $(DESTDIR)$(PKG_INSTALLDIR)
$(INSTALL_PROG) xl $(DESTDIR)$(sbindir)
$(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN)
$(INSTALL_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
$(SYMLINK_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenlight.so.$(MAJOR)
$(SYMLINK_SHLIB) libxenlight.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenlight.so
$(INSTALL_DATA) libxenlight.a $(DESTDIR)$(libdir)
$(INSTALL_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(libdir)
$(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(libdir)/libxlutil.so.$(XLUMAJOR)
$(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR) $(DESTDIR)$(libdir)/libxlutil.so
$(INSTALL_DATA) libxlutil.a $(DESTDIR)$(libdir)
$(INSTALL_DATA) libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h libxlutil.h $(DESTDIR)$(includedir)
- $(INSTALL_DATA) bash-completion $(DESTDIR)$(BASH_COMPLETION_DIR)/xl.sh
+ $(INSTALL_DATA) bash-completion $(DESTDIR)$(BASH_COMPLETION_DIR)/xl
$(INSTALL_DATA) xenlight.pc $(DESTDIR)$(PKG_INSTALLDIR)
$(INSTALL_DATA) xlutil.pc $(DESTDIR)$(PKG_INSTALLDIR)
.PHONY: clean
clean:
$(RM) -f _*.h *.o *.so* *.a $(CLIENTS) $(DEPS)
$(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check
$(RM) -f testidl.c.new testidl.c *.api-ok
$(RM) -f xenlight.pc
$(RM) -f xlutil.pc
$(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) clean
--- a/tools/libxl/bash-completion
+++ b/tools/libxl/bash-completion
@@ -1,13 +1,13 @@
-# Copy this file to /etc/bash_completion.d/xl.sh
+# Copy this file to /etc/bash_completion.d/xl
_xl()
{
local IFS=$'\n,'
local cur opts xl
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
xl=xl
if [[ $COMP_CWORD == 1 ]] ; then
opts=`${xl} help 2>/dev/null | sed '1,4d' | awk '/^ [^ ]/ {print $1}' | sed 's/$/ ,/g'` && COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )