[Buildroot] [PATCH v3 0/2] Add gettext-tiny package

Yann E. MORIN yann.morin.1998 at free.fr
Sun Mar 10 10:18:52 UTC 2019


Vadim, All,

On 2019-03-10 10:11 +0100, Thomas Petazzoni spake thusly:
> On Sun, 10 Mar 2019 02:20:05 +0200
> Vadim Kochan <vadim4j at gmail.com> wrote:
> 
> > Many thanks for your feedback! Using the gnu gettext's tar is really better
> > idea! Regarding ecryptfs-utils - yes, I think the patch might be really easy,
> > something like this:
> > 
> > ...
> > function trans {
> >     if command -v gettext &> /dev/null; then

'command' is not a POSIX builtin; it's a bashism, so there is no
guarantee it is available:

    http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html

So, maybe:

    if which gettext >/dev/null; then
        gettext "${@}"
    else
        echo "${@}"
    fi

Alternatively, I believe it would be relatively trivial to provide a
fake gettext rwapper:

    #!/bin/sh

    while [ ${#} -ne 0 ]; do
        case "${1}" in
          (-h)              echo "no help"; exit 0;;
          (-V)              echo "0.0.0"; exit 0;;
          (-d|--domain)     shift 2;;
          (-d*|--domain=*)  shift 1;;
          (-e|-E|-n)        shift 1;;
          (-s)              shift 1;;  # Ignore?
          (*)               break;;
        esac
    done
    case ${#} in
      (0)   ;;
      (1)   echo "${1}";;           # No TEXTDOMAIN?
      (*)   shift; echo "${@}";;    # Ignore TEXTDOMAIN?
    esac

Regards,
Yann E. MORIN.

> >         gettext @
> >     else
> >         echo @
> >     fi
> > }
> > ...
> > 
> > and replace gettext -> trans in scripts.
> 
> Sounds good! Will you work on this ?
> 
> So, we agree that for the target gettext, only gettext-gnu will be a
> provider when BR2_SYSTEM_ENABLE_NLS=y. When BR2_SYSTEM_ENABLE_NLS is
> disabled, we don't have any target gettext package. Correct ? If so,
> then I'll rework my branch to take this into account.
> 
> Thanks,
> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'



More information about the buildroot mailing list