3 my ($last_mtime, $pristine);
5 # for CVS, the buildid is that old "latest mtime" process
9 return mtime2date($last_mtime);
13 # Use the CVS tag first otherwise use the portals version
20 my $tagfile = new IO::File;
21 if (!$tagfile->open("lustre/CVS/Tag")) {
22 my $verfile = new IO::File;
23 if (!$verfile->open("config.h")) {
26 while(defined($line = <$verfile>)) {
27 $line =~ /\#define VERSION "(.*)"/;
45 sub get_latest_mtime()
48 my %months=("Jan" => 0, "Feb" => 1, "Mar" => 2, "Apr" => 3, "May" => 4,
49 "Jun" => 5, "Jul" => 6, "Aug" => 7, "Sep" => 8, "Oct" => 9,
50 "Nov" => 10, "Dec" => 11);
55 # if we got here, we are operating in a CVS checkout
56 my @entries = `find . -name Entries`;
58 foreach $entry_file (@entries) {
60 my $entry = new IO::File;
61 if (!$entry->open($entry_file)) {
62 die "unable to open $entry_file: $!\n";
65 while (defined($line = <$entry>)) {
67 #print "line: $line\n";
68 my ($junk, $file, $version, $date) = split(/\//, $line);
70 #print "junk: $junk\nfile: $file\nver: $version\ndate: $date\n";
71 #print "last_mtime: " . localtime($last_mtime) . "\n";
74 $file eq "lustre.spec.in") {
75 # also used to skip: "$file !~ m/\.(c|h|am|in)$/" but I see
76 # no good reason why only the above file patterns should
77 # count towards pristine/changed. it should be any file,
82 my $cur_dir = $entry_file;
83 $cur_dir =~ s/\/CVS\/Entries$//;
84 my @statbuf = stat("$cur_dir/$file");
85 my $mtime = $statbuf[9];
86 if (!defined($mtime)) {
87 die "unable to get mtime of $cur_dir/$file: $!\n";
89 my $local_date = gmtime($mtime);
90 if ($local_date ne $date &&
91 $file ne "lustre.spec.in") {
92 #print "$file : " . localtime($mtime) . "\n";
96 if ($mtime > $last_mtime) {
101 my @t = split(/ +/, $date);
103 #print "skipping: $date\n";
106 my ($hours, $min, $sec) = split(/:/, $t[3]);
107 my ($mon, $mday, $year) = ($t[1], $t[2], $t[4]);
109 $mon = $months{$mon};
110 $secs = timelocal($sec, $min, $hours, $mday, $mon, $year);
111 if ($secs > $last_mtime) {
118 return $last_mtime, $pristine;
127 my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
131 my $show_last = sprintf("%04d%02d%02d%02d%02d%02d", $year, $mon, $mday,
145 ($last_mtime, $pristine) = get_latest_mtime();