home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / config / outofdate.pl < prev    next >
Encoding:
Perl Script  |  1998-04-08  |  2.1 KB  |  63 lines

  1. #!perl
  2. #
  3. # The contents of this file are subject to the Netscape Public License
  4. # Version 1.0 (the "NPL"); you may not use this file except in
  5. # compliance with the NPL.  You may obtain a copy of the NPL at
  6. # http://www.mozilla.org/NPL/
  7. #
  8. # Software distributed under the NPL is distributed on an "AS IS" basis,
  9. # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10. # for the specific language governing rights and limitations under the
  11. # NPL.
  12. #
  13. # The Initial Developer of this code under the NPL is Netscape
  14. # Communications Corporation.  Portions created by Netscape are
  15. # Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16. # Reserved.
  17.  
  18. #
  19. #Input: [-d dir] foo1.java foo2.java
  20. #Compares with: foo1.class foo2.class (if -d specified, checks in 'dir', 
  21. #  otherwise assumes .class files in same directory as .java files)
  22. #Returns: list of input arguments which are newer than corresponding class
  23. #files (non-existant class files are considered to be real old :-)
  24. #
  25.  
  26. $found = 1;
  27.  
  28. if ($ARGV[0] eq '-d') {
  29.     $classdir = $ARGV[1];
  30.     $classdir .= "/";
  31.     shift;
  32.     shift;
  33. } else {
  34.     $classdir = "./";
  35. }
  36.  
  37. foreach $filename (@ARGV) {
  38.     $classfilename = $classdir;
  39.     $classfilename .= $filename;
  40.     $classfilename =~ s/.java$/.class/;
  41. # workaround to only build sun/io/* classes when necessary
  42. # change the pathname of target file to be consistent
  43. # with sun/io subdirectories
  44. #
  45. # sun/io was always getting rebuilt because the java files
  46. # were split into subdirectories, but the package names
  47. # remained the same.  This was confusing outofdate.pl
  48. #
  49.     $classfilename =~ s/sun\/io\/extended.\//sun\/io\//;
  50.     ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,
  51.      $ctime,$blksize,$blocks) = stat($filename);
  52.     ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$classmtime,
  53.      $ctime,$blksize,$blocks) = stat($classfilename);
  54. #    print $filename, " ", $mtime, ", ", $classfilename, " ", $classmtime, "\n";
  55.     if ($mtime > $classmtime) {
  56.         print $filename, " ";
  57.         $found = 0;
  58.     }
  59. }
  60.  
  61. print "\n";
  62.