3
# ***** BEGIN LICENSE BLOCK *****
4
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
6
# The contents of this file are subject to the Mozilla Public License Version
7
# 1.1 (the "License"); you may not use this file except in compliance with
8
# the License. You may obtain a copy of the License at
9
# http://www.mozilla.org/MPL/
11
# Software distributed under the License is distributed on an "AS IS" basis,
12
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13
# for the specific language governing rights and limitations under the
16
# The Original Code is mozilla.org code.
18
# The Initial Developer of the Original Code is
19
# Netscape Communications Corporation.
20
# Portions created by the Initial Developer are Copyright (C) 1998
21
# the Initial Developer. All Rights Reserved.
25
# Alternatively, the contents of this file may be used under the terms of
26
# either of the GNU General Public License Version 2 or later (the "GPL"),
27
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28
# in which case the provisions of the GPL or the LGPL are applicable instead
29
# of those above. If you wish to allow use of your version of this file only
30
# under the terms of either the GPL or the LGPL, and not to allow others to
31
# use your version of this file under the terms of the MPL, indicate your
32
# decision by deleting the provisions above and replace them with the notice
33
# and other provisions required by the GPL or the LGPL. If you do not delete
34
# the provisions above, a recipient may use your version of this file under
35
# the terms of any one of the MPL, the GPL or the LGPL.
37
# ***** END LICENSE BLOCK *****
40
#Input: [-d dir] foo1.java foo2.java
41
#Compares with: foo1.class foo2.class (if -d specified, checks in 'dir',
42
# otherwise assumes .class files in same directory as .java files)
43
#Returns: list of input arguments which are newer than corresponding class
44
#files (non-existant class files are considered to be real old :-)
50
$SEP = 0; # the paltform independent path separator
51
$CFG = 0; # the value of the -cfg flag
53
# determine the path separator
62
if ($ARGV[0] eq '-d') {
68
$classdir = "." . $SEP;
71
# if -cfg is specified, print out the contents of the cfg file to stdout
72
if ($ARGV[0] eq '-cfg') {
80
# Account for the fact that the shell didn't expand *.java by doing it
82
&manuallyExpandArgument("java");
87
foreach $filename (@ARGV) {
88
$classfilename = $classdir;
89
$classfilename .= $filename;
90
$classfilename =~ s/.java$/.class/;
91
# workaround to only build sun/io/* classes when necessary
92
# change the pathname of target file to be consistent
93
# with sun/io subdirectories
95
# sun/io was always getting rebuilt because the java files
96
# were split into subdirectories, but the package names
97
# remained the same. This was confusing outofdate.pl
99
$classfilename =~ s/sun\/io\/extended.\//sun\/io\//;
100
$classfilename =~ s/\.\.\/\.\.\/sun-java\/classsrc\///;
101
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,
102
$ctime,$blksize,$blocks) = stat($filename);
103
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$classmtime,
104
$ctime,$blksize,$blocks) = stat($classfilename);
105
# print $filename, " ", $mtime, ", ", $classfilename, " ", $classmtime, "\n";
106
if ($mtime > $classmtime) {
108
# Only print the file header if we actually have some files to
114
print $filename, " ";
121
# push onto $ARG array all filenames with extension $ext
123
# @param ext the extension of the file
125
sub manuallyExpandArgument {
127
$ext = "\." . $ext; # put it in regexp
129
$result = opendir(DIR, ".");
131
@allfiles = grep(/$ext/, readdir(DIR));
133
foreach $file (@allfiles) {
134
#skip emacs save files
145
$result = open(CFG, $file);