CPAN-Patches-Plugin-Debian

 view release on metacpan or  search on metacpan

lib/CPAN/Patches/Plugin/Debian.pm  view on Meta::CPAN

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use File::Path 'make_path';
use Storable 'dclone';
use Test::Deep::NoTest 'eq_deeply';
use File::Copy 'copy';
use File::chdir;
use Debian::Dpkg::Version 'version_compare';
use CPAN::Patches 0.04;
use File::Basename 'basename';
 
sub update_debian {
    my $self = shift;
    my $path = shift || '.';
     
    $self = $self->new()
        if not blessed $self;
     
    my $debian_path             = File::Spec->catdir($path, 'debian');
    my $debian_patches_path     = File::Spec->catdir($debian_path, 'patches');
    my $debian_control_filename = File::Spec->catdir($debian_path, 'control');
    croak 'debian/ folder not found'

script/cpan-patches-update-from-debian  view on Meta::CPAN

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
                if not -d $pkg_perl_folder;
        die $cpan_patches_folder.' no such folder'
                if not -d $cpan_patches_folder;
         
        update_patches($pkg_perl_folder, $cpan_patches_folder);
        update_debian($pkg_perl_folder, $cpan_patches_folder);
         
        return 0;
}
 
sub update_debian {
        my $pkg_perl_folder     = shift or die;
        my $cpan_patches_folder = shift or die;
         
        my $cpanp = CPAN::Patches->new();
         
        my %metas =
                map { %{$_} }
                grep { (%{$_})[1] }    # only with parsable meta
                map {
                        { $_ => eval { $cpanp->read_meta($_) } || 0 }

script/cpan-patches-update-from-debian  view on Meta::CPAN

131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
                                                if -f $dst_inst;
                                }
                                else {
                                        copy($src_inst, $dst_inst) or die $!;
                                }
                        }
                }
        }
}
 
sub update_patches {
        my $pkg_perl_folder     = shift or die;
        my $cpan_patches_folder = shift or die;
         
        my %series =
                map { %{$_} }
                grep { (%{$_})[1] }    # only with parsable meta
                map { { $_ => eval { CPAN::Patches->read_meta($_) } || 0 } }    # parse meta
                map { $_->stringify }
                map { $_->parent->parent }
                map { file($_) }



( run in 0.393 second using v1.01-cache-2.11-cpan-26ccb49234f )