Commit | Line | Data |
acdfdae0 |
1 | |
2 | my $dbic_ver_re = qr/ (\d) \. (\d{2}) (\d{3}) (?: _ (\d{2}) )? /x; # not anchored!!! |
3 | |
4 | my $version_string = Meta->version; |
5 | my $version_value = eval $version_string; |
6 | |
7 | my ($v_maj, $v_min, $v_point, $v_dev) = $version_string =~ /^$dbic_ver_re$/ |
8 | or die sprintf ( |
9 | "Invalid version %s (as specified in %s)\nCurrently valid version formats are M.VVPPP or M.VVPPP_DD\n", |
10 | $version_string, |
11 | Meta->{values}{version_from} || Meta->{values}{all_from} || 'Makefile.PL', |
12 | ) |
13 | ; |
14 | |
15 | if ($v_maj != 0 or $v_min > 8) { |
16 | die "Illegal version $version_string - we are still in the 0.08 cycle\n" |
17 | } |
18 | |
2988a7b9 |
19 | if ($v_point <= 900) { |
20 | die "Illegal version $version_string - we are in the 0.089xx cycle\n" |
9ff52272 |
21 | } |
acdfdae0 |
22 | |
9ff52272 |
23 | Meta->makemaker_args->{DISTVNAME} = Meta->name . "-$version_string-TRIAL" if ( |
d9493b3c |
24 | # all DQ releases ( *after* 0.08800) generate a -TRIAL, no exceptions |
25 | $v_point > 800 |
9ff52272 |
26 | ); |
acdfdae0 |
27 | |
28 | |
29 | my $tags = { map { chomp $_; $_ => 1} `git tag` }; |
30 | # git may not be available |
31 | if (keys %$tags) { |
32 | my $shipped_versions; |
33 | my $shipped_dev_versions; |
34 | |
35 | for (keys %$tags) { |
36 | if ($_ =~ /^v$dbic_ver_re$/) { |
37 | if (defined $4) { |
38 | $shipped_dev_versions->{"$1.$2$3$4"} = 1; |
39 | } |
40 | else { |
41 | $shipped_versions->{"$1.$2$3"} = 1; |
42 | } |
43 | delete $tags->{$_}; |
44 | } |
45 | } |
46 | |
47 | die sprintf "Tags in unknown format found: %s\n", join ', ', keys %$tags |
48 | if keys %$tags; |
49 | } |
50 | |
51 | # keep the Makefile.PL eval happy |
52 | 1; |