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.4 by root, Fri Jun 5 00:39:05 2015 UTC vs.
Revision 1.8 by root, Sun Mar 13 03:44:43 2016 UTC

16although in principle nothing prevents them from subscribing to the same 16although in principle nothing prevents them from subscribing to the same
17ideas. 17ideas.
18 18
19See the F<Makefile.PL> in L<Coro> or L<AnyEvent> for usage examples. 19See the F<Makefile.PL> in L<Coro> or L<AnyEvent> for usage examples.
20 20
21=over 4
22
23=cut 21=cut
24 22
25package Canary::Stability; 23package Canary::Stability;
26 24
27BEGIN { 25BEGIN {
28 $VERSION = 2001; 26 $VERSION = 2011;
29} 27}
30 28
31sub sgr { 29sub sgr {
32 # we just assume ANSI almost everywhere 30 # we just assume ANSI almost everywhere
33 # red 31, yellow 33, green 32 31 # red 31, yellow 33, green 32
32 local $| = 1;
34 33
35 $ENV{PERL_CANARY_STABILITY_COLOUR} ne 0 34 $ENV{PERL_CANARY_STABILITY_COLOUR} ne 0
36 and ((-t STDOUT and length $ENV{TERM}) or $ENV{PERL_CANARY_STABILITY_COLOUR}) 35 and ((-t STDOUT and length $ENV{TERM}) or $ENV{PERL_CANARY_STABILITY_COLOUR})
37 and print "\e[$_[0]m"; 36 and print "\e[$_[0]m";
38} 37}
43 $ENV{PERL_CANARY_STABILITY_DISABLE} 42 $ENV{PERL_CANARY_STABILITY_DISABLE}
44 and return; 43 and return;
45 44
46 $minperl ||= 5.008002; 45 $minperl ||= 5.008002;
47 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
48 if ($minvers > $VERSION) { 78 if ($minvers > $VERSION) {
49 sgr 33; 79 sgr 33;
50 print <<EOF; 80 print <<EOF;
51
52***
53*** The stability canary says: (nothing, it died of old age). 81*** The stability canary says: (nothing, it died of old age).
54*** 82***
55*** Your Canary::Stability module (used by $distname) is too old. 83*** Your Canary::Stability module (used by $distname) is too old.
56*** 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
57*** $minvers (currently installed version: $VERSION) to get better support 85*** $minvers (currently installed version: $VERSION) to get better support
58*** 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
59*** 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
60*** canary is only used when installing the distribution. 88*** canary is only used when installing the distribution.
61***
62
63EOF 89EOF
64 } elsif ($] < $minperl) { 90 } elsif ($] < $minperl) {
65 91
66 sgr 33; 92 sgr 33;
67 print <<EOF; 93 print <<EOF;
68
69***
70*** The stability canary says: chirp (it seems concerned about something). 94*** The stability canary says: chirp (it seems concerned about something).
71*** 95***
72*** Your perl version ($]) is older than the $distname distribution 96*** Your perl version ($]) is older than the $distname distribution
73*** 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
74*** 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
75*** won't do anything to make it work if it breaks. 99*** won't do anything to make it work if it breaks.
76***
77
78EOF 100EOF
79 } elsif (defined $Internals::StabilityBranchVersion) { 101 } elsif (defined $Internals::StabilityBranchVersion) {
80 # note to people studying this modules sources: 102 # note to people studying this modules sources:
81 # 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
82 # test for the stability branch. 104 # test for the stability branch.
83 105
84 sgr 32; 106 sgr 32;
85 print <<EOF; 107 print <<EOF;
86
87***
88*** 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)
89*** 109***
90*** It seems you are running schmorp's stability branch of perl. 110*** It seems you are running schmorp's stability branch of perl.
91*** 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
92*** to the $distname author. 112*** to the $distname author.
93***
94
95EOF 113EOF
96 } elsif ($] <= 5.020) { 114 } elsif ($] < 5.021) {
97 #sgr 32; 115 #sgr 32;
98 print <<EOF; 116 print <<EOF;
99
100***
101*** 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)
102*** 118***
103*** Your version of perl ($]) is quite supported by $distname, nothing 119*** Your version of perl ($]) is quite supported by $distname, nothing
104*** else to be said, hope it comes in handy. 120*** else to be said, hope it comes in handy.
105***
106
107EOF 121EOF
108 } else { 122 } else {
109 sgr 31; 123 sgr 31;
110 print <<EOF; 124 print <<EOF;
111
112***
113*** 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)
114*** 126***
115*** It seems you are running perl version $], likely the "official" or 127*** It seems you are running perl version $], likely the "official" or
116*** "standard" version. While there is nothing wrong with doing that, 128*** "standard" version. While there is nothing wrong with doing that,
117*** 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.
118*** 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
119*** 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
120*** stability branch. 132*** stability branch.
121*** 133***
122*** If everything works fine, you can ignore this message. 134*** If everything works fine, you can ignore this message.
123***
124EOF 135EOF
125 sgr 0; 136 sgr 0;
126 print <<EOF; 137 print <<EOF;
138***
127*** Stability canary mini-FAQ: 139*** Stability canary mini-FAQ:
128*** 140***
129*** Do I need to do anything? 141*** Do I need to do anything?
130*** With luck, no. While some distributions are known to fail 142*** With luck, no. While some distributions are known to fail
131*** already, most should probably work. This message is here 143*** already, most should probably work. This message is here
144*** 156***
145*** How can I skip this prompt on automated installs? 157*** How can I skip this prompt on automated installs?
146*** Set PERL_CANARY_STABILITY_NOPROMPT=1 in your environment. 158*** Set PERL_CANARY_STABILITY_NOPROMPT=1 in your environment.
147*** More info is in the Canary::Stability manpage. 159*** More info is in the Canary::Stability manpage.
148*** 160***
149*** Long version of this FAQ: http://stabilityperl.schmorp.de/faq.html 161*** Long version of this FAQ: http://stableperl.schmorp.de/faq.html
150*** Stability Branch homepage: http://stabilityperl.schmorp.de/ 162*** Stability Branch homepage: http://stableperl.schmorp.de/
151*** 163***
152 164
153EOF 165EOF
154 166
155 unless ($ENV{PERL_CANARY_STABILITY_NOPROMPT}) { 167 unless ($ENV{PERL_CANARY_STABILITY_NOPROMPT}) {
186=back 198=back
187 199
188=head1 AUTHOR 200=head1 AUTHOR
189 201
190 Marc Lehmann <schmorp@schmorp.de> 202 Marc Lehmann <schmorp@schmorp.de>
191 http://home.schmorp.de/ 203 http://software.schmorp.de/pkg/Canary-Stability.html
192 204
193=cut 205=cut
194 206
1951 2071
196 208

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines