X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fscripts%2Fversion_tag.pl;h=04333665d68875c953815f6bbfeed71e79852fba;hp=8ae53ae810622498be341414eab14feb528d144e;hb=bc059a92353ad884d2659a60383cd6154bc8dad3;hpb=4b550a38c5e261abe74ec323780d22c631988f16 diff --git a/lustre/scripts/version_tag.pl b/lustre/scripts/version_tag.pl index 8ae53ae..0433366 100644 --- a/lustre/scripts/version_tag.pl +++ b/lustre/scripts/version_tag.pl @@ -144,7 +144,7 @@ sub get_latest_mtime() sub get_linuxdir() { my $config = new IO::File; - my ($line, $dir); + my ($line, $dir, $objdir); if (!$config->open("autoMakefile")) { die "Run ./configure first\n"; } @@ -152,16 +152,19 @@ sub get_linuxdir() chomp($line); if ($line =~ /LINUX :?= (.*)/) { $dir = $1; + } elsif ($line =~ /LINUX_OBJ :?= (.*)/) { + $objdir = $1; last; } } $config->close(); my $ver = new IO::File; - if (!$ver->open("$dir/include/linux/utsrelease.h")) { - if (!$ver->open("$dir/include/linux/version.h")) { + if (!$ver->open("$objdir/include/linux/utsrelease.h") && + !$ver->open("$objdir/include/linux/version.h") && + !$ver->open("$dir/include/linux/utsrelease.h") && + !$ver->open("$dir/include/linux/version.h")) { die "Run make dep on $dir\n"; } - } while(defined($line = <$ver>)) { $line =~ /\#define UTS_RELEASE "(.*)"/; if ($1) {