Whamcloud - gitweb
b=19927
authorbrian <brian>
Fri, 26 Jun 2009 13:20:03 +0000 (13:20 +0000)
committerbrian <brian>
Fri, 26 Jun 2009 13:20:03 +0000 (13:20 +0000)
i=yangsheng
i=wangyb

If the $LUSTRE_VERS environment variable is set, don't bother doing the
legwork to determine the version, and just exit early with it.

lustre/scripts/version_tag.pl

index 0433366..84365b1 100644 (file)
@@ -200,18 +200,21 @@ sub generate_ver($$$)
 
     #print "localtime: " . localtime($mtime) . "\n";
 
 
     #print "localtime: " . localtime($mtime) . "\n";
 
-    my $show_last = mtime2date($mtime);
+    my $lustre_vers = $ENV{LUSTRE_VERS};
 
     print "#define BUILD_VERSION \"";
 
 
     print "#define BUILD_VERSION \"";
 
-    my $lustre_vers = $ENV{LUSTRE_VERS};
-
     if ($lustre_vers) {
         print "$tag-$lustre_vers\"\n";
     if ($lustre_vers) {
         print "$tag-$lustre_vers\"\n";
+        return 0;
+    }
+
+    my $show_last = mtime2date($mtime);
+
     # if we want to get rid of the PRISTINE/CHANGED thing, get rid of these
     # lines.  maybe we only want to print -CHANGED when something is changed
     # and print nothing when it's pristine
     # if we want to get rid of the PRISTINE/CHANGED thing, get rid of these
     # lines.  maybe we only want to print -CHANGED when something is changed
     # and print nothing when it's pristine
-    } elsif ($pristine) {
+    if ($pristine) {
         print "$tag-$show_last-PRISTINE-$linuxdir-$kernver\"\n";
     } else {
         print "$tag-$show_last-CHANGED-$linuxdir-$kernver\"\n";
         print "$tag-$show_last-PRISTINE-$linuxdir-$kernver\"\n";
     } else {
         print "$tag-$show_last-CHANGED-$linuxdir-$kernver\"\n";
@@ -236,7 +239,8 @@ if ($ARGV[0]) {
     chdir($ARGV[0]);
 }
 my $tag = get_tag();
     chdir($ARGV[0]);
 }
 my $tag = get_tag();
-my $mtime = get_latest_mtime();
+my $mtime = get_latest_mtime()
+    if (!defined($ENV{LUSTRE_VERS}));
 
 if ($progname eq "version_tag.pl") {
     my $linuxdir = get_linuxdir();
 
 if ($progname eq "version_tag.pl") {
     my $linuxdir = get_linuxdir();