Current File : //scripts/locale_import
#!/usr/local/cpanel/3rdparty/bin/perl

# cpanel - scripts/locale_import                   Copyright 2022 cPanel, L.L.C.
#                                                           All rights reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

use strict;

use Getopt::Param              ();
use Cpanel::Locale::Utils::XML ();

my $prm = Getopt::Param->new(
    {
        'no_args_help' => 1,
        'help_coderef' => sub {
            print <<"END_USAGE";
$0 [--locale={locale_tag} [--locale=… --locale=… …]] [--import={path} [--import=… --import=… …]] [--quiet] [--no-rebuild]

Import locales in XML format into the Locale database.

Options:
  --help                Show this help screen
  --quiet               Show less output than normal.
  --locale={locale_tag} Specify a locale to import. You can pass the flag multiple times in order to import multiple locales.
      This works on files in paths that `/usr/local/cpanel/scripts/locale_export --locale={locale_tag}` created.
  --import={file}       Specify the path to an XML file that is importable. You can pass the flag multiple times in order to import multiple files.
      This uses files in any arbitrary location and name.
  --no-rebuild          Do not rebuild the locale database after importing the XML file(s).
  --type={import_type}  Specify the import type as "xml" or "xlf" rather than guessing based on the file extension.

You must specify at least one --locale or --import flag.

The XML files that this script works with are created via /usr/local/cpanel/scripts/locale_export.

If nothing was imported the script will exit with an error status. To examine the reasons nothing was imported do not use --quiet.
END_USAGE
            exit;
        },
    }
);

my $overwrite_keys = $prm->get_param('overwrite-keys') ? 1 : 0;

my $verbose = $prm->get_param('quiet') ? 0 : 1;

my $type = $prm->get_param('type') || '';

my @files;

for my $loc ( $prm->get_param('locale') ) {
    if ( -e "/var/cpanel/locale/export/$loc.xlf" ) {
        push @files, "/var/cpanel/locale/export/$loc.xlf";
    }
    elsif ( -e "/var/cpanel/locale/export/$loc.xml" ) {
        push @files, "/var/cpanel/locale/export/$loc.xml";
    }
    else {
        print "Could not import “$loc” locale because it does not have an export file.\n" if $verbose;
    }
}
my $euid_home;
for my $file ( $prm->get_param('import') ) {

    # expand ~/ that was treated as a string and not expanded by the shell before being put in @ARGV
    if ( substr( $file, 0, 2 ) eq '~/' ) {
        $euid_home ||= ( getpwuid($>) )[7];    # only look it up if needed, and only look it up one time
        substr( $file, 0, 2, "$euid_home/" );
    }

    if ( -e $file ) {
        push @files, $file;
    }
    else {
        print "Could not import “$file” because that file does not exist.\n" if $verbose;
    }
}

if (@files) {
    my @recompile_flags;

    for my $file (@files) {
        my $error = '';
        print "Importing “$file” …\n" if $verbose;
        my $locale_tag;
        if ( $type eq 'xml' ) {
            $locale_tag = Cpanel::Locale::Utils::XML::xml_file_to_locale( $file, \$error );
        }
        elsif ( $type eq 'xlf' ) {
            $locale_tag = Cpanel::Locale::Utils::XML::xlf_file_to_locale( $file, \$error );
        }
        else {
            $locale_tag = Cpanel::Locale::Utils::XML::xml_to_locale( $file, \$error );
        }

        if ($locale_tag) {
            push @recompile_flags, "--locale=$locale_tag";
        }
        else {
            $error ||= 'An unknown error has occurred.';
            print "\tError: $error\n" if $verbose;
            next;
        }
    }

    if (@recompile_flags) {
        if ( $prm->get_param('no-rebuild') ) {
            print "Skipping database rebuild.\n" if $verbose;
        }
        else {

            # We do @recompile_flags as an array and then join it here so we could
            # easily switch to array context system() and/or saferun() based call
            my $cmd = join( ' ', '/usr/local/cpanel/bin/build_locale_databases', @recompile_flags );
            system( $verbose ? $cmd : "$cmd > /dev/null" );
        }
    }
    else {
        print "None of the files were importable\n";
        exit(1);
    }
}
else {
    print "No files to import\n" if $verbose;
    exit 1;
}
Página 2

En construcción …

  • But not, the new 15x wagering demands to your put match causes it to be reduced worthwhile in practice compared to the also offers that have down betting conditions. Nonetheless, the newest zero-put part gives it an advantage over also provides without one.step 3. Games Eligibility (15%) – (4.0/5)The newest $20 added bonus is bound…

  • For those venturing right into the lively globe of on-line gaming, a well-designed incentive can be greater than simply a perk– it becomes part of the experience. I lately had the advantage of working together with the group at OnlyWin to create an engaging visual identification for their latest advertising emphasize, a no deposit bonus…

  • It’s in the much more than simply and therefore sportsbook contains the better opportunity – we view from customer service through to playing have and offers. Apple Shell out are a mobile purse choice much more recognized in the on the internet gambling web sites, especially on the programs which have mobile software. Fruit Pay…

  • A lot more basically, the opportunity calculator allows you to determine the entire odds of an excellent parlay wager, from to around one hundred selections. You can calculate the odds for an individual wager, a double wager, a triple choice (sometimes called a treble), or an excellent parlay level numerous events. It means a great…

  • You can find approximate dates however and Bing within the accurate week-end the entire year pay a visit to. Also, pre-booking a resort can be essential in specific occasion weekends. If you want to spend your day in the Klaipėda sightseeing, here are the greatest details utilizing your own ~7 totally free instances inside Klaipėda…

  • Avoid using an enthusiastic unlicensed gaming webpages as numerous of those are unethical and simply have to discount your finances. If this happens, there’s absolutely nothing can help you about this because there is zero licensing authority to. Our very own pros have verified you to definitely Sportsbetting.united states comes with a valid licenses which…

  • I siti di slot devono concedere preferenza alla variante mobilio, sviluppando app verso iOS addirittura Android ad esempio offrono un’esperienza di artificio snella. Questi concetti sono basilari a i giocatori, affinché influenzano le loro caso di vincita. Un payout di nuovo un RTP alti significano come il inganno è disinteressato anche restituisce una percentuale superiore…

  • Una versione interessante di corrente artificio è Book of Ra Magic, che aggiunge Casinò con prelievi rapidi nuove efficienza anche simboli speciali per rendere l’abilità ancora ancora avvincente. Il servizio di controllo clientela è rapido nel ambire di scegliere i problemi degli utenza. Le sezioni di appoggio sono complete di nuovo offrono informazioni aspetto agli fruitori…

  • Your wear’t buy gender ladysone nj because you perform with prostitutes – you only pay for their organization, and you may sex is a part of it… potentially. Escorts technically wear’t manage sexual features for money, but you to doesn’t indicate there’s zero intercourse involved.

  • Bilan acceptant disponible 24/7, jeu, établissement de bonus , ! arguments en compagnie de règlement allègres. Casino Cat mise dans une composition immersive mais auusi portail dans lesquels complet levant bien animé. En plus de proposer leurs collection utiles, cet salle de jeu compartiment nos rideaux pour examen allés. Avec 100 Quest, le but reste…