r3157 - trunk/src/target/OM-2007.2/applications/openmoko-firststart2
mickey at sita.openmoko.org
mickey at sita.openmoko.org
Sun Oct 14 13:59:49 CEST 2007
Author: mickey
Date: 2007-10-14 13:59:48 +0200 (Sun, 14 Oct 2007)
New Revision: 3157
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-firststart2/intltool-extract.in
trunk/src/target/OM-2007.2/applications/openmoko-firststart2/intltool-merge.in
trunk/src/target/OM-2007.2/applications/openmoko-firststart2/intltool-update.in
Log:
openmoko-firststart2: bump intltool scripts
Modified: trunk/src/target/OM-2007.2/applications/openmoko-firststart2/intltool-extract.in
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-firststart2/intltool-extract.in 2007-10-13 14:30:09 UTC (rev 3156)
+++ trunk/src/target/OM-2007.2/applications/openmoko-firststart2/intltool-extract.in 2007-10-14 11:59:48 UTC (rev 3157)
@@ -32,7 +32,7 @@
## Release information
my $PROGRAM = "intltool-extract";
my $PACKAGE = "intltool";
-my $VERSION = "0.35.4";
+my $VERSION = "0.36.1";
## Loaded modules
use strict;
@@ -237,9 +237,9 @@
s/'/'/g; # '
s/"/"/g; # "
- s/&/&/g;
s/</</g;
s/>/>/g;
+ s/&/&/g;
return $_;
}
@@ -261,8 +261,11 @@
sub type_ini {
### For generic translatable desktop files ###
- while ($input =~ /^_.*=(.*)$/mg) {
- $messages{$1} = [];
+ while ($input =~ /^(#(.+)\n)?^_.*=(.*)$/mg) {
+ if (defined($2)) {
+ $comments{$3} = $2;
+ }
+ $messages{$3} = [];
}
}
Modified: trunk/src/target/OM-2007.2/applications/openmoko-firststart2/intltool-merge.in
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-firststart2/intltool-merge.in 2007-10-13 14:30:09 UTC (rev 3156)
+++ trunk/src/target/OM-2007.2/applications/openmoko-firststart2/intltool-merge.in 2007-10-14 11:59:48 UTC (rev 3157)
@@ -35,7 +35,7 @@
## Release information
my $PROGRAM = "intltool-merge";
my $PACKAGE = "intltool";
-my $VERSION = "0.35.4";
+my $VERSION = "0.36.1";
## Loaded modules
use strict;
@@ -93,9 +93,24 @@
my %po_files_by_lang = ();
my %translations = ();
-my $iconv = $ENV{"ICONV"} || $ENV{"INTLTOOL_ICONV"} || "@INTLTOOL_ICONV@";
+my $iconv = $ENV{"ICONV"} || "iconv";
my $devnull = ($^O eq 'MSWin32' ? 'NUL:' : '/dev/null');
+sub isProgramInPath
+{
+ my ($file) = @_;
+ # If either a file exists, or when run it returns 0 exit status
+ return 1 if ((-x $file) or (system("$file --version >$devnull") == 0));
+ return 0;
+}
+
+if (! isProgramInPath ("$iconv"))
+{
+ print STDERR " *** iconv is not found on this system!\n".
+ " *** Without it, intltool-merge can not convert encodings.\n";
+ exit;
+}
+
# Use this instead of \w for XML files to handle more possible characters.
my $w = "[-A-Za-z0-9._:]";
@@ -494,16 +509,15 @@
return $string;
}
-## NOTE: deal with < - < but not > - > because it seems its ok to have
-## > in the entity. For further info please look at #84738.
sub entity_decode
{
local ($_) = @_;
s/'/'/g; # '
s/"/"/g; # "
+ s/</</g;
+ s/>/>/g;
s/&/&/g;
- s/</</g;
return $_;
}
@@ -1017,8 +1031,8 @@
if ($MULTIPLE_OUTPUT) {
for my $lang (sort keys %po_files_by_lang) {
- if ( ! -e $lang ) {
- mkdir $lang or die "Cannot create subdirectory $lang: $!\n";
+ if ( ! -d $lang ) {
+ mkdir $lang or -d $lang or die "Cannot create subdirectory $lang: $!\n";
}
open OUTPUT, ">$lang/$OUTFILE" or die "Cannot open $lang/$OUTFILE: $!\n";
binmode (OUTPUT) if $^O eq 'MSWin32';
@@ -1386,8 +1400,8 @@
}
for my $lang (sort keys %po_files_by_lang) {
- if ( ! -e $lang ) {
- mkdir $lang or die "Cannot create subdirectory $lang: $!\n";
+ if ( ! -d $lang ) {
+ mkdir $lang or -d $lang or die "Cannot create subdirectory $lang: $!\n";
}
open INPUT, "<${FILE}" or die;
open OUTPUT, ">$lang/$OUTFILE" or die "Cannot open $lang/$OUTFILE: $!\n";
Modified: trunk/src/target/OM-2007.2/applications/openmoko-firststart2/intltool-update.in
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-firststart2/intltool-update.in 2007-10-13 14:30:09 UTC (rev 3156)
+++ trunk/src/target/OM-2007.2/applications/openmoko-firststart2/intltool-update.in 2007-10-14 11:59:48 UTC (rev 3157)
@@ -30,7 +30,7 @@
## Release information
my $PROGRAM = "intltool-update";
-my $VERSION = "0.35.4";
+my $VERSION = "0.36.1";
my $PACKAGE = "intltool";
## Loaded modules
@@ -71,7 +71,8 @@
"sheet(?:\\.in)+|". # ?
"schemas(?:\\.in)+|". # GConf specific
"pong(?:\\.in)+|". # DEPRECATED: PONG is not used [by GNOME] any longer.
-"kbd(?:\\.in)+"; # GOK specific.
+"kbd(?:\\.in)+|". # GOK specific.
+"policy(?:\\.in)+"; # PolicyKit files
my $ini_support =
"icon(?:\\.in)+|". # http://www.freedesktop.org/Standards/icon-theme-spec
@@ -328,8 +329,13 @@
push @buf_i18n_ini, "$File::Find::name" if /\.($ini_support)$/;
push @buf_i18n_xml_unmarked, "$File::Find::name" if /\.(schemas(\.in)+)$/;
}, "..";
+ find sub {
+ push @buf_i18n_plain, "$File::Find::name" if /\.($buildin_gettext_support)$/;
+ push @buf_i18n_xml, "$File::Find::name" if /\.($xml_support)$/;
+ push @buf_i18n_ini, "$File::Find::name" if /\.($ini_support)$/;
+ push @buf_i18n_xml_unmarked, "$File::Find::name" if /\.(schemas(\.in)+)$/;
+ }, "$SRCDIR/..";
-
open POTFILES, $POTFILES_in or die "$PROGRAM: there's no POTFILES.in!\n";
@buf_potfiles = grep !/^(#|\s*$)/, <POTFILES>;
close POTFILES;
@@ -344,7 +350,7 @@
## comparing with POTFILES.in
foreach my $ignore ("POTFILES.skip", "POTFILES.ignore")
{
- (-s $ignore) or next;
+ (-s "$SRCDIR/$ignore") or next;
if ("$ignore" eq "POTFILES.ignore")
{
@@ -489,11 +495,15 @@
my %in2;
foreach (@buf_potfiles_sorted)
{
+ s#^$SRCDIR/../##;
+ s#^$SRCDIR/##;
$in2{$_} = 1;
}
foreach (@buf_potfiles_ignore_sorted)
{
+ s#^$SRCDIR/../##;
+ s#^$SRCDIR/##;
$in2{$_} = 1;
}
@@ -501,9 +511,16 @@
foreach (@buf_allfiles_sorted)
{
- if (!exists($in2{$_}))
+ my $dummy = $_;
+ my $srcdir = $SRCDIR;
+
+ $srcdir =~ s#^../##;
+ $dummy =~ s#^$srcdir/../##;
+ $dummy =~ s#^$srcdir/##;
+ $dummy =~ s#_build/##;
+ if (!exists($in2{$dummy}))
{
- push @result, $_
+ push @result, $dummy
}
}
@@ -563,16 +580,33 @@
exit 1;
}
+sub isProgramInPath
+{
+ my ($file) = @_;
+ # If either a file exists, or when run it returns 0 exit status
+ return 1 if ((-x $file) or (system("$file --version >$devnull") == 0));
+ return 0;
+}
+
+sub isGNUGettextTool
+{
+ my ($file) = @_;
+ # Check that we are using GNU gettext tools
+ if (isProgramInPath ($file))
+ {
+ my $version = `$file --version`;
+ return 1 if ($version =~ m/.*\(GNU .*\).*/);
+ }
+ return 0;
+}
+
sub GenerateHeaders
{
- my $EXTRACT = "@INTLTOOL_EXTRACT@";
- chomp $EXTRACT;
+ my $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} || "/usr/bin/intltool-extract";
- $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} if $ENV{"INTLTOOL_EXTRACT"};
-
## Generate the .h header files, so we can allow glade and
## xml translation support
- if (! -x "$EXTRACT")
+ if (! isProgramInPath ("$EXTRACT"))
{
print STDERR "\n *** The intltool-extract script wasn't found!"
."\n *** Without it, intltool-update can not generate files.\n";
@@ -619,13 +653,13 @@
#
sub GeneratePOTemplate
{
- my $XGETTEXT = $ENV{"XGETTEXT"} || "@INTLTOOL_XGETTEXT@";
+ my $XGETTEXT = $ENV{"XGETTEXT"} || "xgettext";
my $XGETTEXT_ARGS = $ENV{"XGETTEXT_ARGS"} || '';
chomp $XGETTEXT;
- if (! -x $XGETTEXT)
+ if (! isGNUGettextTool ("$XGETTEXT"))
{
- print STDERR " *** xgettext is not found on this system!\n".
+ print STDERR " *** GNU xgettext is not found on this system!\n".
" *** Without it, intltool-update can not extract strings.\n";
exit;
}
@@ -721,7 +755,23 @@
unlink "$MODULE.pot";
my @xgettext_argument=("$XGETTEXT",
"--add-comments",
- "--directory\=\.",
+ "--directory\=.",
+ "--default-domain\=$MODULE",
+ "--flag\=g_strdup_printf:1:c-format",
+ "--flag\=g_string_printf:2:c-format",
+ "--flag\=g_string_append_printf:2:c-format",
+ "--flag\=g_error_new:3:c-format",
+ "--flag\=g_set_error:4:c-format",
+ "--flag\=g_markup_printf_escaped:1:c-format",
+ "--flag\=g_log:3:c-format",
+ "--flag\=g_print:1:c-format",
+ "--flag\=g_printerr:1:c-format",
+ "--flag\=g_printf:1:c-format",
+ "--flag\=g_fprintf:2:c-format",
+ "--flag\=g_sprintf:2:c-format",
+ "--flag\=g_snprintf:3:c-format",
+ "--flag\=g_scanner_error:2:c-format",
+ "--flag\=g_scanner_warn:2:c-format",
"--output\=$MODULE\.pot",
"--files-from\=\.\/POTFILES\.in\.temp");
my $XGETTEXT_KEYWORDS = &FindPOTKeywords;
@@ -788,9 +838,16 @@
{
-f "$MODULE.pot" or die "$PROGRAM: $MODULE.pot does not exist.\n";
- my $MSGMERGE = $ENV{"MSGMERGE"} || "@INTLTOOL_MSGMERGE@";
+ my $MSGMERGE = $ENV{"MSGMERGE"} || "msgmerge";
my ($lang, $outfile) = @_;
+ if (! isGNUGettextTool ("$MSGMERGE"))
+ {
+ print STDERR " *** GNU msgmerge is not found on this system!\n".
+ " *** Without it, intltool-update can not extract strings.\n";
+ exit;
+ }
+
print "Merging $SRCDIR/$lang.po with $MODULE.pot..." if $VERBOSE;
my $infile = "$SRCDIR/$lang.po";
@@ -831,8 +888,15 @@
sub Console_Write_TranslationStatus
{
my ($lang, $output_file) = @_;
- my $MSGFMT = $ENV{"MSGFMT"} || "@INTLTOOL_MSGFMT@";
+ my $MSGFMT = $ENV{"MSGFMT"} || "msgfmt";
+ if (! isGNUGettextTool ("$MSGFMT"))
+ {
+ print STDERR " *** GNU msgfmt is not found on this system!\n".
+ " *** Without it, intltool-update can not extract strings.\n";
+ exit;
+ }
+
$output_file = "$SRCDIR/$lang.po" if ($output_file eq "");
system ("$MSGFMT", "-o", "$devnull", "--verbose", $output_file);
@@ -840,21 +904,28 @@
sub Console_Write_CoverageReport
{
- my $MSGFMT = $ENV{"MSGFMT"} || "@INTLTOOL_MSGFMT@";
+ my $MSGFMT = $ENV{"MSGFMT"} || "msgfmt";
+ if (! isGNUGettextTool ("$MSGFMT"))
+ {
+ print STDERR " *** GNU msgfmt is not found on this system!\n".
+ " *** Without it, intltool-update can not extract strings.\n";
+ exit;
+ }
+
&GatherPOFiles;
foreach my $lang (@languages)
{
- print "$lang: ";
+ print STDERR "$lang: ";
&POFile_Update ($lang, "");
}
- print "\n\n * Current translation support in $MODULE \n\n";
+ print STDERR "\n\n * Current translation support in $MODULE \n\n";
foreach my $lang (@languages)
{
- print "$lang: ";
+ print STDERR "$lang: ";
system ("$MSGFMT", "-o", "$devnull", "--verbose", "$SRCDIR/$lang.po");
}
}
@@ -928,13 +999,13 @@
$conf_in || die "Cannot find top_builddir in Makevars.";
}
- elsif (-f "../configure.ac")
+ elsif (-f "$SRCDIR/../configure.ac")
{
- $conf_in = "../configure.ac";
+ $conf_in = "$SRCDIR/../configure.ac";
}
- elsif (-f "../configure.in")
+ elsif (-f "$SRCDIR/../configure.in")
{
- $conf_in = "../configure.in";
+ $conf_in = "$SRCDIR/../configure.in";
}
else
{
More information about the commitlog
mailing list