~ubuntu-branches/ubuntu/quantal/libyaml-libyaml-perl/quantal-security

« back to all changes in this revision

Viewing changes to inc/Module/Package.pm

  • Committer: Bazaar Package Importer
  • Author(s): gregor herrmann, Ansgar Burchardt, Salvatore Bonaccorso, gregor herrmann
  • Date: 2011-10-01 17:23:11 UTC
  • mfrom: (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20111001172311-lo7q2s7x0nmk3ihz
Tags: 0.37-1
[ Ansgar Burchardt ]
* debian/control: Convert Vcs-* fields to Git.

[ Salvatore Bonaccorso ]
* debian/copyright: Replace DEP5 Format-Specification URL from
  svn.debian.org to anonscm.debian.org URL.

[ gregor herrmann ]
* New upstream release.
* Update copyright years for inc/Module/*.
* Add /me to Uploaders.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#line 1
 
2
##
 
3
# name:      Module::Package
 
4
# abstract:  Postmodern Perl Module Packaging
 
5
# author:    Ingy döt Net <ingy@cpan.org>
 
6
# license:   perl
 
7
# copyright: 2011
 
8
# see:
 
9
# - Module::Package::Plugin
 
10
# - Module::Install::Package
 
11
# - Module::Package::Tutorial
 
12
 
 
13
package Module::Package;
 
14
use 5.005;
 
15
use strict;
 
16
 
 
17
BEGIN {
 
18
    $Module::Package::VERSION = '0.29';
 
19
    $inc::Module::Package::VERSION ||= $Module::Package::VERSION;
 
20
    @inc::Module::Package::ISA = __PACKAGE__;
 
21
}
 
22
 
 
23
sub import {
 
24
    my $class = shift;
 
25
    $INC{'inc/Module/Install.pm'} = __FILE__;
 
26
    unshift @INC, 'inc' unless $INC[0] eq 'inc';
 
27
    eval "use Module::Install 1.01 (); 1" or $class->error($@);
 
28
 
 
29
    package main;
 
30
    Module::Install->import();
 
31
    eval {
 
32
        module_package_internals_version_check($Module::Package::VERSION);
 
33
        module_package_internals_init(@_);
 
34
    };
 
35
    if ($@) {
 
36
        $Module::Package::ERROR = $@;
 
37
        die $@;
 
38
    }
 
39
}
 
40
 
 
41
# XXX Remove this when things are stable.
 
42
sub error {
 
43
    my ($class, $error) = @_;
 
44
    if (-e 'inc' and not -e 'inc/.author') {
 
45
        require Data::Dumper;
 
46
        $Data::Dumper::Sortkeys = 1;
 
47
        my $dump1 = Data::Dumper::Dumper(\%INC);
 
48
        my $dump2 = Data::Dumper::Dumper(\@INC);
 
49
        die <<"...";
 
50
This should not have happened. Hopefully this dump will explain the problem:
 
51
 
 
52
inc::Module::Package: $inc::Module::Package::VERSION
 
53
Module::Package: $Module::Package::VERSION
 
54
inc::Module::Install: $inc::Module::Install::VERSION
 
55
Module::Install: $Module::Install::VERSION
 
56
 
 
57
Error: $error
 
58
 
 
59
%INC:
 
60
$dump1
 
61
\@INC:
 
62
$dump2
 
63
...
 
64
    }
 
65
    else {
 
66
        die $error;
 
67
    }
 
68
}
 
69
 
 
70
1;
 
71