~ubuntu-branches/ubuntu/saucy/padre/saucy

« back to all changes in this revision

Viewing changes to inc/Module/Install/Metadata.pm

  • Committer: Package Import Robot
  • Author(s): Dominique Dumont
  • Date: 2012-01-25 16:16:07 UTC
  • mfrom: (1.3.4)
  • Revision ID: package-import@ubuntu.com-20120125161607-ydc0rgxlfqk2ctrb
Tags: 0.94+dfsg1-1
* new upstream version
* watch: updated to match dfsg tag
* debian/not-real-manual.list: updated lib/Padre/Document/Perl.pm entry
* debian/copyright:
  * fixed DEP-5 syntax errors
  * updated copyright years.
  * reformatted with cme
* control: updated dependency list

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
use vars qw{$VERSION @ISA $ISCORE};
8
8
BEGIN {
9
 
        $VERSION = '1.01';
 
9
        $VERSION = '1.04';
10
10
        @ISA     = 'Module::Install::Base';
11
11
        $ISCORE  = 1;
12
12
}
151
151
sub install_as_vendor { $_[0]->installdirs('vendor') }
152
152
 
153
153
sub dynamic_config {
154
 
        my $self = shift;
155
 
        unless ( @_ ) {
156
 
                warn "You MUST provide an explicit true/false value to dynamic_config\n";
157
 
                return $self;
 
154
        my $self  = shift;
 
155
        my $value = @_ ? shift : 1;
 
156
        if ( $self->{values}->{dynamic_config} ) {
 
157
                # Once dynamic we never change to static, for safety
 
158
                return 0;
158
159
        }
159
 
        $self->{values}->{dynamic_config} = $_[0] ? 1 : 0;
 
160
        $self->{values}->{dynamic_config} = $value ? 1 : 0;
160
161
        return 1;
161
162
}
162
163
 
 
164
# Convenience command
 
165
sub static_config {
 
166
        shift->dynamic_config(0);
 
167
}
 
168
 
163
169
sub perl_version {
164
170
        my $self = shift;
165
171
        return $self->{values}->{perl_version} unless @_;
170
176
        # Normalize the version
171
177
        $version = $self->_perl_version($version);
172
178
 
173
 
        # We don't support the reall old versions
 
179
        # We don't support the really old versions
174
180
        unless ( $version >= 5.005 ) {
175
181
                die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
176
182
        }
582
588
sub requires_from {
583
589
        my $self     = shift;
584
590
        my $content  = Module::Install::_readperl($_[0]);
585
 
        my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
 
591
        my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg;
586
592
        while ( @requires ) {
587
593
                my $module  = shift @requires;
588
594
                my $version = shift @requires;