From a5b25016f7358874039e3f4db325e6135f336667 Mon Sep 17 00:00:00 2001 From: brian Date: Wed, 19 Aug 2009 17:30:08 +0000 Subject: [PATCH] b=20478 i=wangyb i=adilger Fix bug where version_tag.pl failed when there was no kernel source available. --- lustre/scripts/version_tag.pl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lustre/scripts/version_tag.pl b/lustre/scripts/version_tag.pl index 9ddd8e7..31978cf 100644 --- a/lustre/scripts/version_tag.pl +++ b/lustre/scripts/version_tag.pl @@ -154,6 +154,10 @@ sub get_linuxdir() $dir = $1; } elsif ($line =~ /LINUX_OBJ :?= (.*)/) { $objdir = $1; + } elsif ($line =~ /MODULES_TRUE :?= (.*)/) { + # nothing to do if modules are not being built + return "" + if ($1 eq "#"); last; } } @@ -199,6 +203,13 @@ sub generate_ver($$$) my $mtime = shift; my $linuxdir = shift; + # assume building without modules + my $postfix = ""; + + if ($linuxdir ne "") { + $postfix = "-$kernver"; + } + #print "localtime: " . localtime($mtime) . "\n"; my $lustre_vers = $ENV{LUSTRE_VERS}; @@ -216,9 +227,9 @@ sub generate_ver($$$) # lines. maybe we only want to print -CHANGED when something is changed # and print nothing when it's pristine if ($pristine) { - print "$tag-$show_last-PRISTINE-$linuxdir-$kernver\"\n"; + print "$tag-$show_last-PRISTINE$postfix\"\n"; } else { - print "$tag-$show_last-CHANGED-$linuxdir-$kernver\"\n"; + print "$tag-$show_last-CHANGED$postfix\"\n"; } } -- 1.8.3.1