mirror of
https://github.com/dkogan/feedgnuplot.git
synced 2025-12-19 09:11:08 +08:00
main script now has the version
This commit is contained in:
20
Makefile.PL
20
Makefile.PL
@@ -9,12 +9,28 @@ sub parseversion
|
||||
# libpackage-perl (0.02)
|
||||
#
|
||||
# I parse out the 0.02 part
|
||||
open DCH, 'Changes' or die "Couldn't open 'Changes'";
|
||||
open DCH, '<', 'Changes' or die "Couldn't open 'Changes'";
|
||||
my ($version) = <DCH> =~ /^\S+ \s* \( ([0-9\.]+) \)/x
|
||||
or die "Couldn't parse version from 'Changes'";
|
||||
close DCH;
|
||||
|
||||
return $version;
|
||||
# The version is also stored in the script itself. Here I extract that version
|
||||
# number and make sure the two match
|
||||
open PL, '<', 'bin/feedgnuplot' or die "Couldn't open 'bin/feedgnuplot'";
|
||||
|
||||
while(<PL>)
|
||||
{
|
||||
if( /VERSION = ([0-9\.]+)/ )
|
||||
{
|
||||
if ( $1 != $version )
|
||||
{
|
||||
die "Version mismatch. Changes says version is '$version', but 'bin/feedgnuplot' says it is '$1'";
|
||||
}
|
||||
|
||||
return $version;
|
||||
}
|
||||
}
|
||||
die "Couldn't parse version from 'bin/feedgnuplot'";
|
||||
}
|
||||
|
||||
sub MY::libscan
|
||||
|
||||
Reference in New Issue
Block a user