CPAN-Patches-Plugin-Debian

 view release on metacpan or  search on metacpan

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

use File::Path 'make_path';
use Storable 'dclone';
use Test::Deep::NoTest 'eq_deeply';
use File::Copy 'copy';
use Parse::Deb::Control '0.03';
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

		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 }

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.056 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )