[Pkg-mozext-commits] [adblock-plus] 89/464: Add author name to metadata of each locale to make sure Firefox 4 displays it (work around bug 416350)

David Prévot taffit at moszumanska.debian.org
Tue Jul 22 20:44:06 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus.

commit 5746a43f1f28c5132d0a04c6858b716a4e5041f0
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Tue Aug 17 21:27:32 2010 +0200

    Add author name to metadata of each locale to make sure Firefox 4 displays it (work around bug 416350)
---
 Packager.pm              | 14 +++++++++++++-
 create_xpi.pl            |  2 +-
 make_babelzilla_build.pl |  2 +-
 make_release.pl          |  2 +-
 setupTestEnvironment.pl  |  2 +-
 5 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/Packager.pm b/Packager.pm
index 1252e48..329fbef 100644
--- a/Packager.pm
+++ b/Packager.pm
@@ -63,12 +63,13 @@ sub readLocales
 
 sub readLocaleData
 {
-  my ($self, $localesDir) = @_;
+  my ($self, $localesDir, $installManifestFile) = @_;
 
   $self->{localeData} = {};
   $self->{name} = '';
   $self->{description} = '';
   $self->{homepage} = '';
+  $self->{author} = '';
 
   foreach my $locale (@{$self->{locales}})
   {
@@ -92,6 +93,13 @@ sub readLocaleData
     $self->{homepage} = $self->{localeData}{"en-US"}{homepage} if exists($self->{localeData}{"en-US"}{homepage});
   }
 
+  # HACK: Read author name from install manifest
+  if (defined($installManifestFile))
+  {
+    my $installRDF = $self->readFile($installManifestFile);
+    $self->{author} = $1 if $installRDF && $installRDF =~ /<em:creator>\s*([^<>]+?)\s*<\/em:creator>/;
+  }
+
   my $info = "";
   my %translators = ();
   foreach my $locale (sort {$a->{id} cmp $b->{id}} values %{$self->{localeData}})
@@ -114,12 +122,16 @@ sub readLocaleData
     my $description = $self->encodeXML($locale->{description});
     my $homepage = $self->encodeXML($locale->{homepage});
 
+    # Duplicate author in each locale to work around bug 416350
+    my $author = $self->encodeXML($self->{author});
+
     $info .= <<EOT;
 \t<em:localized>
 \t\t<Description>
 \t\t\t<em:locale>$id</em:locale>
 \t\t\t<em:name>$name</em:name>
 \t\t\t<em:description>$description</em:description>
+\t\t\t<em:creator>$author</em:creator>
 \t\t\t<em:homepageURL>$homepage</em:homepageURL>
 \t\t</Description>
 \t</em:localized>
diff --git a/create_xpi.pl b/create_xpi.pl
index de158f4..f13e544 100644
--- a/create_xpi.pl
+++ b/create_xpi.pl
@@ -29,7 +29,7 @@ my $pkg = Packager->new(\%params);
 $pkg->readVersion('version');
 $pkg->readBasename('chrome.manifest');
 $pkg->readLocales('chrome/locale') unless exists $params{locales};
-$pkg->readLocaleData('chrome/locale');
+$pkg->readLocaleData('chrome/locale', 'install.rdf');
 
 $xpiFile = "$pkg->{baseName}.xpi" unless $xpiFile;
 
diff --git a/make_babelzilla_build.pl b/make_babelzilla_build.pl
index 63ce2af..cbf53f8 100644
--- a/make_babelzilla_build.pl
+++ b/make_babelzilla_build.pl
@@ -21,7 +21,7 @@ my $pkg = Packager->new(\%params);
 $pkg->readBasename('chrome.manifest');
 $pkg->readVersion('version');
 $pkg->readLocales('chrome/locale', 1);
-$pkg->readLocaleData('chrome/locale');
+$pkg->readLocaleData('chrome/locale', 'install.rdf');
 
 my $baseName = $pkg->{baseName};
 my $version = $pkg->{version};
diff --git a/make_release.pl b/make_release.pl
index 4965156..e7e5e53 100644
--- a/make_release.pl
+++ b/make_release.pl
@@ -16,7 +16,7 @@ die "This script cannot be called directly, please call the script for a particu
 
 my $pkg = Packager->new({locales => ['en-US']});
 $pkg->readBasename('chrome.manifest');
-$pkg->readLocaleData('chrome/locale');
+$pkg->readLocaleData('chrome/locale', 'install.rdf');
 $pkg->readNameFromManifest('install.rdf') unless $pkg->{name};
 die "Could not extract extension name" unless $pkg->{name};
 
diff --git a/setupTestEnvironment.pl b/setupTestEnvironment.pl
index 173370d..e3cca12 100644
--- a/setupTestEnvironment.pl
+++ b/setupTestEnvironment.pl
@@ -26,7 +26,7 @@ use Packager;
 my $pkg = Packager->new();
 $pkg->readVersion('version');
 $pkg->readLocales('chrome/locale');
-$pkg->readLocaleData('chrome/locale');
+$pkg->readLocaleData('chrome/locale', 'install.rdf');
 
 my @files = ();
 my $installManifest = fixupFile(readFile("install.rdf"));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list