From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Thomas Rast <trast@student.ethz.ch>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Jeff Epler <jepler@unpythonic.net>,
Jakub Narebski <jnareb@gmail.com>,
Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCH 1/2] Add infrastructure for translating Git with gettext
Date: Mon, 14 Jun 2010 22:51:11 +0000 [thread overview]
Message-ID: <AANLkTimpb9_91SOCR_SkA38Iwi6LQzu3ejxgtmyHe6tA@mail.gmail.com> (raw)
In-Reply-To: <201006142356.46780.trast@student.ethz.ch>
On Mon, Jun 14, 2010 at 21:56, Thomas Rast <trast@student.ethz.ch> wrote:
> Ævar Arnfjörð Bjarmason wrote:
>> It turns out that this doesn't actually work, and I can't find a
>> workaround. In Bash and Solaris's /bin/sh this executes until "dies
>> here". The problem is that I can't use the subshell trick, since the
>> gettext.sh inclusion has to be done in the current shell (I checked,
>> tests will fail).
>>
>> #!/bin/sh
>> (. does-not-exist.sh)
>> echo "A subshell made it! ret = $?"
>> . does-not-exist.sh
>> # dies here
>> echo "A real shell made it! ret = $?"
>>
>> Is there some clever shellscript trick that I'm missing, or will I
>> have to resort to modifying the file at `make' time for this to work
>> everywhere?
>
> Works for me in bash (4.0.35), but fails the way you say in dash (if
> only I could figure out the option that tells me the version!).
>
> This works however:
>
> type does-not-exist.sh 2>/dev/null && . does-not-exist.sh
Thanks. That works, I've tested the following script:
#!/bin/sh
type meh.sh >/dev/null 2>&1 && . meh.sh && echo "Included meh.sh"
|| echo "Didn't include meh.sh"
echo "I've made it!"
type gettext.sh >/dev/null 2>&1 && . gettext.sh && echo "Included
gettext.sh" || echo "Didn't include gettext.sh"
echo "I've made it!"
On the following:
FreeBSD: /bin/sh, bash
Solaris: /bin/sh, /usr/bin/ksh, bash,
Debian: dash, bash
They all make it to the last "I've made it!".
> I suspect it only works if the script is executable, as otherwise type
> would not find it (but . would). But at least on my system, it is.
With gettext.sh the assumption that it's +x seems valid, the
installation script for GNU gettext always gives it an executable bit.
next prev parent reply other threads:[~2010-06-14 22:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-06 17:47 [PATCH 0/2] Gettext support for Git Ævar Arnfjörð Bjarmason
2010-06-06 17:47 ` [PATCH 1/2] Add infrastructure for translating Git with gettext Ævar Arnfjörð Bjarmason
2010-06-07 10:02 ` Jakub Narebski
2010-06-07 13:19 ` Jeff Epler
2010-06-07 21:23 ` [PATCH v2 " Ævar Arnfjörð Bjarmason
2010-06-14 5:00 ` Junio C Hamano
2010-06-15 2:11 ` [PATCH v3 0/2] Gettext support for Git Ævar Arnfjörð Bjarmason
2010-06-15 2:11 ` [PATCH v3 1/2] Add infrastructure for translating Git with gettext Ævar Arnfjörð Bjarmason
2010-06-15 2:11 ` [PATCH v3 2/2] Add initial C, Shell and Perl gettext translations Ævar Arnfjörð Bjarmason
2010-06-15 19:33 ` [PATCH v4 0/2] Gettext support for Git Ævar Arnfjörð Bjarmason
2010-06-15 19:33 ` [PATCH v4 1/2] Add infrastructure for translating Git with gettext Ævar Arnfjörð Bjarmason
2010-06-15 19:33 ` [PATCH v4 2/2] Add initial C, Shell and Perl gettext translations Ævar Arnfjörð Bjarmason
2010-06-14 20:26 ` [PATCH 1/2] Add infrastructure for translating Git with gettext Ævar Arnfjörð Bjarmason
2010-06-14 21:56 ` Thomas Rast
2010-06-14 22:51 ` Ævar Arnfjörð Bjarmason [this message]
2010-06-06 17:47 ` [PATCH 2/2] Add initial C, Shell and Perl gettext translations Ævar Arnfjörð Bjarmason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimpb9_91SOCR_SkA38Iwi6LQzu3ejxgtmyHe6tA@mail.gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jepler@unpythonic.net \
--cc=jnareb@gmail.com \
--cc=jrnieder@gmail.com \
--cc=trast@student.ethz.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).