~ubuntu-branches/ubuntu/gutsy/gnome-games/gutsy

« back to all changes in this revision

Viewing changes to intltool-update.in

  • Committer: Package Import Robot
  • Author(s): Aron Sisak
  • Date: 2007-08-28 11:17:57 UTC
  • mfrom: (1.1.35)
  • Revision ID: package-import@ubuntu.com-20070828111757-p1o9q24u57fbgkuq
Tags: 1:2.19.91-0ubuntu1
* New upstream release:
  - Sudoku:
    - Fix a crash when solving a sudoku, caused by a type mismatch (#470523).
  - Aisleriot:
    - Fix translation of "Autoplay" in Napoleons Tomb (#469363).
  - Gnometris:
    - Remove gaussian blur in background image to improve rendering performance.
  - Mahjongg:
    - Fix workaround for bug #353964. (LP: #94851)
* debian/patches/99_autoconf.patch:
  - Update via automagic

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
## Release information
32
32
my $PROGRAM = "intltool-update";
33
 
my $VERSION = "0.36.0";
 
33
my $VERSION = "0.35.5";
34
34
my $PACKAGE = "intltool";
35
35
 
36
36
## Loaded modules
71
71
"sheet(?:\\.in)+|".     # ?
72
72
"schemas(?:\\.in)+|".   # GConf specific
73
73
"pong(?:\\.in)+|".      # DEPRECATED: PONG is not used [by GNOME] any longer.
74
 
"kbd(?:\\.in)+|".       # GOK specific. 
75
 
"policy(?:\\.in)+";     # PolicyKit files
 
74
"kbd(?:\\.in)+";        # GOK specific. 
76
75
 
77
76
my $ini_support =
78
77
"icon(?:\\.in)+|".      # http://www.freedesktop.org/Standards/icon-theme-spec
329
328
        push @buf_i18n_ini,          "$File::Find::name" if /\.($ini_support)$/;
330
329
        push @buf_i18n_xml_unmarked, "$File::Find::name" if /\.(schemas(\.in)+)$/;
331
330
        }, "..";
332
 
    find sub { 
333
 
        push @buf_i18n_plain,        "$File::Find::name" if /\.($buildin_gettext_support)$/;
334
 
        push @buf_i18n_xml,          "$File::Find::name" if /\.($xml_support)$/;
335
 
        push @buf_i18n_ini,          "$File::Find::name" if /\.($ini_support)$/;
336
 
        push @buf_i18n_xml_unmarked, "$File::Find::name" if /\.(schemas(\.in)+)$/;
337
 
        }, "$SRCDIR/..";
 
331
 
338
332
 
339
333
    open POTFILES, $POTFILES_in or die "$PROGRAM:  there's no POTFILES.in!\n";
340
334
    @buf_potfiles = grep !/^(#|\s*$)/, <POTFILES>;
495
489
    my %in2;
496
490
    foreach (@buf_potfiles_sorted) 
497
491
    {
498
 
        s#^$SRCDIR/../##;
499
 
        s#^$SRCDIR/##;
500
492
        $in2{$_} = 1;
501
493
    }
502
494
 
503
495
    foreach (@buf_potfiles_ignore_sorted) 
504
496
    {
505
 
        s#^$SRCDIR/../##;
506
 
        s#^$SRCDIR/##;
507
497
        $in2{$_} = 1;
508
498
    }
509
499
 
511
501
 
512
502
    foreach (@buf_allfiles_sorted)
513
503
    {
514
 
        my $dummy = $_;
515
 
        my $srcdir = $SRCDIR;
516
 
 
517
 
        $srcdir =~ s#^../##;
518
 
        $dummy =~ s#^$srcdir/../##;
519
 
        $dummy =~ s#^$srcdir/##;
520
 
        $dummy =~ s#_build/##;
521
 
        if (!exists($in2{$dummy}))
 
504
        if (!exists($in2{$_}))
522
505
        {
523
 
            push @result, $dummy
 
506
            push @result, $_
524
507
        }
525
508
    }
526
509
 
580
563
    exit 1;
581
564
}
582
565
 
583
 
sub isProgramInPath
584
 
{
585
 
    my ($file) = @_;
586
 
    # If either a file exists, or when run it returns 0 exit status
587
 
    return 1 if ((-x $file) or (system("$file --version >$devnull") == 0));
588
 
    return 0;
589
 
}
590
 
 
591
 
sub isGNUGettextTool
592
 
{
593
 
    my ($file) = @_;
594
 
    # Check that we are using GNU gettext tools
595
 
    if (isProgramInPath ($file))
596
 
    {
597
 
        my $version = `$file --version`;
598
 
        return 1 if ($version =~ m/.*\(GNU .*\).*/);
599
 
    }
600
 
    return 0;
601
 
}
602
 
 
603
566
sub GenerateHeaders
604
567
{
605
568
    my $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} || "intltool-extract";
606
569
 
607
570
    ## Generate the .h header files, so we can allow glade and
608
571
    ## xml translation support
609
 
    if (! isProgramInPath ("$EXTRACT"))
 
572
    if (0)
610
573
    {
611
574
        print STDERR "\n *** The intltool-extract script wasn't found!"
612
575
             ."\n *** Without it, intltool-update can not generate files.\n";
653
616
#
654
617
sub GeneratePOTemplate
655
618
{
656
 
    my $XGETTEXT = $ENV{"XGETTEXT"} || "xgettext";
 
619
    my $XGETTEXT = $ENV{"XGETTEXT"} || "@INTLTOOL_XGETTEXT@";
657
620
    my $XGETTEXT_ARGS = $ENV{"XGETTEXT_ARGS"} || '';
658
621
    chomp $XGETTEXT;
659
622
 
660
 
    if (! isGNUGettextTool ("$XGETTEXT"))
 
623
    if (! -x $XGETTEXT)
661
624
    {
662
 
        print STDERR " *** GNU xgettext is not found on this system!\n".
 
625
        print STDERR " *** xgettext is not found on this system!\n".
663
626
                     " *** Without it, intltool-update can not extract strings.\n";
664
627
        exit;
665
628
    }
755
718
    unlink "$MODULE.pot";
756
719
    my @xgettext_argument=("$XGETTEXT",
757
720
                           "--add-comments",
758
 
                           "--directory\=.",
759
 
                           "--default-domain\=$MODULE",
760
 
                           "--flag\=g_strdup_printf:1:c-format",
761
 
                           "--flag\=g_string_printf:2:c-format",
762
 
                           "--flag\=g_string_append_printf:2:c-format",
763
 
                           "--flag\=g_error_new:3:c-format",
764
 
                           "--flag\=g_set_error:4:c-format",
765
 
                           "--flag\=g_markup_printf_escaped:1:c-format",
766
 
                           "--flag\=g_log:3:c-format",
767
 
                           "--flag\=g_print:1:c-format",
768
 
                           "--flag\=g_printerr:1:c-format",
769
 
                           "--flag\=g_printf:1:c-format",
770
 
                           "--flag\=g_fprintf:2:c-format",
771
 
                           "--flag\=g_sprintf:2:c-format",
772
 
                           "--flag\=g_snprintf:3:c-format",
773
 
                           "--flag\=g_scanner_error:2:c-format",
774
 
                           "--flag\=g_scanner_warn:2:c-format",
 
721
                           "--directory\=\.",
775
722
                           "--output\=$MODULE\.pot",
776
723
                           "--files-from\=\.\/POTFILES\.in\.temp");
777
724
    my $XGETTEXT_KEYWORDS = &FindPOTKeywords;
838
785
{
839
786
    -f "$MODULE.pot" or die "$PROGRAM: $MODULE.pot does not exist.\n";
840
787
 
841
 
    my $MSGMERGE = $ENV{"MSGMERGE"} || "msgmerge";
 
788
    my $MSGMERGE = $ENV{"MSGMERGE"} || "@INTLTOOL_MSGMERGE@";
842
789
    my ($lang, $outfile) = @_;
843
790
 
844
 
    if (! isGNUGettextTool ("$MSGMERGE"))
845
 
    {
846
 
        print STDERR " *** GNU msgmerge is not found on this system!\n".
847
 
                     " *** Without it, intltool-update can not extract strings.\n";
848
 
        exit;
849
 
    }
850
 
 
851
791
    print "Merging $SRCDIR/$lang.po with $MODULE.pot..." if $VERBOSE;
852
792
 
853
793
    my $infile = "$SRCDIR/$lang.po";
888
828
sub Console_Write_TranslationStatus
889
829
{
890
830
    my ($lang, $output_file) = @_;
891
 
    my $MSGFMT = $ENV{"MSGFMT"} || "msgfmt";
892
 
 
893
 
    if (! isGNUGettextTool ("$MSGFMT"))
894
 
    {
895
 
        print STDERR " *** GNU msgfmt is not found on this system!\n".
896
 
                     " *** Without it, intltool-update can not extract strings.\n";
897
 
        exit;
898
 
    }
 
831
    my $MSGFMT = $ENV{"MSGFMT"} || "@INTLTOOL_MSGFMT@";
899
832
 
900
833
    $output_file = "$SRCDIR/$lang.po" if ($output_file eq "");
901
834
 
904
837
 
905
838
sub Console_Write_CoverageReport
906
839
{
907
 
    my $MSGFMT = $ENV{"MSGFMT"} || "msgfmt";
908
 
 
909
 
    if (! isGNUGettextTool ("$MSGFMT"))
910
 
    {
911
 
        print STDERR " *** GNU msgfmt is not found on this system!\n".
912
 
                     " *** Without it, intltool-update can not extract strings.\n";
913
 
        exit;
914
 
    }
 
840
    my $MSGFMT = $ENV{"MSGFMT"} || "@INTLTOOL_MSGFMT@";
915
841
 
916
842
    &GatherPOFiles;
917
843
 
999
925
 
1000
926
            $conf_in || die "Cannot find top_builddir in Makevars.";
1001
927
        }
1002
 
        elsif (-f "$SRCDIR/../configure.ac") 
 
928
        elsif (-f "../configure.ac") 
1003
929
        {
1004
 
            $conf_in = "$SRCDIR/../configure.ac";
 
930
            $conf_in = "../configure.ac";
1005
931
        } 
1006
 
        elsif (-f "$SRCDIR/../configure.in") 
 
932
        elsif (-f "../configure.in") 
1007
933
        {
1008
 
            $conf_in = "$SRCDIR/../configure.in";
 
934
            $conf_in = "../configure.in";
1009
935
        } 
1010
936
        else 
1011
937
        {