Current File : //usr/bin/intltool-prepare
#!/usr/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4  -*-

#  Intltool .desktop, .directory Prepare Tool
#
#  Copyright (C) 2001 Free Software Foundation.
#
#  Intltool is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License as
#  published by the Free Software Foundation; either version 2 of the
#  License, or (at your option) any later version.
#
#  Intltool is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#  Author(s): Gediminas Paulauskas <[email protected]>
#	      Kenneth Christiansen <[email protected]>

## Release information
my $PROGRAM      = "intltool-prepare";
my $PACKAGE      = "intltool";
my $VERSION      = "0.50.2";

## Loaded modules
use strict;
use Getopt::Long;
use File::Find;

## Scalars used by the option stuff
my $HELP_ARG    = "0";
my $VERSION_ARG = "0";
my $VERBOSE     = "0";

my @languages;
my @desktop_files;
my $new;
my $file;

my $desktop_extension = "(desktop|soundlist|keys|directory)";

my $keywords = "Name|Comment|GenericName|SwallowTitle|description";

## Always print as the first thing
$| = 1;

## Handle options
GetOptions (
            "help|h"            => \$HELP_ARG,
            "version|v"         => \$VERSION_ARG,
            "verbose|x"         => \$VERBOSE
            ) or &invalid_option;


## Use the supplied arguments
## Check for options.
## This section will check for the different options.

sub split_on_argument {

    if ($VERSION_ARG) {
        &version;

    } elsif ($HELP_ARG) {
        &help;

    } else {
        &main;
    }
}

&split_on_argument;

sub main
{
    print "Working, please wait...\n" if (! $VERBOSE);
    &find_desktop_files;
    &append_keywords;
    &add_to_potfiles;
    &perform_rescue;
    &add_to_cvsignore;
    &fix_makefiles;
    &generate_empty;
}

sub version {
    print <<_EOF_;
${PROGRAM} ${PACKAGE} $VERSION
Written by Gediminas Paulauskas <menesis\@delfi.lt>, 2000.

Copyright (C) 2000 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
_EOF_
    exit;
}

sub help
{
    print <<_EOF_;
Usage: ${PROGRAM} [OPTION] KEYWORD...
Automates preparation steps before software make use of intltool.
KEYWORD is a list of additional key other than "Name", "Comment"
and "description".

  -h, --help                 shows this help page
  -v, --version              shows the version
  -x, --verbose              show lots of feedback

Report bugs to http://bugs.launchpad.net/intltool
_EOF_
    exit;
}

sub invalid_option
{
    ## Handle invalid arguments
    ## my $opt = $ARGV[0];
    ## print "$PROGRAM: invalid option -- $opt\n";
    print STDERR "Try `$PROGRAM --help' for more information.\n";
    exit 1;
}

sub append_keywords
{
    my $arg;
    foreach $arg (@ARGV) {
        $keywords .= "|$arg";
    }
}

sub add_to_potfiles
{
    open FILE, ">>po/POTFILES.in";
    my $intro = 0;
    foreach my $desktop (@desktop_files) {
        next if contains("po/POTFILES.in", "$desktop.in");
    # Print explanation comment only once
        unless ($intro) {
           print FILE "# files added by intltool-prepare\n";
           $intro = 1;
        }
        print FILE "$desktop.in\n";
    }
    close FILE;
}

sub perform_rescue
{
    foreach $file (@desktop_files) {
        &rescue_file($file);
    }
}

sub rescue_file
{
    my ($filename) = @_;
    my ($msgid, $line, $lang);

    print "Rescuing translations from $filename ...\n" if $VERBOSE;

    open ORIG, "<$filename";
    $line = 1;
ENTRY: while (<ORIG>) {
        chomp;
        $line++;
	    my $entry = $_;
        if (($entry =~ /^($keywords)=(.*)$/) ||
            ($entry =~ /^(\s*description)=(.*)$/)) {
            $msgid = $2;
            $msgid =~ s/\\/\\\\/g;
	    $msgid =~ s/\"/\\"/g;
        } elsif (($entry =~ /^($keywords)\[(.*?)\]=(.*)$/) ||
                 ($entry =~ /^(\s*\[)(.*?)\]description=(.*)$/)) {
            $lang = $2;

            my $msgstr = $3;
            $msgstr =~ s/\\/\\\\/g;
            $msgstr =~ s/"/\\"/g;
	    
            $line--;
            if ((-s "po/$lang.po") && 
                (contains("po/$lang.po", "msgid \"$msgid\""))) {
                next ENTRY;
            }
            
            open POFILE, ">>po/$lang.po";

            print POFILE "\n#: $filename.in:$line\n";
            print POFILE "msgid \"$msgid\"\n";
            print POFILE "msgstr \"$msgstr\"\n";

            close POFILE;
        }
    }
}

