Skip to content

Commit

Permalink
mktar.pl: get version from the configure.ac file
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-naumov committed Sep 29, 2024
1 parent 103e454 commit 81b3c2c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions mktar.pl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Data::Dumper;

my $srcdir = 'src';
my $version_file = "$srcdir/patchlevel.h";
my $version_file = "$srcdir/configure.ac";
my %symlinks =
(
'FAQ' => 'doc/FAQ',
Expand All @@ -26,13 +26,9 @@

my %version;
open IN, "<", $version_file or die "unable to read $version_file: $!";
while (defined(my $line = <IN>))
{
$version{$1} = (defined $3) ? $3 : $4 if $line =~ m{^#\s*define\s+(\w+)\s+("([^"]*)"|(\S+))};
}
$version = $1 if <IN> =~ /AC_INIT\(\[[^\]]+\],\[(\d+\.\d+\.\d+)\]/;
close IN;

my $version = "$version{REV}.$version{VERS}.$version{PATCHLEVEL}";
my $tmpdir = "/tmp/mktar-$^T";
mkdir $tmpdir or die "cannot mkdir $tmpdir: $!";
system "cp -a $srcdir $tmpdir" and die "'cp -a $srcdir $tmpdir' failed: $!";
Expand Down

0 comments on commit 81b3c2c

Please sign in to comment.