Re: [PATCH/RFC 00/17] Begin gettextizing Git
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Aug 31, 2010, 19:22 UTC
- Message-ID
- <20100831192247.GU2315@burratino>
- In-Reply-To
- <AANLkTikk8nVyvp0hTycMY9bjMub38msxrOHMMLNER_DS@mail.gmail.com>
Ævar Arnfjörð Bjarmason wrote:
> Maybe, but it'll always be --output=po/git.pot so I saw no reason to > seperate it. Should it be?
No big deal. I am vaguely worried about interrupted "make" invocations. Don't gettextized packages typically do something like this?
remove_creation_date() {
sed '#!/bin/sed -f
/^"POT-Creation-Date: .*"$/!b
x
# Test if the hold space is empty.
s/P/P/
ta
# Yes it was empty. First occurrence. Remove the line.
g
d
bb
:a
# The hold space was nonempty. Following occurrences. Do nothing.
x
:b'
}
(cd po && xgettext --default-domain=git ...)
set -e; \
if test -f po/git.pot &&
remove_creation_date <po/git.pot >po/git.1po+ &&
remove_creation_date <po/git.po >po/git.2po+ &&
cmp po/git.1po+ po/git.2po+; \
then \
rm -f po/git.1po+ po/git.2po+ po/git.po; \
else \
rm -f po/git.1po+ po/git.2po+ po/git.pot; \
mv po/git.po po/git.pot; \
fi> The -o for the C compiler changes, but the > "make pot" target will always write to po/git.pot.
In particular, to avoid using a partial .pot file, one might want to write to po/git.pot+, po/git.po, or similar and then rename it.
> Or: git://github.com/avar/git.git gettextize-git-mainporcelain-v3
Looks good.