ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Canary-Stability/Stability.pm
(Generate patch)

Comparing Canary-Stability/Stability.pm (file contents):
Revision 1.7 by root, Mon Jun 29 00:02:01 2015 UTC vs.
Revision 1.8 by root, Sun Mar 13 03:44:43 2016 UTC

21=cut 21=cut
22 22
23package Canary::Stability; 23package Canary::Stability;
24 24
25BEGIN { 25BEGIN {
26 $VERSION = 2006; 26 $VERSION = 2011;
27} 27}
28 28
29sub sgr { 29sub sgr {
30 # we just assume ANSI almost everywhere 30 # we just assume ANSI almost everywhere
31 # red 31, yellow 33, green 32 31 # red 31, yellow 33, green 32
42 $ENV{PERL_CANARY_STABILITY_DISABLE} 42 $ENV{PERL_CANARY_STABILITY_DISABLE}
43 and return; 43 and return;
44 44
45 $minperl ||= 5.008002; 45 $minperl ||= 5.008002;
46 46
47 sgr 33;
48 print <<EOF;
49
50***
51*** Canary::Stability COMPATIBILITY AND SUPPORT CHECK
52*** =================================================
53***
54*** Hi!
55***
56*** I do my best to provide predictable and reliable software.
57***
58*** However, in recent releases, P5P (who maintain perl) have been
59*** introducing regressions that are sometimes subtle and at other times
60*** catastrophic, often for personal preferences with little or no concern
61*** for existing code, most notably CPAN.
62***
63*** For this reason, it has become very hard for me to maintain the level
64*** of reliability and support I have committed myself to in the past, at
65*** least with some perl versions: I simply can't keep up working around new
66*** bugs or gratituous incompatibilities, and in turn you might suffer from
67*** unanticipated problems.
68***
69*** Therefore I have introduced a support and compatibility check, the results
70*** of which follow below, together with a FAQ and some recommendations.
71***
72*** This check is just to let you know that there might be a risk, so you can
73*** make judgement calls on how to proceed - it will not keep the module from
74*** installing or working.
75***
76EOF
77
47 if ($minvers > $VERSION) { 78 if ($minvers > $VERSION) {
48 sgr 33; 79 sgr 33;
49 print <<EOF; 80 print <<EOF;
50
51***
52*** The stability canary says: (nothing, it died of old age). 81*** The stability canary says: (nothing, it died of old age).
53*** 82***
54*** Your Canary::Stability module (used by $distname) is too old. 83*** Your Canary::Stability module (used by $distname) is too old.
55*** This is not a fatal problem - while you might want to upgrade to version 84*** This is not a fatal problem - while you might want to upgrade to version
56*** $minvers (currently installed version: $VERSION) to get better support 85*** $minvers (currently installed version: $VERSION) to get better support
57*** status testing, you might also not want to care at all, and all will 86*** status testing, you might also not want to care at all, and all will
58*** be well as long $distname works well enough for you, as the stability 87*** be well as long $distname works well enough for you, as the stability
59*** canary is only used when installing the distribution. 88*** canary is only used when installing the distribution.
60***
61
62EOF 89EOF
63 } elsif ($] < $minperl) { 90 } elsif ($] < $minperl) {
64 91
65 sgr 33; 92 sgr 33;
66 print <<EOF; 93 print <<EOF;
67
68***
69*** The stability canary says: chirp (it seems concerned about something). 94*** The stability canary says: chirp (it seems concerned about something).
70*** 95***
71*** Your perl version ($]) is older than the $distname distribution 96*** Your perl version ($]) is older than the $distname distribution
72*** likes ($minperl). This is not a fatal problem - the module might work 97*** likes ($minperl). This is not a fatal problem - the module might work
73*** well with your version of perl, but it does mean the author likely 98*** well with your version of perl, but it does mean the author likely
74*** won't do anything to make it work if it breaks. 99*** won't do anything to make it work if it breaks.
75***
76
77EOF 100EOF
78 } elsif (defined $Internals::StabilityBranchVersion) { 101 } elsif (defined $Internals::StabilityBranchVersion) {
79 # note to people studying this modules sources: 102 # note to people studying this modules sources:
80 # the above test is not considered a clean or stable way to 103 # the above test is not considered a clean or stable way to
81 # test for the stability branch. 104 # test for the stability branch.
82 105
83 sgr 32; 106 sgr 32;
84 print <<EOF; 107 print <<EOF;
85
86***
87*** The stability canary says: chirp! chirp! (it seems to be quite excited) 108*** The stability canary says: chirp! chirp! (it seems to be quite excited)
88*** 109***
89*** It seems you are running schmorp's stability branch of perl. 110*** It seems you are running schmorp's stability branch of perl.
90*** All should be well, and if it isn't, you should report this as a bug 111*** All should be well, and if it isn't, you should report this as a bug
91*** to the $distname author. 112*** to the $distname author.
92***
93
94EOF 113EOF
95 } elsif ($] < 5.021) { 114 } elsif ($] < 5.021) {
96 #sgr 32; 115 #sgr 32;
97 print <<EOF; 116 print <<EOF;
98
99***
100*** The stability canary says: chirp! chirp! (it seems to be quite happy) 117*** The stability canary says: chirp! chirp! (it seems to be quite happy)
101*** 118***
102*** Your version of perl ($]) is quite supported by $distname, nothing 119*** Your version of perl ($]) is quite supported by $distname, nothing
103*** else to be said, hope it comes in handy. 120*** else to be said, hope it comes in handy.
104***
105
106EOF 121EOF
107 } else { 122 } else {
108 sgr 31; 123 sgr 31;
109 print <<EOF; 124 print <<EOF;
110
111***
112*** The stability canary says: (nothing, it was driven away by harsh weather) 125*** The stability canary says: (nothing, it was driven away by harsh weather)
113*** 126***
114*** It seems you are running perl version $], likely the "official" or 127*** It seems you are running perl version $], likely the "official" or
115*** "standard" version. While there is nothing wrong with doing that, 128*** "standard" version. While there is nothing wrong with doing that,
116*** standard perl versions 5.022 and up are not supported by $distname. 129*** standard perl versions 5.022 and up are not supported by $distname.
117*** While this might be fatal, it might also be all right - if you run into 130*** While this might be fatal, it might also be all right - if you run into
118*** problems, you might want to downgrade your perl or switch to the 131*** problems, you might want to downgrade your perl or switch to the
119*** stability branch. 132*** stability branch.
120*** 133***
121*** If everything works fine, you can ignore this message. 134*** If everything works fine, you can ignore this message.
122***
123EOF 135EOF
124 sgr 0; 136 sgr 0;
125 print <<EOF; 137 print <<EOF;
138***
126*** Stability canary mini-FAQ: 139*** Stability canary mini-FAQ:
127*** 140***
128*** Do I need to do anything? 141*** Do I need to do anything?
129*** With luck, no. While some distributions are known to fail 142*** With luck, no. While some distributions are known to fail
130*** already, most should probably work. This message is here 143*** already, most should probably work. This message is here

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines