X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fscripts%2Fversion_tag.pl;h=c464ef62a3af36f9b1a5203bfb3a6d7eb28fc60a;hb=6f0f73eb72f63c8988aa89e2bf05f24b6588e584;hp=61796c90a685dbc1b082f15d499af0faeb8aac0e;hpb=e4189c54470deff4a98f0b2bb03ac6be7ed85ce9;p=fs%2Flustre-release.git diff --git a/lustre/scripts/version_tag.pl b/lustre/scripts/version_tag.pl index 61796c9..c464ef6 100644 --- a/lustre/scripts/version_tag.pl +++ b/lustre/scripts/version_tag.pl @@ -43,8 +43,10 @@ sub get_kernver($$) my $objdir = shift; my $ver = new IO::File; - if (!$ver->open("$objdir/include/linux/utsrelease.h") && + if (!$ver->open("$objdir/include/generated/utsrelease.h") && + !$ver->open("$objdir/include/linux/utsrelease.h") && !$ver->open("$objdir/include/linux/version.h") && + !$ver->open("$dir/include/generated/utsrelease.h") && !$ver->open("$dir/include/linux/utsrelease.h") && !$ver->open("$dir/include/linux/version.h")) { die "Run make dep on '$dir'\n"; @@ -112,8 +114,12 @@ my $path = $0; $path =~ s/(.+)\/.*/\1/; push(@INC, $cwd . "/" . $path); -my $is_git = 0; -my $is_cvs = 0; +# The _first_ argument on the command line may be --make_META +# Remove it from ARGV if found +if ($ARGV[0] eq "--make_META") { + shift @ARGV; + $make_meta = 1; +} # ARGV[0] = srcdir # ARGV[1] = builddir @@ -124,14 +130,10 @@ if ($ARGV[0]) { } if (-d ".git") { - $is_git = 1; require "version_tag-git.pl"; -} elsif (-d "CVS") { - $is_cvs = 1; - require "version_tag-cvs.pl"; } else { die("a tree status can only be determined in an source code control system checkout\n") - if ($progname eq "make_META.pl"); + if ($make_meta); require "version_tag-none.pl"; } @@ -142,7 +144,7 @@ my $tag = get_tag(); my $pristine = is_pristine(); my $buildid = get_buildid(); -if ($progname eq "version_tag.pl") { +if (!$make_meta) { my $kernver = ""; $kernver = get_kernver($am_linuxdir, $am_linuxobjdir) if ($am_linuxdir ne ""); @@ -150,7 +152,7 @@ if ($progname eq "version_tag.pl") { my $linuxdir =~ s/\//\./g; generate_ver($tag, $local_version, $buildid, $linuxdir, $pristine, $kernver, $ENV{LUSTRE_VERS}); -} elsif ($progname eq "make_META.pl") { +} else { print "TAG = $tag\n"; print "VERSION = $am_version\n"; print "BUILDID = $buildid\n";