CPAN-Patches-Plugin-Debian
view release on metacpan or search on metacpan
lib/CPAN/Patches/Plugin/Debian.pm view on Meta::CPAN
131415161718192021222324252627282930313233use
CPAN::Patches 0.04;
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
383940414243444546474849505152535455565758
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
131132133134135136137138139140141142143144145146147148149150151
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 )