From ed3f1134460546888e2306262d88d6886beae7e1 Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Fri, 11 Jan 2013 11:38:58 -0700 Subject: [PATCH] RedHat: fix makesrpm.pl version discovery We stopped defining the OpenAFS version in AM_INIT_AUTOMAKE a while back. Use git-version script instead. Change-Id: I56ef9792cf653921161e177a7c6f143a4b41ace2 Reviewed-on: http://gerrit.openafs.org/8908 Reviewed-by: Ken Dreyer Tested-by: Ken Dreyer Reviewed-by: Derrick Brashear --- src/packaging/RedHat/makesrpm.pl | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/packaging/RedHat/makesrpm.pl b/src/packaging/RedHat/makesrpm.pl index 54193d0b71..7a238f3639 100755 --- a/src/packaging/RedHat/makesrpm.pl +++ b/src/packaging/RedHat/makesrpm.pl @@ -43,24 +43,14 @@ die "Unable to find unpacked source code\n" if !$vdir; my $srcdir = $tmpdir."/".$vdir; -# Work out which version we're dealing with from the configure.ac file +# Work out which version we're dealing with from git-version script +# (which may use a .version file) my $afsversion; my $linuxver; my $linuxrel; -my $fh = new IO::File $srcdir."/configure.ac" - or die "Unable to find unpacked configure.ac file"; -while(<$fh>) { - next if (/^\s*\#/); - - if (/AM_INIT_AUTOMAKE\(openafs,(.*)\)/) { - $afsversion = $1; - next; - } -} -undef $fh; if (not defined($afsversion)) { - $afsversion = `"$srcdir/build-tools/git-version" "$srcdir"`; + $afsversion = `"/bin/sh" "$srcdir/build-tools/git-version" "$srcdir"`; } # Build the Linux version and release information from the package version