From: amrutjoshi Date: Thu, 20 Feb 2003 11:51:12 +0000 (+0000) Subject: Fixed to make version_tag.pl work outside srcdir. X-Git-Tag: 0.5.20.3~8 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=e96e13f7d747ea2ce6455392bb34f2a75262867c;p=fs%2Flustre-release.git Fixed to make version_tag.pl work outside srcdir. --- diff --git a/lustre/obdclass/Makefile.am b/lustre/obdclass/Makefile.am index 6f7f8fc..03f1e59 100644 --- a/lustre/obdclass/Makefile.am +++ b/lustre/obdclass/Makefile.am @@ -19,7 +19,7 @@ include $(top_srcdir)/Rules # XXX I'm sure there's some automake mv-if-different helper for this. lustre_build_version: - perl $(top_srcdir)/scripts/version_tag.pl $(top_srcdir) > tmpver + perl $(top_srcdir)/scripts/version_tag.pl $(top_srcdir) $(top_builddir)> tmpver cmp -z $(top_builddir)/include/linux/lustre_build_version.h tmpver \ 2> /dev/null && \ $(RM) tmpver || \ diff --git a/lustre/scripts/version_tag.pl b/lustre/scripts/version_tag.pl index a92fef4..3575b87 100644 --- a/lustre/scripts/version_tag.pl +++ b/lustre/scripts/version_tag.pl @@ -145,13 +145,27 @@ sub generate_ver($$$) print "$tag-$show_last-CHANGED-$linuxdir-$kernver\"\n"; } } +chomp(my $cwd = `pwd`); + +# ARGV[0] = srcdir +# ARGV[1] = builddir + +# for get_latest_mtime and get_tag you need to be in srcdir if ($ARGV[0]) { chdir($ARGV[0]); } -my $linuxdir = get_linuxdir(); my $tag = get_tag(); my $mtime = get_latest_mtime(); + +# for get_linuxdir you need to be in builddir + +if ($ARGV[1]) { + chdir($cwd); + chdir($ARGV[1]); +} +my $linuxdir = get_linuxdir(); + generate_ver($tag, $mtime, $linuxdir); exit(0);