Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.1 KiB

  1. #
  2. # Increases build number everytime this script is run.
  3. #
  4. # Must be in the same directory as $infile.
  5. #
  6. $infile = "aimmver.h";
  7. $tmpfile = "__tmp__.h";
  8. #
  9. # Make a backup
  10. #
  11. $time = localtime();
  12. $time =~ tr/ :/_./;
  13. system("mkdir ./rev.evas > /NUL 2>&1");
  14. system(("copy " . $infile . " rev.evas\\" . $infile . $time));
  15. #
  16. # Redirect the input and output
  17. #
  18. open STDIN, ("<" . $infile) or die "cannot open input file";
  19. open SAVEOUT, ">&STDOUT";
  20. open STDOUT, (">". $tmpfile) or die "cannot open temporary file";
  21. #
  22. # Do it!
  23. #
  24. ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
  25. $mon = ($mon +1 ) * 100 + 1200;
  26. $mon = $mon + $mday;
  27. while (<>) {
  28. if (/^#define VER_PRODUCTBUILD\b/) {
  29. chop;
  30. ($define, $symbol, $cm1, $cm2, $cm3, $buildno) = split ' ';
  31. $buildno = $mon;
  32. print $define, " ", $symbol, "\t", $cm1, " " , $cm2, " " , $cm3, "\t", $buildno, "\n";
  33. } else {
  34. print;
  35. }
  36. }
  37. #
  38. # Restore the output
  39. #
  40. close STDOUT;
  41. open STDOUT, ">&SAVEOUT";
  42. #
  43. # Move temp file to the one
  44. #
  45. system(("copy " . $tmpfile . " " . $infile));
  46. system(("del " . $tmpfile));