Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/ecryptfs-utils: Use echo-dummy gettext script if NLS is not enabled
@ 2019-02-13 18:54 Vadim Kochan
  2019-02-15 21:47 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Vadim Kochan @ 2019-02-13 18:54 UTC (permalink / raw)
  To: buildroot

From: Vadim Kochan <vadim4j@gmail.com>

gettext is used only as external tool in ecryptfs utils which can easy
be replaced by 'echo' if NLS is not required. So changed a bit semantic
of Config file - select gettext package only if NLS is enabled,
otherwise a dummy-echo script is generated as 'gettext' replacement.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
 package/ecryptfs-utils/Config.in         |  2 +-
 package/ecryptfs-utils/ecryptfs-utils.mk | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/package/ecryptfs-utils/Config.in b/package/ecryptfs-utils/Config.in
index 6652d33..1438c17 100644
--- a/package/ecryptfs-utils/Config.in
+++ b/package/ecryptfs-utils/Config.in
@@ -12,7 +12,7 @@ config BR2_PACKAGE_ECRYPTFS_UTILS
 	select BR2_PACKAGE_LIBNSS
 	# runtime dependency only, some scripts are using the
 	# 'gettext' program to get translations
-	select BR2_PACKAGE_GETTEXT
+	select BR2_PACKAGE_GETTEXT if BR2_SYSTEM_ENABLE_NLS
 	# runtime dependency only
 	select BR2_PACKAGE_GETENT
 	help
diff --git a/package/ecryptfs-utils/ecryptfs-utils.mk b/package/ecryptfs-utils/ecryptfs-utils.mk
index eb3194b..a2a0af6 100644
--- a/package/ecryptfs-utils/ecryptfs-utils.mk
+++ b/package/ecryptfs-utils/ecryptfs-utils.mk
@@ -25,4 +25,14 @@ else
 ECRYPTFS_UTILS_CONF_OPTS += --disable-openssl
 endif
 
+ifneq ($(BR2_SYSTEM_ENABLE_NLS),y)
+define ECRYPTFS_UTILS_GETTEXT_DUMMY_INSTALL
+	echo '#! /bin/sh' > $(@D)/gettext
+	echo 'echo $$@' >> $(@D)/gettext
+
+	$(INSTALL) -m 0755 -D $(@D)/gettext $(TARGET_DIR)/usr/bin/gettext
+endef
+ECRYPTFS_UTILS_POST_INSTALL_TARGET_HOOKS += ECRYPTFS_UTILS_GETTEXT_DUMMY_INSTALL
+endif
+
 $(eval $(autotools-package))
-- 
2.7.4

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

* [Buildroot] [PATCH 1/1] package/ecryptfs-utils: Use echo-dummy gettext script if NLS is not enabled
  2019-02-13 18:54 [Buildroot] [PATCH 1/1] package/ecryptfs-utils: Use echo-dummy gettext script if NLS is not enabled Vadim Kochan
@ 2019-02-15 21:47 ` Thomas Petazzoni
  2019-02-15 21:53   ` Vadym Kochan
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2019-02-15 21:47 UTC (permalink / raw)
  To: buildroot

Hello Vadim,

On Wed, 13 Feb 2019 20:54:15 +0200
Vadim Kochan <vadim4j@gmail.com> wrote:

> From: Vadim Kochan <vadim4j@gmail.com>
> 
> gettext is used only as external tool in ecryptfs utils which can easy
> be replaced by 'echo' if NLS is not required. So changed a bit semantic
> of Config file - select gettext package only if NLS is enabled,
> otherwise a dummy-echo script is generated as 'gettext' replacement.
> 
> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> ---
>  package/ecryptfs-utils/Config.in         |  2 +-
>  package/ecryptfs-utils/ecryptfs-utils.mk | 10 ++++++++++
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/package/ecryptfs-utils/Config.in b/package/ecryptfs-utils/Config.in
> index 6652d33..1438c17 100644
> --- a/package/ecryptfs-utils/Config.in
> +++ b/package/ecryptfs-utils/Config.in
> @@ -12,7 +12,7 @@ config BR2_PACKAGE_ECRYPTFS_UTILS
>  	select BR2_PACKAGE_LIBNSS
>  	# runtime dependency only, some scripts are using the
>  	# 'gettext' program to get translations
> -	select BR2_PACKAGE_GETTEXT
> +	select BR2_PACKAGE_GETTEXT if BR2_SYSTEM_ENABLE_NLS
>  	# runtime dependency only
>  	select BR2_PACKAGE_GETENT
>  	help
> diff --git a/package/ecryptfs-utils/ecryptfs-utils.mk b/package/ecryptfs-utils/ecryptfs-utils.mk
> index eb3194b..a2a0af6 100644
> --- a/package/ecryptfs-utils/ecryptfs-utils.mk
> +++ b/package/ecryptfs-utils/ecryptfs-utils.mk
> @@ -25,4 +25,14 @@ else
>  ECRYPTFS_UTILS_CONF_OPTS += --disable-openssl
>  endif
>  
> +ifneq ($(BR2_SYSTEM_ENABLE_NLS),y)
> +define ECRYPTFS_UTILS_GETTEXT_DUMMY_INSTALL
> +	echo '#! /bin/sh' > $(@D)/gettext
> +	echo 'echo $$@' >> $(@D)/gettext
> +
> +	$(INSTALL) -m 0755 -D $(@D)/gettext $(TARGET_DIR)/usr/bin/gettext