sub generate_empty
{
    my $all = ' ';
    foreach my $full (@desktop_files) {
        $new = "$full.in";
        $all .= "$new ";
	    print "Generating empty $new ...\n" if $VERBOSE;
        open FULL, "<$full";
        open NEW, ">$new";

        while (<FULL>) {
            unless (
		            (/^($keywords)\[.*?\]=.*$/) ||
        	        (/^\s*\[(.*?)\]description=.*$/)
		           ) {
                if (/^($keywords)=.*$/) {
                    print NEW "_$_";
                } elsif (/^(\s*)(description=.*)$/) {
                    print NEW "$1_$2\n";
                } else {
                    print NEW;
                }
	        }
        }

        close NEW;
    }
    unless ($all eq ' ') {
        print "*** Please add these files to CVS by following command: ***\n"
            . "cvs add$all\n";
    }
}

sub add_to_cvsignore
{
    my $all = ' ';
    my $ign;
    foreach $file (@desktop_files) {
        $file =~ /^(.*\/)?(.+?\.$desktop_extension$)$/;
        if ($1) {
            $ign = "$1.cvsignore";
        } else {
            $ign = ".cvsignore";
        }
        my $basename = $2;

        next if contains($ign, $basename);
	    
        print "Appending $basename to $ign\n" if $VERBOSE;
        open FILE, ">>$ign";
        print FILE "$basename\n";
        $all .= "$file ";
    }
    close FILE;
    unless ($all eq ' ') {
        print "*** Please remove files from CVS by following command: ***\n"
            . "cvs remove -f$all\n";
    }
}

sub fix_makefiles
{
    my $file;
    foreach $file (@desktop_files) {
        my ($makefile, $line);

        $file =~ /^(.*\/)?(.+?\.$desktop_extension$)$/;
        if ($1) {
            $makefile = "$1Makefile.am";
        } else {
            $makefile = "Makefile.am";
        }
        my $basename = $2;
        print "Fixing $basename entry in $makefile\n" if $VERBOSE;

        open MAKE, $makefile;
        open NEWMAKE, ">$makefile.new";
        my $extra = 0;
        while ($line = <MAKE>) {
            $extra = 1 if $line =~ /^EXTRA_DIST/;
            if ($extra) {
                if (($line =~ /$basename/) &&
                    !($line =~ /$basename\.in/)) {
                    $line =~ s/$basename/$basename\.in/;
                }
                $extra = 0 unless $line =~ /\\\s*$/
            } else {
                if ($line =~ /^(\w+)_DATA\s*=\s*$basename\s*$/) {
                    my $name = $1;
                    $line =~ s/^$name\_DATA/$name\_in_files/;
                    $line =~ s/$basename/$basename\.in/;
                    $basename =~ /\.($desktop_extension)$/;
                    my $ext = $1;
                    $line .= "$name\_DATA = \$($name\_in_files:.$ext.in=.$ext)\n";
                    $ext =~ tr/a-z/A-Z/;
                    if (!contains($makefile, "\@INTLTOOL_$ext\_RULE\@")) {
                        $line .= "\@INTLTOOL_$ext\_RULE\@\n";
                    }
                }
            }
            print NEWMAKE $line;
        }
        close NEWMAKE;
        rename "$makefile.new", $makefile;
    }
}

sub contains
{
    my ($name, $str) = @_;
    open CONT, "<$name";
    while (<CONT>) {
         chomp;
         return 1 if $_ eq $str;
    }
    return 0;
}

