Skip to content

Commit

Permalink
Move version detection to its own routine
Browse files Browse the repository at this point in the history
  • Loading branch information
David Christensen committed Nov 3, 2017
1 parent e32dfbf commit a41509c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Makefile.PL
Expand Up @@ -709,20 +709,23 @@ EOF
# if we are building from a git checkout, then set the VERSION based on the
# closest git tag, otherwise use the last hard-coded version

if (-d "./.git") {
$X{VERSION} = qx(git describe --tags --dirty);
chomp $X{VERSION};
system(qq{echo '"$X{VERSION}"' > _ic_version});
}
else {
$X{VERSION} = $VERSION;
}
$X{VERSION} = get_dist_version();
system(qq{echo '"$X{VERSION}"' > _ic_version});

mk_initp(\%X);
delete $X{RPMBUILDDIR};
return \%X;
}

sub get_dist_version {
my $vers = $VERSION;
if (-d "./.git") {
$vers = qx(git describe --tags --dirty);
chomp $vers;
}
$vers;
}

sub regularize {
for (@_) {
s/[\\]\n//g;
Expand Down

0 comments on commit a41509c

Please sign in to comment.