[Pkg-mozext-commits] [adblock-plus-element-hiding-helper] 133/483: Make create_xpi.pl for EHH and ABP Watcher a copy of the generic script in ABP directory

David Prévot taffit at moszumanska.debian.org
Thu Jan 22 21:41:34 UTC 2015


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

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

commit 7b84d2d343cfbe8381b6e1eca8f5b4c6492bf93a
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Mon Oct 27 09:46:49 2008 +0100

    Make create_xpi.pl for EHH and ABP Watcher a copy of the generic script in ABP directory
---
 create_xpi.pl | 32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/create_xpi.pl b/create_xpi.pl
index dfec96a..0f5fd5d 100644
--- a/create_xpi.pl
+++ b/create_xpi.pl
@@ -7,12 +7,19 @@
 
 use strict;
 use warnings;
-use lib qw(..);
+use lib qw(. ..);
 use Packager;
 
+my $manifest = readFile("chrome.manifest");
+unless ($manifest =~ /\bjar:chrome\/(\S+?)\.jar\b/)
+{
+  die "Could not find JAR file name in chrome.manifest";
+}
+my $baseName = $1;
+
 my %params = ();
 
-my $xpiFile = shift @ARGV || "elemhidehelper.xpi";
+my $xpiFile = shift @ARGV || "$baseName.xpi";
 if (@ARGV && $ARGV[0] =~ /^\+/)
 {
   $params{devbuild} = $ARGV[0];
@@ -26,8 +33,23 @@ $pkg->readVersion('version');
 $pkg->readLocales('chrome/locale') unless exists $params{locales};
 
 chdir('chrome');
-$pkg->makeJAR('elemhidehelper.jar', 'content', 'skin', 'locale');
+$pkg->makeJAR("$baseName.jar", 'content', 'skin', 'locale', '-/tests', '-/mochitest');
 chdir('..');
 
-$pkg->makeXPI($xpiFile, 'chrome/elemhidehelper.jar', 'defaults', 'install.js', 'install.rdf', 'chrome.manifest');
-unlink('chrome/elemhidehelper.jar');
+my @files = grep {-e $_} ('components', 'defaults', 'install.js', 'install.rdf', 'chrome.manifest');
+
+$pkg->makeXPI($xpiFile, "chrome/$baseName.jar", @files);
+unlink("chrome/$baseName.jar");
+
+sub readFile
+{
+  my $file = shift;
+
+  open(local *FILE, "<", $file) || die "Could not read file '$file'";
+  binmode(FILE);
+  local $/;
+  my $result = <FILE>;
+  close(FILE);
+
+  return $result;
+}

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



More information about the Pkg-mozext-commits mailing list