… | |
… | |
21 | =cut |
21 | =cut |
22 | |
22 | |
23 | package Canary::Stability; |
23 | package Canary::Stability; |
24 | |
24 | |
25 | BEGIN { |
25 | BEGIN { |
26 | $VERSION = 2012; |
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 |
… | |
… | |
83 | *** 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 |
84 | *** $minvers (currently installed version: $VERSION) to get better support |
84 | *** $minvers (currently installed version: $VERSION) to get better support |
85 | *** 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 |
86 | *** 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 |
87 | *** canary is only used when installing the distribution. |
87 | *** canary is only used when installing the distribution. |
|
|
88 | *** |
88 | EOF |
89 | EOF |
89 | } elsif ($] < $minperl) { |
90 | } elsif ($] < $minperl) { |
90 | |
91 | |
91 | sgr 33; |
92 | sgr 33; |
92 | print <<EOF; |
93 | print <<EOF; |
… | |
… | |
94 | *** |
95 | *** |
95 | *** Your perl version ($]) is older than the $distname distribution |
96 | *** Your perl version ($]) is older than the $distname distribution |
96 | *** 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 |
97 | *** 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 |
98 | *** won't do anything to make it work if it breaks. |
99 | *** won't do anything to make it work if it breaks. |
|
|
100 | *** |
99 | 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 | |
100 | } elsif (defined $Internals::StabilityBranchVersion) { |
113 | } elsif (defined $Internals::StabilityBranchVersion) { |
101 | # note to people studying this modules sources: |
114 | # note to people studying this modules sources: |
102 | # 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 |
103 | # test for the stability branch. |
116 | # test for the stability branch. |
104 | |
117 | |
… | |
… | |
107 | *** 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) |
108 | *** |
121 | *** |
109 | *** It seems you are running schmorp's stability branch of perl. |
122 | *** It seems you are running schmorp's stability branch of perl. |
110 | *** 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 |
111 | *** to the $distname author. |
124 | *** to the $distname author. |
|
|
125 | *** |
112 | EOF |
126 | EOF |
113 | } elsif ($] < 5.021) { |
127 | } elsif ($] < 5.021) { |
114 | #sgr 32; |
128 | #sgr 32; |
115 | print <<EOF; |
129 | print <<EOF; |
116 | *** 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) |
117 | *** |
131 | *** |
118 | *** Your version of perl ($]) is quite supported by $distname, nothing |
132 | *** Your version of perl ($]) is quite supported by $distname, nothing |
119 | *** else to be said, hope it comes in handy. |
133 | *** else to be said, hope it comes in handy. |
|
|
134 | *** |
120 | EOF |
135 | EOF |
121 | } else { |
136 | } else { |
122 | sgr 31; |
137 | sgr 31; |
123 | print <<EOF; |
138 | print <<EOF; |
124 | *** 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) |
… | |
… | |
129 | *** 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 |
130 | *** 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 |
131 | *** stability branch. |
146 | *** stability branch. |
132 | *** |
147 | *** |
133 | *** If everything works fine, you can ignore this message. |
148 | *** If everything works fine, you can ignore this message. |
|
|
149 | *** |
134 | EOF |
150 | EOF |
135 | sgr 0; |
151 | sgr 0; |
136 | print <<EOF; |
152 | print <<EOF; |
137 | *** |
153 | *** |
138 | *** Stability canary mini-FAQ: |
154 | *** Stability canary mini-FAQ: |
… | |
… | |
192 | |
208 | |
193 | =item C<PERL_CANARY_STABILITY_DISABLE=1> |
209 | =item C<PERL_CANARY_STABILITY_DISABLE=1> |
194 | |
210 | |
195 | Disable this modules functionality completely. |
211 | Disable this modules functionality completely. |
196 | |
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 | |
197 | =back |
223 | =back |
198 | |
224 | |
199 | =head1 AUTHOR |
225 | =head1 AUTHOR |
200 | |
226 | |
201 | Marc Lehmann <schmorp@schmorp.de> |
227 | Marc Lehmann <schmorp@schmorp.de> |