Introduce GOVERNANCE document and empty RESOLUTIONS file.
[dbsrgits/DBIx-Class.git] / maint / Makefile.PL.inc / 29_handle_version.pl
1
2 my $dbic_ver_re = qr/ 0 \. (\d{2}) (\d{2}) (\d{2}) (?: _ (\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 0.MMVVPP or 0.MMVVPP_DD\n",
10     $version_string,
11     Meta->{values}{version_from} || Meta->{values}{all_from} || 'Makefile.PL',
12   )
13 ;
14
15 if ($v_maj > 8) {
16   die "Illegal version $version_string - we are still in the 0.08 cycle\n"
17 }
18
19 #Meta->makemaker_args->{DISTVNAME} = Meta->name . "-$version_string-TRIAL" if (
20 #  ( $v_point > 89 )
21 #);
22
23
24 my $tags = { map { chomp $_; $_ => 1} `git tag` };
25 # git may not be available
26 if (keys %$tags) {
27   my $shipped_versions;
28   my $shipped_dev_versions;
29
30   my $legacy_re = qr/^ v 0 \. (\d{2}) (\d{2}) (\d) (?: _ (\d{2}) )? $/x;
31
32   for (keys %$tags) {
33     if ($_ =~ /^v$dbic_ver_re$/ or $_ =~ $legacy_re ) {
34       if (defined $4) {
35         $shipped_dev_versions->{"0.$1$2$3$4"} = 1;
36       }
37       else {
38         $shipped_versions->{"0.$1$2$3"} = 1;
39       }
40       delete $tags->{$_};
41     }
42   }
43
44   die sprintf "Tags in unknown format found: %s\n", join ', ', keys %$tags
45     if keys %$tags;
46 }
47
48 # keep the Makefile.PL eval happy
49 1;