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.

52 lines
1.0 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. while (<>) {
  25. if (/^#define VER_PRODUCTBUILD\b/) {
  26. chop;
  27. ($define, $symbol, $cm1, $cm2, $cm3, $buildno) = split ' ';
  28. $buildno++;
  29. print $define, " ", $symbol, "\t", $cm1, " " , $cm2, " " , $cm3, "\t", $buildno, "\n";
  30. } else {
  31. print;
  32. }
  33. }
  34. #
  35. # Restore the output
  36. #
  37. close STDOUT;
  38. open STDOUT, ">&SAVEOUT";
  39. #
  40. # Move temp file to the one
  41. #
  42. system(("copy " . $tmpfile . " " . $infile));
  43. system(("del " . $tmpfile));