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.2 by root, Thu Jun 4 16:18:26 2015 UTC vs.
Revision 1.5 by root, Thu Jun 25 14:38:27 2015 UTC

1=head1 NAME 1=head1 NAME
2 2
3Canary::Stability - to be done 3Canary::Stability - canary to check perl compatibility for schmorp's modules
4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 use Canary::Stability; 7 # in Makefile.PL
8 use Canary::Stability DISTNAME => 2001, MINIMUM_PERL_VERSION;
8 9
9=head1 DESCRIPTION 10=head1 DESCRIPTION
10 11
11This is just a placeholder module, to be filled in later. 12This module is used by Schmorp's modules during configuration stage to
13test the installed perl for compatibility with his modules.
12 14
13=over 4 15It's not, at this stage, meant as a tool for other module authors,
16although in principle nothing prevents them from subscribing to the same
17ideas.
18
19See the F<Makefile.PL> in L<Coro> or L<AnyEvent> for usage examples.
14 20
15=cut 21=cut
16 22
17package Canary::Stability; 23package Canary::Stability;
18 24
19BEGIN { 25BEGIN {
20 $VERSION = 2001; # the year perl was accomodating enough to developers to foster weird ideas such as Coro 26 $VERSION = 2001;
21} 27}
22 28
23sub sgr { 29sub sgr {
24 # we just assume ANSI almost everywhere 30 # we just assume ANSI almost everywhere
25
26 # red 31, yellow 33, green 32 31 # red 31, yellow 33, green 32
27 32
28 $ENV{PERL_CANARY_STABILITY_COLOUR} ne 0 33 $ENV{PERL_CANARY_STABILITY_COLOUR} ne 0
29 and ((-t STDOUT and length $ENV{TERM}) or $ENV{PERL_CANARY_STABILITY_COLOUR}) 34 and ((-t STDOUT and length $ENV{TERM}) or $ENV{PERL_CANARY_STABILITY_COLOUR})
30 and print "\e[$_[0]m"; 35 and print "\e[$_[0]m";
41 if ($minvers > $VERSION) { 46 if ($minvers > $VERSION) {
42 sgr 33; 47 sgr 33;
43 print <<EOF; 48 print <<EOF;
44 49
45*** 50***
46*** The stability canary says: (nothing, he died of old age). 51*** The stability canary says: (nothing, it died of old age).
47*** 52***
48*** Your Canary::Stability module (used by $distname) is too old. 53*** Your Canary::Stability module (used by $distname) is too old.
49*** This is not a fatal problem - while you might want to upgrade to version 54*** This is not a fatal problem - while you might want to upgrade to version
50*** $minvers (currently installed version: $VERSION) to get better support 55*** $minvers (currently installed version: $VERSION) to get better support
51*** status testing, you might also not want to care at all, and all will 56*** status testing, you might also not want to care at all, and all will
58 63
59 sgr 33; 64 sgr 33;
60 print <<EOF; 65 print <<EOF;
61 66
62*** 67***
63*** The stability canary says: chirp... (it seems a bit unhappy). 68*** The stability canary says: chirp (it seems concerned about something).
64*** 69***
65*** Your perl version ($]) is older than the $distname distribution 70*** Your perl version ($]) is older than the $distname distribution
66*** likes ($minperl). This is not a fatal problem - the module might work 71*** likes ($minperl). This is not a fatal problem - the module might work
67*** well with your version of perl, but it does mean the author likely 72*** well with your version of perl, but it does mean the author likely
68*** won't do anything to make it wokr if it breaks. 73*** won't do anything to make it work if it breaks.
69*** 74***
70 75
71EOF 76EOF
72 } elsif (defined $Internals::StabilityBranchVersion) { 77 } elsif (defined $Internals::StabilityBranchVersion) {
73 # note to people studying this modules sources: 78 # note to people studying this modules sources:
84*** All should be well, and if it isn't, you should report this as a bug 89*** All should be well, and if it isn't, you should report this as a bug
85*** to the $distname author. 90*** to the $distname author.
86*** 91***
87 92
88EOF 93EOF
89 } elsif ($] <= 4.020) { 94 } elsif ($] <= 5.020) {
90 sgr 32; 95 #sgr 32;
91 print <<EOF; 96 print <<EOF;
92 97
93*** 98***
94*** The stability canary says: chirp! chirp! (it seems to be quite happy) 99*** The stability canary says: chirp! chirp! (it seems to be quite happy)
95*** 100***
137*** 142***
138*** How can I skip this prompt on automated installs? 143*** How can I skip this prompt on automated installs?
139*** Set PERL_CANARY_STABILITY_NOPROMPT=1 in your environment. 144*** Set PERL_CANARY_STABILITY_NOPROMPT=1 in your environment.
140*** More info is in the Canary::Stability manpage. 145*** More info is in the Canary::Stability manpage.
141*** 146***
142*** Long version of this FAQ: http://stabilityperl.schmorp.de/faq.html 147*** Long version of this FAQ: http://stableperl.schmorp.de/faq.html
143*** Stability Branch homepage: http://stabilityperl.schmorp.de/ 148*** Stability Branch homepage: http://stableperl.schmorp.de/
144*** 149***
145 150
146EOF 151EOF
147 152
148 unless ($ENV{PERL_CANARY_STABILITY_NOPROMPT}) { 153 unless ($ENV{PERL_CANARY_STABILITY_NOPROMPT}) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines