… | |
… | |
21 | =cut |
21 | =cut |
22 | |
22 | |
23 | package Canary::Stability; |
23 | package Canary::Stability; |
24 | |
24 | |
25 | BEGIN { |
25 | BEGIN { |
26 | $VERSION = 2011; |
26 | $VERSION = 2013; |
27 | } |
27 | } |
28 | |
28 | |
29 | sub sgr { |
29 | sub 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; |
47 | print <<EOF; |
49 | |
48 | |
50 | *** |
49 | *** |
51 | *** Canary::Stability COMPATIBILITY AND SUPPORT CHECK |
50 | *** Canary::Stability COMPATIBILITY AND SUPPORT CHECK |
52 | *** ================================================= |
51 | *** ================================================= |
… | |
… | |
84 | *** This is not a fatal problem - while you might want to upgrade to version |
83 | *** This is not a fatal problem - while you might want to upgrade to version |
85 | *** $minvers (currently installed version: $VERSION) to get better support |
84 | *** $minvers (currently installed version: $VERSION) to get better support |
86 | *** status testing, you might also not want to care at all, and all will |
85 | *** status testing, you might also not want to care at all, and all will |
87 | *** be well as long $distname works well enough for you, as the stability |
86 | *** be well as long $distname works well enough for you, as the stability |
88 | *** canary is only used when installing the distribution. |
87 | *** canary is only used when installing the distribution. |
|
|
88 | *** |
89 | EOF |
89 | EOF |
90 | } elsif ($] < $minperl) { |
90 | } elsif ($] < $minperl) { |
91 | |
91 | |
92 | sgr 33; |
92 | sgr 33; |
93 | print <<EOF; |
93 | print <<EOF; |
… | |
… | |
95 | *** |
95 | *** |
96 | *** Your perl version ($]) is older than the $distname distribution |
96 | *** Your perl version ($]) is older than the $distname distribution |
97 | *** 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 |
98 | *** 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 |
99 | *** won't do anything to make it work if it breaks. |
99 | *** won't do anything to make it work if it breaks. |
|
|
100 | *** |
100 | EOF |
101 | EOF |
|
|
102 | |
|
|
103 | if ($ENV{AUTOMATED_TESTING}) { |
|
|
104 | print <<EOF; |
|
|
105 | *** Since this is an AUTOMATED_TESTING environment, the stability canary |
|
|
106 | *** decided to fail cleanly here, rather than to generate a false test |
|
|
107 | *** result. |
|
|
108 | *** |
|
|
109 | EOF |
|
|
110 | exit 0; |
|
|
111 | } |
|
|
112 | |
101 | } elsif (defined $Internals::StabilityBranchVersion) { |
113 | } elsif (defined $Internals::StabilityBranchVersion) { |
102 | # note to people studying this modules sources: |
114 | # note to people studying this modules sources: |
103 | # the above test is not considered a clean or stable way to |
115 | # the above test is not considered a clean or stable way to |
104 | # test for the stability branch. |
116 | # test for the stability branch. |
105 | |
117 | |
… | |
… | |
108 | *** The stability canary says: chirp! chirp! (it seems to be quite excited) |
120 | *** The stability canary says: chirp! chirp! (it seems to be quite excited) |
109 | *** |
121 | *** |
110 | *** It seems you are running schmorp's stability branch of perl. |
122 | *** It seems you are running schmorp's stability branch of perl. |
111 | *** All should be well, and if it isn't, you should report this as a bug |
123 | *** All should be well, and if it isn't, you should report this as a bug |
112 | *** to the $distname author. |
124 | *** to the $distname author. |
|
|
125 | *** |
113 | EOF |
126 | EOF |
114 | } elsif ($] < 5.021) { |
127 | } elsif ($] < 5.021) { |
115 | #sgr 32; |
128 | #sgr 32; |
116 | print <<EOF; |
129 | print <<EOF; |
117 | *** The stability canary says: chirp! chirp! (it seems to be quite happy) |
130 | *** The stability canary says: chirp! chirp! (it seems to be quite happy) |
118 | *** |
131 | *** |
119 | *** Your version of perl ($]) is quite supported by $distname, nothing |
132 | *** Your version of perl ($]) is quite supported by $distname, nothing |
120 | *** else to be said, hope it comes in handy. |
133 | *** else to be said, hope it comes in handy. |
|
|
134 | *** |
121 | EOF |
135 | EOF |
122 | } else { |
136 | } else { |
123 | sgr 31; |
137 | sgr 31; |
124 | print <<EOF; |
138 | print <<EOF; |
125 | *** The stability canary says: (nothing, it was driven away by harsh weather) |
139 | *** The stability canary says: (nothing, it was driven away by harsh weather) |
… | |
… | |
130 | *** While this might be fatal, it might also be all right - if you run into |
144 | *** While this might be fatal, it might also be all right - if you run into |
131 | *** problems, you might want to downgrade your perl or switch to the |
145 | *** problems, you might want to downgrade your perl or switch to the |
132 | *** stability branch. |
146 | *** stability branch. |
133 | *** |
147 | *** |
134 | *** If everything works fine, you can ignore this message. |
148 | *** If everything works fine, you can ignore this message. |
|
|
149 | *** |
135 | EOF |
150 | EOF |
136 | sgr 0; |
151 | sgr 0; |
137 | print <<EOF; |
152 | print <<EOF; |
138 | *** |
153 | *** |
139 | *** Stability canary mini-FAQ: |
154 | *** Stability canary mini-FAQ: |
… | |
… | |
193 | |
208 | |
194 | =item C<PERL_CANARY_STABILITY_DISABLE=1> |
209 | =item C<PERL_CANARY_STABILITY_DISABLE=1> |
195 | |
210 | |
196 | Disable this modules functionality completely. |
211 | Disable this modules functionality completely. |
197 | |
212 | |
|
|
213 | =item C<AUTOMATED_TESTING=1> |
|
|
214 | |
|
|
215 | When this variable is set to a true value and the perl minimum version |
|
|
216 | requirement is not met, the module will exit, which should skip testing |
|
|
217 | under automated testing environments. |
|
|
218 | |
|
|
219 | This is done to avoid false failure or success reports when the chances of |
|
|
220 | success are already quite low and the failures are not supported by the |
|
|
221 | author. |
|
|
222 | |
198 | =back |
223 | =back |
199 | |
224 | |
200 | =head1 AUTHOR |
225 | =head1 AUTHOR |
201 | |
226 | |
202 | Marc Lehmann <schmorp@schmorp.de> |
227 | Marc Lehmann <schmorp@schmorp.de> |