sub find_desktop_files
{
    if ($VERBOSE) {
        print "Found these interesting files:\n";
    } else {
        print "Finding interesting files...";
    }
    find (\&wanted, '.');
    print "done\n" unless $VERBOSE;
}

sub wanted
{
    if (/\.$desktop_extension$/) {
        my $file = $File::Find::name;
        $file =~ s/\.\///;
        push @desktop_files, $file;
        print "$file\n" if $VERBOSE;
    }
}

# vim: ts=4 sw=4 expandtab
BDM Cricket India: tips, teams, tournaments

Recent Posts

Отнесение к разряду интерактивный казино в 2025 топ-десял намного лучших веб сайтов в видах игры нате действительные аржаны, благонадежные обзоры

А как промахнуться во западней а еще выбрать истинное аптерия для игры в онлайн игорный дом объективные деньги? Регистрация получите и распишитесь ненадежной площадке сопряжена с рисками. Эти операторы нередко обманывают инвесторов, заблокируют их учетные календарь, задерживают выплаты. Вдобавок они могут воздействовать нате норма занятия слотов, вероломствуя барыш отдачи в …

Read More »

Laissez-vous ensorceler par lunivers fascinant de Win Unique Wiz !

Laissez-vous ensorceler par lunivers fascinant de Win Unique Wiz ! Plongée dans l’univers des jeux en ligne Les machines à sous révélatrices Les jeux de table : tradition et stratégie Les bonus et promotions La sécurité des joueurs L’impact des technologies modernes La mobile gaming L’importance du soutien client Les …

Read More »

Svět sázení na dosah ruky Stáhněte si aplikaci Mostbet ještě dnes!

Svět sázení na dosah ruky: Stáhněte si aplikaci Mostbet ještě dnes! Hlavní výhody používání aplikace Mostbet Jak stáhnout aplikaci Mostbet? Dostupné funkce v aplikaci Mostbet Podpora a zákaznický servis Bonusy a propagační akce Závěr a shrnutí Svět sázení na dosah ruky: Stáhněte si aplikaci Mostbet ještě dnes! Sázení je v …

Read More »

Les casinos en ligne en France une expérience à vivre

Les casinos en ligne en France : une expérience à vivre ? Le cadre légal des jeux en ligne en France Les types de jeux disponibles Les avantages des casinos en ligne Les inconvénients et risques associés Les tendances émergentes des casinos en ligne Les jeux mobiles et leur popularité …

Read More »

CASHlib Casinos in Deutschland – Was bieten sie?

CASHlib Casinos gewinnen in Deutschland immer mehr an Bedeutung. Diese Casinos ermöglichen es Spielern, anonym und sicher mit Prepaid-Guthaben zu bezahlen – ganz ohne Bankverbindung oder Kreditkarte. Besonders für Nutzer, die auf Datenschutz und schnelle Transaktionen Wert legen, sind sie eine interessante Alternative.

Was bieten CASHlib Casinos?

  • Schnelle und anonyme Einzahlungen ohne Registrierung bei Drittanbietern
  • Breites Spielangebot von Slots bis zu Live-Dealer-Spielen
  • Regelmäßige Aktionen wie Freispiele und Cashback
  • Attraktive Willkommensboni für neue Spieler
  • EU-lizenzierte Anbieter mit hohen Sicherheitsstandards

Ein großer Vorteil von CASHlib ist, dass keine sensiblen Bankdaten im Casino hinterlegt werden müssen. Die Gutscheine sind online oder in vielen Verkaufsstellen erhältlich und können sofort verwendet werden. Dadurch entfällt auch die Notwendigkeit, persönliche Daten bei Einzahlungen preiszugeben – ein echter Pluspunkt für sicherheitsbewusste Spieler.

Viele spielothekgermany.com/de/spielothek/cashlib-casinos/ bieten zudem mobile Kompatibilität, einfache Menüführung und professionellen Spielerschutz. Wer nach einem unkomplizierten Zahlungsweg mit solider Auswahl an Spielen und Bonusangeboten sucht, wird bei diesen Plattformen fündig. Die Kombination aus Bequemlichkeit, Sicherheit und einem attraktiven Bonusangebot macht CASHlib Casinos zu einer beliebten Wahl für deutsche Nutzer.

slot 7