From c137fdb1ec2f22bb0fddb5d203b9323162b84dac Mon Sep 17 00:00:00 2001 From: "warren%netscape.com" Date: Mon, 11 Sep 2000 23:08:41 +0000 Subject: [PATCH] Made make-jars.pl copy files to dist as well as zip them (with -c option). git-svn-id: svn://10.0.0.236/trunk@78794 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/config/make-jars.pl | 52 +++++++++++++++++++++++++------------ mozilla/config/rules.mak | 2 +- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/mozilla/config/make-jars.pl b/mozilla/config/make-jars.pl index 1bc7f152416..dda677bc8ec 100644 --- a/mozilla/config/make-jars.pl +++ b/mozilla/config/make-jars.pl @@ -30,10 +30,22 @@ sub Cleanup sub JarIt { - my ($jarfile, $args) = @_; - system "zip -u $jarfile $args\n" || die "zip failed"; + my ($destPath, $jarfile, $copyFiles, $args, $overrides) = @_; + if ($copyFiles eq true) { + foreach $file (split(' ', "$args $overrides")) { + EnsureFileInDir($destPath, $file); + } + } + + if (!($args eq "")) { + system "zip -u $destPath/$jarfile $args\n" || die "zip failed"; + } + if (!($overrides eq "")) { + system "zip $destPath/$jarfile $overrides\n" || die "zip failed"; + } + my $cwd = cwd(); - print "+++ jarred $cwd => $jarfile\n"; + print "+++ made chrome $cwd => $destPath/$jarfile\n"; Cleanup(); } @@ -137,22 +149,20 @@ if (defined($opt_d)) { $destPath = $opt_d; } +getopt("c:"); + +my $copyFiles = false; +if (defined($opt_c)) { + $copyFiles = true; +} + while (<>) { chomp; start: if (/^([\w\d.\-\\\/]+)\:\s*$/) { - my $jarfileDest = $1; - my $jarfile = "$destPath/$jarfileDest"; - $jarfileDest =~ s/[^\/]+$//; - if ( ! -e "$destPath/$jarfileDest" ) { - my $currentDir = cwd(); - chdir($destPath); - MkDirs($jarfileDest,"."); - chdir($currentDir); - @cleanupList = (); - } - + my $jarfile = $1; my $args = ""; + my $overrides = ""; while (<>) { if (/^\s+([\w\d.\-\\\/]+)\s*(\([\w\d.\-\\\/]+\))?$\s*/) { my $dest = $1; @@ -164,15 +174,25 @@ while (<>) { EnsureFileInDir($dest, $srcPath); $args = "$args$dest "; + } elsif (/^\+\s+([\w\d.\-\\\/]+)\s*(\([\w\d.\-\\\/]+\))?$\s*/) { + my $dest = $1; + my $srcPath = $2; + + if ( $srcPath ) { + $srcPath = substr($srcPath,1,-1); + } + + EnsureFileInDir($dest, $srcPath); + $overrides = "$overrides$dest "; } elsif (/^\s*$/) { # end with blank line last; } else { - JarIt($jarfile, $args); + JarIt($destPath, $jarfile, $copyFiles, $args, $overrides); goto start; } } - JarIt($jarfile, $args); + JarIt($destPath, $jarfile, $copyFiles, $args, $overrides); } elsif (/^\s*\#.*$/) { # skip comments diff --git a/mozilla/config/rules.mak b/mozilla/config/rules.mak index d34c32fb641..53d54d6ba48 100644 --- a/mozilla/config/rules.mak +++ b/mozilla/config/rules.mak @@ -643,7 +643,7 @@ install:: chrome !if exist($(JAR_MANIFEST)) chrome:: - $(PERL) $(DEPTH)\config\make-jars.pl -d $(DIST)\bin\chrome < $(JAR_MANIFEST) + $(PERL) $(DEPTH)\config\make-jars.pl -c -d $(DIST)\bin\chrome < $(JAR_MANIFEST) !endif !if "$(CHROME_TYPE)" != "$(NULL)"