Re: [RFC/PATCH] i18n: add infrastructure for translating Git with gettext
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Nov 18, 2011, 12:29 UTC
- Message-ID
- <CACBZZX4hE=tSYRW3GJndvi3pr0B=Qyk+XT4qvMzC=jtAGhgXZg@mail.gmail.com>
- In-Reply-To
- <7v39dmmj8k.fsf@alter.siamese.dyndns.org>
On Fri, Nov 18, 2011 at 00:17, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Just an extremely minor issue, but a few things seem to seep through the > "make V=''" build: > > SUBDIR perl > /usr/bin/perl -pe "s<\Q++LOCALEDIR++\E><.../share/locale>" <Git/I18N.pm >blib/lib/Git/I18N.pm > /usr/bin/perl -pe "s<\Q++LOCALEDIR++\E><.../share/locale>" <Git.pm >blib/lib/Git.pm > Manifying blib/man3/Git::I18N.3pm > Manifying blib/man3/Git.3pm > SUBDIR git_remote_helpers
That behavior hasn't changed with this patch, we just print out more stuff now. Without the patch with V='':
SUBDIR perl
cp Git.pm blib/lib/Git.pm
Manifying blib/man3/Git.3pmAnd with it:
SUBDIR perl
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></home/avar/share/locale>"
<Git/I18N.pm >blib/lib/Git/I18N.pm
/usr/bin/perl -pe "s<\Q++LOCALEDIR++\E></home/avar/share/locale>"
<Git.pm >blib/lib/Git.pm
Manifying blib/man3/Git::I18N.3pm
Manifying blib/man3/Git.3pmSo the change is:
* We now have 2 files instead of 1 * We have a filtering command instead of just a "cp".
The reason this happens is that we have this in the perl.mak:
PM_FILTER = $(PERL) -pe "s<\Q++LOCALEDIR++\E></home/avar/share/locale>"
And we then later call:
pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM)
$(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e
'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', q[$(PM_FILTER)],
'\''$(PERM_DIR)'\'')' -- \
Git/I18N.pm $(INST_LIBDIR)/Git/I18N.pm \
Git.pm $(INST_LIBDIR)/Git.pm
$(NOECHO) $(TOUCH) pm_to_blibWhich in ExtUtils::Install calls pm_to_blib, which is defined like this:
sub pm_to_blib {
my($fromto,$autodir,$pm_filter) = @_; _mkpath($autodir,0,0755);
while(my($from, $to) = each %$fromto) {
if( -f $to && -s $from == -s $to && -M $to < -M $from ) {
print "Skip $to (unchanged)\n";
next;
} # When a pm_filter is defined, we need to pre-process the
source first
# to determine whether it has changed or not. Therefore,
only perform
# the comparison check when there's no filter to be ran.
# -- RAM, 03/01/2001 my $need_filtering = defined $pm_filter && length $pm_filter &&
$from =~ /\.pm$/; if (!$need_filtering && 0 == compare($from,$to)) {
print "Skip $to (unchanged)\n";
next;
}
if (-f $to){
# we wont try hard here. its too likely to mess things up.
forceunlink($to);
} else {
_mkpath(dirname($to),0,0755);
}
if ($need_filtering) {
run_filter($pm_filter, $from, $to);
print "$pm_filter <$from >$to\n";
} else {
_copy( $from, $to );
print "cp $from $to\n";
}I.e. there's no way to stop it from printing what it copies / filters. We could quiet it with some Perl or Makefile hack, but let's try to address that outside of this series.