| 1 | package Sah::Schema::perl::release::version; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |
| 7 | 1 | our $DATE = '2024-02-16'; # DATE | |
| 8 | 1 | our $DIST = 'Sah-SchemaBundle-Perl'; # DIST | |
| 9 | 1 | our $VERSION = '0.050'; # VERSION | |
| 10 | |||
| 11 | 1 | my %all_versions; | |
| 12 | |||
| 13 | # from build version of Module::CoreList | ||
| 14 | 1 | our @build_releases; | |
| 15 | 1 | @build_releases = ("5.030002","5.018002","5.021004","5.031004","5.029009","5.020002","5.027000","5.037000","5.036001","5.031000","5.021000","5.026001","5.037004","5.039001","5.029001","5.008","5.027004","5.034000","5.024000","5.023009","5.033009","5.024004","5.023001","5.033001","5.012005","5.019005","5.017011","5.01901","5.006001","5.019010","5.020003","5.038","5.009001","5.028","5.030003","5.018003","5.032001","5.022001","5.031006","5.01301","5.021006","5.013005","5.027006","5.00503","5.037006","5.013010","5.013009","5.014000","5.014004","5.013001","5.017000","5.009005","5.028002","5.011004","5.019009","5.038002","5.008008","5.000","5.019001","5.008003","5.017004","5.016001","5.011000","5.008007","5.033005","5.023005","5.012001","5.025012","5.017006","5.00504","5.029005","5.008002","5.027011","5.02901","5.037011","5.039005","5.031011","5.018","5.021011","5.028003","5.029010","5.031","5.011003","5.021","5.008000","5.017007","5.017003","5.008004","5.027","5.037","5.017008","5.025010","5.00307","5.035010","5.034","5.024","5.014003","5.02501","5.035005","5.025005","5.03501","5.017002","5.001","5.010000","5.038000","5.028000","5.011002","5.015001","5.014002","5.00405","5.004","5.008006","5.015009","5.02","5.03","5.015005","5.034003","5.014","5.024003","5.031007","5.021007","5.021008","5.031003","5.021003","5.031008","5.011","5.027003","5.037008","5.017","5.037003","5.027008","5.027007","5.037007","5.024002","5.034002","5.025001","5.035001","5.025009","5.01","5","5.035009","5.020000","5.018000","5.030000","5.037002","5.027002","5.018004","5.007003","5.021002","5.031002","5.017001","5.019004","5.019000","5.017009","5.011001","5.016000","5.015002","5.013004","5.014001","5.013000","5.005","5.013006","5.021005","5.03101","5.02101","5.031005","5.027010","5.037010","5.031010","5.021010","5.02701","5.037005","5.027005","5.03701","5.012000","5.019006","5.015007","5.015003","5.025","5.012004","5.035","5.015008","5.034001","5.033004","5.023004","5.024001","5.035002","5.025002","5.023000","5.033000","5.027001","5.029004","5.031009","5.039004","5.021009","5.037001","5.027009","5.031001","5.036000","5.021001","5.026000","5.037009","5.029000","5.032000","5.022000","5.029006","5.035008","5.025003","5.015","5.022004","5.025008","5.035003","5.025007","5.013011","5.035007","5.017010","5.023006","5.011005","5.009004","5.033006","5.01701","5.017005","5.006000","5.019011","5.009000","5.029008","5.039003","5.029003","5.019","5.036003","5.029007","5.026003","5.016","5.025006","5.006002","5.035006","5.009002","5.022002","5.023007","5.033007","5.013","5.023003","5.033008","5.023008","5.033003","5.020001","5.009003","5.030001","5.018001","5.026002","5.036002","5.008005","5.029002","5.039002","5.025000","5.035000","5.033002","5.023002","5.035004","5.022003","5.025004","5.012","5.023","5.013003","5.013008","5.033","5.025011","5.012002","5.013007","5.035011","5.002","5.036","5.019007","5.016003","5.026","5.019008","5.019003","5.029","5.008001","5.008009","5.015006","5.015000","5.032","5.012003","5.022","5.015004","5.013002","5.006","5.010001","5.038001","5.009","5.028001","5.019002","5.016002"); | |
| 16 | 1 | $all_versions{"$_"} = 1 for @build_releases; | |
| 17 | |||
| 18 | # from installed version of Module::CoreList | ||
| 19 | 1 | require Module::CoreList; | |
| 20 | 1 | $all_versions{"$_"} = 1 for keys %Module::CoreList::released; | |
| 21 | |||
| 22 | # in addition to the numified (which, unfortunately, collapses 5.010000 to | ||
| 23 | # 5.10), also provides the x.y.z representations | ||
| 24 | 1 | my @all_versions; | |
| 25 | 1 | for (sort keys %all_versions) { | |
| 26 | 345 | my $major = sprintf "%.0f", $_; | |
| 27 | 345 | my $minor = sprintf "%.0f", ($_ - $major) * 1000; | |
| 28 | 345 | my $rev = sprintf "%.0f", ($_ - $major - $minor/1000) * 1e6; | |
| 29 | 345 | my $xyz = sprintf "%d.%d.%d", $major, $minor, $rev; | |
| 30 | #print "$_ -> $xyz\n"; | ||
| 31 | 345 | $all_versions{$xyz} = 1; | |
| 32 | } | ||
| 33 | |||
| 34 | 1 | our $schema = [str => { | |
| 35 | summary => 'One of known released versions of perl (e.g. 5.010 or 5.10.0)', | ||
| 36 | description => <<'_', | ||
| 37 | |||
| 38 | Use this schema if you want to accept one of the known released versions of | ||
| 39 | perl. | ||
| 40 | |||
| 41 | The list of releases of perl is retrieved from the installed core module | ||
| 42 | <pm:Module::CoreList> during runtime as well as the one used during build. One | ||
| 43 | of both those Module::CoreList instances might not be the latest, so this list | ||
| 44 | might not be up-to-date. To ensure that the list is complete, you will need to | ||
| 45 | keep your copy of Module::CoreList up-to-date. | ||
| 46 | |||
| 47 | The list of version numbers include numified version (which, unfortunately, | ||
| 48 | collapses trailing zeros, e.g. 5.010000 into 5.010) as well as the x.y.z version | ||
| 49 | (e.g. 5.10.0). | ||
| 50 | |||
| 51 | _ | ||
| 52 | in => [sort keys %all_versions], | ||
| 53 | }]; | ||
| 54 | |||
| 55 | 1 | 1; | |
| 56 | # ABSTRACT: One of known released versions of perl (e.g. 5.010 or 5.10.0) | ||
| 57 | |||
| 58 | __END__ | ||