I understand the idea, but I don't think it's good for ecryptfs-utils
to install a tool called "gettext". Maybe some gettext-tiny package
should provide this dummy target gettext program ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 1/1] package/ecryptfs-utils: Use echo-dummy gettext script if NLS is not enabled
  2019-02-15 21:47 ` Thomas Petazzoni
@ 2019-02-15 21:53   ` Vadym Kochan
  0 siblings, 0 replies; 3+ messages in thread
From: Vadym Kochan @ 2019-02-15 21:53 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Fri, Feb 15, 2019 at 10:47:59PM +0100, Thomas Petazzoni wrote:
> Hello Vadim,
> 
> On Wed, 13 Feb 2019 20:54:15 +0200
> Vadim Kochan <vadim4j@gmail.com> wrote:
> 
> > From: Vadim Kochan <vadim4j@gmail.com>
> > 
> > gettext is used only as external tool in ecryptfs utils which can easy
> > be replaced by 'echo' if NLS is not required. So changed a bit semantic
> > of Config file - select gettext package only if NLS is enabled,
> > otherwise a dummy-echo script is generated as 'gettext' replacement.
> > 
> > Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> > ---
> >  package/ecryptfs-utils/Config.in         |  2 +-
> >  package/ecryptfs-utils/ecryptfs-utils.mk | 10 ++++++++++
> >  2 files changed, 11 insertions(+), 1 deletion(-)
> > 
> > diff --git a/package/ecryptfs-utils/Config.in b/package/ecryptfs-utils/Config.in
> > index 6652d33..1438c17 100644
> > --- a/package/ecryptfs-utils/Config.in
> > +++ b/package/ecryptfs-utils/Config.in
> > @@ -12,7 +12,7 @@ config BR2_PACKAGE_ECRYPTFS_UTILS
> >  	select BR2_PACKAGE_LIBNSS
> >  	# runtime dependency only, some scripts are using the
> >  	# 'gettext' program to get translations
> > -	select BR2_PACKAGE_GETTEXT
> > +	select BR2_PACKAGE_GETTEXT if BR2_SYSTEM_ENABLE_NLS
> >  	# runtime dependency only
> >  	select BR2_PACKAGE_GETENT
> >  	help
> > diff --git a/package/ecryptfs-utils/ecryptfs-utils.mk b/package/ecryptfs-utils/ecryptfs-utils.mk
> > index eb3194b..a2a0af6 100644
> > --- a/package/ecryptfs-utils/ecryptfs-utils.mk
> > +++ b/package/ecryptfs-utils/ecryptfs-utils.mk
> > @@ -25,4 +25,14 @@ else
> >  ECRYPTFS_UTILS_CONF_OPTS += --disable-openssl
> >  endif
> >  
> > +ifneq ($(BR2_SYSTEM_ENABLE_NLS),y)
> > +define ECRYPTFS_UTILS_GETTEXT_DUMMY_INSTALL
> > +	echo '#! /bin/sh' > $(@D)/gettext
> > +	echo 'echo $$@' >> $(@D)/gettext
> > +
> > +	$(INSTALL) -m 0755 -D $(@D)/gettext $(TARGET_DIR)/usr/bin/gettext
> 
> I understand the idea, but I don't think it's good for ecryptfs-utils
> to install a tool called "gettext". Maybe some gettext-tiny package
> should provide this dummy target gettext program ?
> 

Yeah, gettext-tiny sounds like a better place for this, in case if
gettext-tiny will be not merged then it is better to contribute changes
to the ecryptfs-utils project and provide 'gettext' alternative as
function, in case the 'gettext' binary does not exist.

Regards,
Vadim Kochan

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

end of thread, other threads:[~2019-02-15 21:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-13 18:54 [Buildroot] [PATCH 1/1] package/ecryptfs-utils: Use echo-dummy gettext script if NLS is not enabled Vadim Kochan
2019-02-15 21:47 ` Thomas Petazzoni
2019-02-15 21:53   ` Vadym Kochan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox