r52954 - in /trunk/dh-make-perl: TODO lib/DhMakePerl.pm
dmn at users.alioth.debian.org
dmn at users.alioth.debian.org
Wed Feb 17 18:37:07 UTC 2010
Author: dmn
Date: Wed Feb 17 18:37:00 2010
New Revision: 52954
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=52954
Log:
drop quiltifications whe source-format is '3.0 (quilt)'
TODO--
The part that quiltifies in non-'3.0 (quilt)' source formats still doesn't use
the --with=quilt dh option, but we may drop support to this completely, no?
Modified:
trunk/dh-make-perl/TODO
trunk/dh-make-perl/lib/DhMakePerl.pm
Modified: trunk/dh-make-perl/TODO
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/TODO?rev=52954&op=diff
==============================================================================
--- trunk/dh-make-perl/TODO (original)
+++ trunk/dh-make-perl/TODO Wed Feb 17 18:37:00 2010
@@ -26,7 +26,6 @@
* --refresh: add --only <file> option: done, but "--only control" also
touches d/rules if quilt is used
* quiltification: switch to "--with quilt" in d/rules and adjust build deps
- -- or just to "3.0 (quilt)"
+ in non-'3.0 (quilt)' source formats
* Don't add libmodule-build-perl to Build-Depends if Makefile.PL is also
present, if its not just Module::Build::Compat
-* 3.0 source format support for dh-make-perl
Modified: trunk/dh-make-perl/lib/DhMakePerl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl.pm?rev=52954&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl.pm Wed Feb 17 18:37:00 2010
@@ -55,7 +55,8 @@
use File::Basename qw( basename dirname );
use File::Copy qw( copy move );
use File::Find qw( find );
-use File::Spec::Functions qw( catfile );
+use File::Path ();
+use File::Spec::Functions qw( catdir catfile splitpath );
use IO::File ();
use Module::CoreList ();
use Module::Depends::Intrusive ();
@@ -239,12 +240,17 @@
if ( 'control' ~~ $self->cfg->only ) {
my $control = Debian::Control::FromCPAN->new;
$control->read( $self->debian_file('control') );
- if ( -e catfile( $self->debian_file('patches'), 'series' ) ) {
- $self->add_quilt( $control );
+ if ( -e catfile( $self->debian_file('patches'), 'series' )
+ and $self->cfg->source_format ne '3.0 (quilt)' )
+ {
+ $self->add_quilt($control);
}
else {
- $self->drop_quilt( $control );
+ $self->drop_quilt($control);
}
+
+ $self->write_source_format(
+ catfile( $debiandir, 'source', 'format' ) );
if( my $apt_contents = $self->get_apt_contents ) {
$control->dependencies_from_cpan_meta(
@@ -376,6 +382,7 @@
# start writing out the data
mkdir( $debiandir, 0755 ) || die "Cannot create $debiandir dir: $!\n";
$self->create_control("$debiandir/control");
+ $self->write_source_format( catfile( $debiandir, 'source', 'format' ) );
if ( defined $self->cfg->closes ) {
$closes = $self->cfg->closes;
}
@@ -2046,6 +2053,26 @@
return $found ? 1 : 0;
}
+sub write_source_format {
+ my ( $self, $path ) = @_;
+
+ my ( $vol, $dir, $file ) = splitpath($path);
+ $dir = catdir( $vol, $dir );
+
+ if ( $self->cfg->source_format eq '1.0' ) {
+ # this is the default, remove debian/source
+ File::Path::rmtree($dir);
+ }
+ else {
+ # make sure the directory exists
+ File::Path::mkpath($dir) unless -d $dir;
+
+ my $fh = $self->_file_w($path);
+ $fh->print( $self->cfg->source_format, "\n" );
+ $fh->close;
+ }
+}
+
sub _warn_incomplete_copyright {
my $self = shift;
More information about the Pkg-perl-cvs-commits
mailing list