Fix native Windows zip build regression from bug 192688 r=bsmedberg

This commit is contained in:
neil%parkwaycc.co.uk 2005-08-17 09:39:54 +00:00
parent 515709a826
commit 52b3387a71

View File

@ -80,9 +80,6 @@ my $jarDir = $chromeDir;
if (defined($::opt_j)) {
$jarDir = $::opt_j;
}
if ($jarDir !~ /^\//) {
$jarDir = getcwd() . '/' . $jarDir;
}
my $verbose = 0;
if (defined($::opt_v)) {
@ -218,7 +215,10 @@ sub JarIt
{
my ($destPath, $jarPath, $jarfile, $args, $overrides) = @_;
my $oldDir = cwd();
my $jarchive = $jarPath . '/' . $jarfile . '.jar';
my @destPath = _moz_splitpath("$destPath/$jarfile");
my @jarchive = _moz_splitpath("$jarPath/$jarfile.jar");
shift @destPath, shift @jarchive while $destPath[0] eq $jarchive[0];
my $jarchive = "../" x @destPath . join("/", @jarchive);
chdir("$destPath/$jarfile");
if ("$fileformat" eq "flat" || "$fileformat" eq "symlink") {
@ -288,6 +288,17 @@ sub JarIt
#print "cd $oldDir\n";
}
sub _moz_splitpath
{
my ($path) = @_;
my @dirs = split(m:/:, $path);
foreach (reverse 0 .. $#dirs) {
splice(@dirs, $_, 1) if $dirs[$_] eq ".";
splice(@dirs, $_, 2) if $dirs[$_] eq "..";
}
return @dirs;
}
sub _moz_rel2abs
{
my ($path, $keep_file) = @_;