Bugzilla Bug 262822: moved the RecursiveStrip function from makexpi.pl

to deliver.pl so we can regenerate the .chk files using shlibsign after the
NSS softoken shared libraries are stripped. r=cmp. sr=bryner.
Modified Files: deliver.pl makexpi.pl


git-svn-id: svn://10.0.0.236/trunk@167924 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
wtchang%redhat.com
2005-01-17 23:20:31 +00:00
parent 2b4b4f8916
commit 1753627988
2 changed files with 43 additions and 45 deletions

View File

@@ -57,9 +57,12 @@
use Cwd;
use Getopt::Std;
use File::Find;
use File::Path;
getopts('o:s:');
@libraryList = undef;
#// constants
$SUBDIR = "mozilla-installer";
$_DEPTH = "../../..";
@@ -161,6 +164,22 @@ spew("Completed copying build files");
system("perl xptlink.pl -o unix -s $topobjdir/dist -d $STAGE -v");
spew("Completed xptlinking");
#// strip libs
RecursiveStrip($STAGE);
spew("Completed stripping libs in $STAGE");
#// regenerate the NSS .chk files
system("$topobjdir/dist/bin/run-mozilla.sh $topobjdir/dist/bin/shlibsign -v -i $STAGE/psm/bin/libsoftokn3.so");
if(-e "$STAGE/psm/bin/libfreebl_pure32_3.so")
{
system("$topobjdir/dist/bin/run-mozilla.sh $topobjdir/dist/bin/shlibsign -v -i $STAGE/psm/bin/libfreebl_pure32_3.so");
}
if(-e "$STAGE/psm/bin/libfreebl_hybrid_3.so")
{
system("$topobjdir/dist/bin/run-mozilla.sh $topobjdir/dist/bin/shlibsign -v -i $STAGE/psm/bin/libfreebl_hybrid_3.so");
}
spew("Completed signing NSS libraries");
#// call makeall.pl tunneling args (delivers .xpis to $topobjdir/installer/stage)
chdir("$topsrcdir/xpinstall/packager/unix");
system("perl makeall.pl $aVersion $aURLPath $STAGE $XPI");
@@ -211,3 +230,27 @@ sub copy
}
system ("cp ".$_[0]." ".$_[1]);
}
##
# RecursiveStrip
#
# Strips all strippable files by recursing into all directories and calling
# the strip utility on all files.
#
# @param targetDir the directory to traverse recursively
#
sub RecursiveStrip
{
my($targetDir) = $_[0];
undef @libraryList;
find({ wanted => \&find_libraries, no_chdir => 1 }, $targetDir);
# strip all strippable files
system("strip @libraryList") if (defined(@libraryList));
}
sub find_libraries
{
push @libraryList, $File::Find::name;
}

View File

@@ -56,42 +56,6 @@
#
use Cwd;
use File::Find;
@libraryList = undef;
##
# RecursiveStrip
#
# Strips all strippable files by recursing into all directories and calling
# the strip utility on all files.
#
# @param targetDir the directory to traverse recursively
#
sub RecursiveStrip
{
my($targetDir) = $_[0];
my(@dirEntries) = ();
my($entry) = "";
my($saveCwd) = cwd();
undef @libraryList;
find({ wanted => \&find_libraries, no_chdir => 1 }, $targetDir);
@dirEntries = <$targetDir/*>;
# Remove from @libraryList files that shouldn't be stripped. This is a
# temporary workaround to resolve bug 262822.
@libraryList = grep { ! /softokn3/ } @libraryList;
@libraryList = grep { ! /freebl_hybrid_3/ } @libraryList;
@libraryList = grep { ! /freebl_pure32_3/ } @libraryList;
# As stated by Wan-Teh, the true fix is to recreate the *.chk files for
# the softokn3, freebl_hybrid_3, and freebl_pure32_3 shared libraries
# after they have been stripped.
# strip all strippable files
system("strip @libraryList") if (defined(@libraryList));
}
sub MakeJsFile
{
@@ -104,11 +68,6 @@ sub MakeJsFile
}
}
sub find_libraries
{
push @libraryList, $File::Find::name;
}
# Make sure there are at least three arguments
if($#ARGV < 2)
{
@@ -161,10 +120,6 @@ $saveCwdir = cwd();
# unwanted path information.
chdir("$inStagePath/$inComponentName");
# strip libs
print "stripping libs in $inStagePath/$inComponentName...\n";
RecursiveStrip(cwd());
system("zip -r -y $inDestPath/$inComponentName.xpi *");
chdir("$saveCwdir");