~ubuntu-branches/ubuntu/intrepid/gnome-themes/intrepid

« back to all changes in this revision

Viewing changes to intltool-update.in

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-02-27 07:50:20 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20070227075020-oqqz23q0ed58ym5n
Tags: 2.17.92-0ubuntu1
New upstream release.

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.35.1";
 
33
my $VERSION = "0.35.5";
34
34
my $PACKAGE = "intltool";
35
35
 
36
36
## Loaded modules
90
90
$| = 1;
91
91
 
92
92
## Sometimes the source tree will be rooted somewhere else.
93
 
my $SRCDIR = ".";
 
93
my $SRCDIR = $ENV{"srcdir"} || ".";
94
94
my $POTFILES_in;
95
95
 
96
 
$SRCDIR = $ENV{"srcdir"} if $ENV{"srcdir"};
97
96
$POTFILES_in = "<$SRCDIR/POTFILES.in";
98
97
 
99
98
my $devnull = ($^O eq 'MSWin32' ? 'NUL:' : '/dev/null');
318
317
        @buf_potfiles_ignore,
319
318
        @buf_allfiles,
320
319
        @buf_allfiles_sorted,
321
 
        @buf_potfiles_sorted
 
320
        @buf_potfiles_sorted,
 
321
        @buf_potfiles_ignore_sorted
322
322
    );
323
323
 
324
324
    ## Search and find all translatable files
344
344
    ## comparing with POTFILES.in
345
345
    foreach my $ignore ("POTFILES.skip", "POTFILES.ignore")
346
346
    {
347
 
        (-s $ignore) or next;
 
347
        (-s "$SRCDIR/$ignore") or next;
348
348
 
349
349
        if ("$ignore" eq "POTFILES.ignore")
350
350
        {
353
353
        }
354
354
 
355
355
        print "Found $ignore: Ignoring files...\n" if $VERBOSE;
356
 
        open FILE, "<$ignore" or die "ERROR: Failed to open $ignore!\n";
 
356
        open FILE, "<$SRCDIR/$ignore" or die "ERROR: Failed to open $SRCDIR/$ignore!\n";
357
357
            
358
358
        while (<FILE>)
359
359
        {
361
361
        }
362
362
        close FILE;
363
363
 
364
 
        @buf_potfiles = (@buf_potfiles_ignore, @buf_potfiles);
 
364
        @buf_potfiles_ignore_sorted = sort (@buf_potfiles_ignore);
365
365
    }
366
366
 
367
367
    foreach my $file (@buf_i18n_plain)
419
419
                }
420
420
            }       
421
421
 
422
 
            if (/\.GetString ?\(QUOTEDTEXT/)
 
422
            if (/\w\.GetString *\(QUOTEDTEXT/)
423
423
            {
424
424
                if (defined isNotValidMissing (unpack("x3 A*", $file))) {
425
425
                    ## Remove the first 3 chars and add newline
428
428
                last;
429
429
            }
430
430
 
431
 
            if (/_\(QUOTEDTEXT/)
 
431
            ## N_ Q_ and _ are the three macros defined in gi8n.h
 
432
            if (/[NQ]?_ *\(QUOTEDTEXT/)
432
433
            {
433
434
                if (defined isNotValidMissing (unpack("x3 A*", $file))) {
434
435
                    ## Remove the first 3 chars and add newline
491
492
        $in2{$_} = 1;
492
493
    }
493
494
 
 
495
    foreach (@buf_potfiles_ignore_sorted) 
 
496
    {
 
497
        $in2{$_} = 1;
 
498
    }
 
499
 
494
500
    my @result;
495
501
 
496
502
    foreach (@buf_allfiles_sorted)
506
512
    foreach (@buf_potfiles_sorted)
507
513
    {
508
514
        chomp (my $dummy = $_);
509
 
        if ("$dummy" ne "" and ! -f "../$dummy")
 
515
        if ("$dummy" ne "" and !(-f "$SRCDIR/../$dummy" or -f "../$dummy"))
510
516
        {
511
517
            push @buf_potfiles_notexist, $_;
512
518
        }
539
545
            warn "\n" if ($VERBOSE or @result);
540
546
            warn "\e[1mThe following files do not exist anymore:\e[0m\n\n";
541
547
            warn @buf_potfiles_notexist, "\n";
542
 
            warn "Please remove them from POTFILES.in or POTFILES.skip. A file \e[1m'notexist'\e[0m\n".
 
548
            warn "Please remove them from POTFILES.in. A file \e[1m'notexist'\e[0m\n".
543
549
                 "containing this list of absent files has been written in the current directory.\n";
544
550
        }
545
551
    }
559
565
 
560
566
sub GenerateHeaders
561
567
{
562
 
    my $EXTRACT = "@INTLTOOL_EXTRACT@";
563
 
    chomp $EXTRACT;
564
 
 
565
 
    $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} if $ENV{"INTLTOOL_EXTRACT"};
 
568
    my $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} || "intltool-extract";
566
569
 
567
570
    ## Generate the .h header files, so we can allow glade and
568
571
    ## xml translation support
673
676
        } 
674
677
        else 
675
678
        {
676
 
            if ($SRCDIR eq ".") {
677
 
                print OUTFILE "../$_\n";
678
 
            } else {
679
 
                print OUTFILE "$SRCDIR/../$_\n";
680
 
            }
681
 
            $gettext_code = &TextFile_DetermineEncoding ("../$_") if ($gettext_support_nonascii and not defined $forced_gettext_code);
 
679
            print OUTFILE "$SRCDIR/../$_\n";
 
680
            $gettext_code = &TextFile_DetermineEncoding ("$SRCDIR/../$_") if ($gettext_support_nonascii and not defined $forced_gettext_code);
682
681
        }
683
682
 
684
683
        next if (! $gettext_support_nonascii);