All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] package/bash-completion: new package
@ 2018-01-11 12:50 Romain Naour
  2018-01-18 21:41 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Romain Naour @ 2018-01-11 12:50 UTC (permalink / raw)
  To: buildroot

From: Jeremy Rosen <jeremy.rosen@smile.fr>

Signed-off-by: Jeremy Rosen <jeremy.rosen@smile.fr>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
v2: use a install target hook (Baruch)
    install to staging
---
 package/Config.in                            |  1 +
 package/bash-completion/Config.in            |  7 +++++++
 package/bash-completion/bash-completion.hash |  3 +++
 package/bash-completion/bash-completion.mk   | 22 ++++++++++++++++++++++
 4 files changed, 33 insertions(+)
 create mode 100644 package/bash-completion/Config.in
 create mode 100644 package/bash-completion/bash-completion.hash
 create mode 100644 package/bash-completion/bash-completion.mk

diff --git a/package/Config.in b/package/Config.in
index 01f4095..d41d855 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1892,6 +1892,7 @@ comment "Shells"
 	source "package/zsh/Config.in"
 comment "Utilities"
 	source "package/at/Config.in"
+	source "package/bash-completion/Config.in"
 	source "package/ccrypt/Config.in"
 	source "package/crudini/Config.in"
 	source "package/dialog/Config.in"
diff --git a/package/bash-completion/Config.in b/package/bash-completion/Config.in
new file mode 100644
index 0000000..597c928
--- /dev/null
+++ b/package/bash-completion/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_BASH_COMPLETION
+	bool "bash completion"
+	depends on BR2_PACKAGE_BASH
+	help
+	  Add bash completion infrastructure.
+
+	  https://github.com/scop/bash-completion
diff --git a/package/bash-completion/bash-completion.hash b/package/bash-completion/bash-completion.hash
new file mode 100644
index 0000000..facbeb0
--- /dev/null
+++ b/package/bash-completion/bash-completion.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 41ba892d3f427d4a686de32673f35401bc947a7801f684127120cdb13641441e  bash-completion-2.7.tar.xz
+sha256 ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6  COPYING
diff --git a/package/bash-completion/bash-completion.mk b/package/bash-completion/bash-completion.mk
new file mode 100644
index 0000000..b6606ad
--- /dev/null
+++ b/package/bash-completion/bash-completion.mk
@@ -0,0 +1,22 @@
+################################################################################
+#
+# bash-completion
+#
+################################################################################
+
+BASH_COMPLETION_VERSION = 2.7
+BASH_COMPLETION_SITE = https://github.com/scop/bash-completion/releases/download/$(BASH_COMPLETION_VERSION)
+BASH_COMPLETION_SOURCE = bash-completion-$(BASH_COMPLETION_VERSION).tar.xz
+BASH_COMPLETION_LICENSE = GPL-2.0+
+BASH_COMPLETION_LICENSE_FILES = COPYING
+
+# Install bash-completion.pc file
+BASH_COMPLETION_INSTALL_STAGING = YES
+
+define BASH_COMPLETION_INSTALL_FILE
+	echo ". /usr/share/bash-completion/bash_completion" > $(TARGET_DIR)/etc/bash_completion
+endef
+
+BASH_COMPLETION_POST_INSTALL_TARGET_HOOKS += BASH_COMPLETION_INSTALL_FILE
+
+$(eval $(autotools-package))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH v2] package/bash-completion: new package
  2018-01-11 12:50 [Buildroot] [PATCH v2] package/bash-completion: new package Romain Naour
@ 2018-01-18 21:41 ` Thomas Petazzoni
  2018-01-19 15:00   ` Romain Naour
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2018-01-18 21:41 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 11 Jan 2018 13:50:00 +0100, Romain Naour wrote:

> +define BASH_COMPLETION_INSTALL_FILE
> +	echo ". /usr/share/bash-completion/bash_completion" > $(TARGET_DIR)/etc/bash_completion
> +endef

Who/what is reading this /etc/bash_completion file? Is bash itself
automatically loading this file? I'm asking because on my distro, I
have /etc/bash_completion.d/ and no /etc/bash_completion.

It seems like my bashrc here is automatically
including /usr/share/bash-completion/bash_completion, and otherwise
falls back to /etc/bash_completion:

  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi

Basically, my concerns are:

 - You are using ">" for the redirection. Are we going to be the only
   package writing to this file?

 - Do we support having other packages contribute additional bash
   completion logic?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH v2] package/bash-completion: new package
  2018-01-18 21:41 ` Thomas Petazzoni
@ 2018-01-19 15:00   ` Romain Naour
  0 siblings, 0 replies; 3+ messages in thread
From: Romain Naour @ 2018-01-19 15:00 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

Le 18/01/2018 ? 22:41, Thomas Petazzoni a ?crit?:
> Hello,
> 
> On Thu, 11 Jan 2018 13:50:00 +0100, Romain Naour wrote:
> 
>> +define BASH_COMPLETION_INSTALL_FILE
>> +	echo ". /usr/share/bash-completion/bash_completion" > $(TARGET_DIR)/etc/bash_completion
>> +endef
> 
> Who/what is reading this /etc/bash_completion file? Is bash itself
> automatically loading this file? I'm asking because on my distro, I
> have /etc/bash_completion.d/ and no /etc/bash_completion.

I'm using different Linux distribution and the bash_completion install is not
the same everywhere.

The bash-completion package install bash_completion script in
/usr/share/bash-completion/bash_completion and all completion script to
/usr/share/bash-completion/completion.

So, I guess that files located un /etc/bash_completion.h is distribution specific.

On my Fedora 27 I noticed that /etc/bash_completion is a symlink to
/usr/share/bash-completion/bash_completion.

On my Ubuntu 16.04 I have /etc/bash_completion.d/ and /etc/bash_completion script.

> 
> It seems like my bashrc here is automatically
> including /usr/share/bash-completion/bash_completion, and otherwise
> falls back to /etc/bash_completion:
> 
>   if [ -f /usr/share/bash-completion/bash_completion ]; then
>     . /usr/share/bash-completion/bash_completion
>   elif [ -f /etc/bash_completion ]; then
>     . /etc/bash_completion
>   fi

Same here with my Ubuntu 16.04.

> 
> Basically, my concerns are:
> 
>  - You are using ">" for the redirection. Are we going to be the only
>    package writing to this file?

I'll check this indeed.
The Buildroot Makefile take care to remove /etc/bash_completion when bash is not
selected. This means that some packages install some stuff here.

> 
>  - Do we support having other packages contribute additional bash
>    completion logic?

I'm wondering if we should let the user decide how to their
bash_completion/bashrc settings.

Best regards,
Romain

> 
> Thanks!
> 
> Thomas
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-19 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-11 12:50 [Buildroot] [PATCH v2] package/bash-completion: new package Romain Naour
2018-01-18 21:41 ` Thomas Petazzoni
2018-01-19 15:00   ` Romain Naour

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.