Re: [PATCH] git-sh-i18n: detect and avoid broken gettext(1) implementation
- From
Alex Riesen <raa.lkml@gmail.com>
- Date
- Jan 20, 2012, 14:02 UTC
- Message-ID
- <CALxABCYgYT=K0CRJKFOJAeB2wb=vRbwd--YEQtvofA5fmq_t-A@mail.gmail.com>
- In-Reply-To
- <1327063775-28420-1-git-send-email-avarab@gmail.com>
On Fri, Jan 20, 2012 at 13:49, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 21 quoted lines
> Even though we can load gettext.sh the gettext(1) and eval_gettext > functions it provides might be completely broken. This reportedly > happens on some Cygwin installations where we can load gettext.sh, but > gettext and eval_gettext both return exit code 127 and no output. > > The reason we're trying to load gettext.sh (or the equivalent Solaris > implementation) at all is so we don't have to provide our own fallback > implementation if the OS already has one installed, but because we > didn't test whether it actually worked under GNU gettext we might end > up with broken functions. > > Change the detection in git-sh-i18n so that it tests that the output > of "gettext test" produces "test", on Solaris we already test that > "gettext -h" produces "-h", so we were already guarded against the > same sort of failure there. > > Reported-by: Alex Riesen <raa.lkml@gmail.com> > --- > Here's a minimal patch to git-sh-i18n that should make things work on > Cygwin and any other platforms with broken gettext functions while > also using the OS-provided functions if they work.
FWIW, I confirm it works (which is quite obvious).
Just for giggles, I even risked running the tests and, of course, crashed that piece of junk with broken Cygwin installation. Please don't ask me to do that again :) restarting it is PITA as well.
Just for future reference to all poor Cygwin users:
I also left NO_GETTEXT in the config.mak. This, BTW, explains why git works, while gettext binary does not: one .dll dependency less.