[Pkg-mozext-commits] [adblock-plus] 04/464: Exclude test files from the build
David Prévot
taffit at moszumanska.debian.org
Tue Jul 22 20:43:56 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 995db2e778debe8eadcc0096fbf152b0e97afbc5
Author: Wladimir Palant <trev at gtchat.de>
Date: Thu Aug 21 06:39:25 2008 +0000
Exclude test files from the build
--HG--
extra : convert_revision : svn%3Ad8bf93c1-8190-44a8-bb31-1ea94378a4df/trunk%40972
---
Packager.pm | 42 ++++++++++++++++++++++++++++++++++++------
1 file changed, 36 insertions(+), 6 deletions(-)
diff --git a/Packager.pm b/Packager.pm
index 8545ab9..2e78d5c 100644
--- a/Packager.pm
+++ b/Packager.pm
@@ -62,7 +62,15 @@ sub rm_rec
sub cp
{
- my ($self, $fromFile, $toFile) = @_;
+ my ($self, $fromFile, $toFile, $exclude) = @_;
+
+ if ($exclude)
+ {
+ foreach my $file (@$exclude)
+ {
+ return if index($fromFile, $file) >= 0;
+ }
+ }
my $textMode = ($fromFile =~ /\.(manifest|xul|js|xml|xhtml|rdf|dtd|properties|css)$/);
my $extendedTextMode = ($fromFile =~ /\.(?:js|rdf|manifest)$/);
@@ -108,7 +116,15 @@ sub cp
sub cp_rec
{
- my ($self, $fromDir, $toDir) = @_;
+ my ($self, $fromDir, $toDir, $exclude) = @_;
+
+ if ($exclude)
+ {
+ foreach my $file (@$exclude)
+ {
+ return if index($fromDir, $file) >= 0;
+ }
+ }
my @files;
if ($fromDir =~ /\blocale$/ && exists $self->{locales})
@@ -130,11 +146,11 @@ sub cp_rec
{
if (-d "$fromDir/$file")
{
- $self->cp_rec("$fromDir/$file", "$toDir/$file");
+ $self->cp_rec("$fromDir/$file", "$toDir/$file", $exclude);
}
else
{
- $self->cp("$fromDir/$file", "$toDir/$file");
+ $self->cp("$fromDir/$file", "$toDir/$file", $exclude);
}
}
}
@@ -208,15 +224,29 @@ sub makeJAR
mkdir('tmp');
+ my @include = ();
+ my @exclude = ();
foreach my $file (@files)
{
+ if ($file =~ s/^-//)
+ {
+ push @exclude, $file;
+ }
+ else
+ {
+ push @include, $file;
+ }
+ }
+
+ foreach my $file (@include)
+ {
if (-d $file)
{
- $self->cp_rec($file, "tmp/$file");
+ $self->cp_rec($file, "tmp/$file", \@exclude);
}
else
{
- $self->cp($file, "tmp/$file");
+ $self->cp($file, "tmp/$file", \@exclude);
}
}
--
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