~ubuntu-branches/ubuntu/maverick/adblock-plus/maverick-updates

« back to all changes in this revision

Viewing changes to buildtools/setupTestEnvironment.pl

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2010-01-07 17:25:17 UTC
  • mfrom: (0.2.7 upstream)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: james.westby@ubuntu.com-20100107172517-zvjiuls0mbezz8et
Tags: upstream-1.1.3
ImportĀ upstreamĀ versionĀ 1.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
use strict;
21
21
use warnings;
22
22
use Cwd;
23
 
 
24
 
my $version = readFile("version");
25
 
$version =~ s/[^\w\.]//gs;
26
 
 
27
 
opendir(local* LOCALES, "chrome/locale") || die "Could not read directory chrome/locales";
28
 
my @locales = grep {!/[^\w\-]/} readdir(LOCALES);
29
 
@locales = sort {$a eq "en-US" ? -1 : ($b eq "en-US" ? 1 : $a cmp $b)} @locales; 
30
 
closedir(LOCALES);
 
23
use lib qw(buildtools);
 
24
use Packager;
 
25
 
 
26
my $pkg = Packager->new();
 
27
$pkg->readVersion('version');
 
28
$pkg->readLocales('chrome/locale');
 
29
$pkg->readLocaleData('chrome/locale');
31
30
 
32
31
my @files = ();
33
32
my $installManifest = fixupFile(readFile("install.rdf"));
142
141
{
143
142
  my $str = shift;
144
143
 
145
 
  $str =~ s/{{VERSION}}/$version/g;
 
144
  $str =~ s/{{VERSION}}/$pkg->{version}/g;
146
145
  $str =~ s/{{BUILD}}//g;
 
146
  $str =~ s/{{NAME}}/$pkg->{name}/g;
 
147
  $str =~ s/{{DESCRIPTION}}/$pkg->{description}/g;
 
148
  $str =~ s/{{LOCALIZED}}/$pkg->{localizedInfo}/g;
147
149
  $str =~ s/^.*{{LOCALE}}.*$/
148
150
    my @result = ();
149
151
    my $template = $&;
150
 
    foreach my $locale (@locales)
 
152
    foreach my $locale (@{$pkg->{locales}})
151
153
    {
152
154
      push(@result, $template);
153
155
      $result[-1] =~ s~{{LOCALE}}~$locale~g;