[dh-make-perl] 01/01: add rename_to_debian_package_dir

Tamas Csillag cstamas-guest at alioth.debian.org
Sun Sep 1 22:58:13 UTC 2013


This is an automated email from the git hooks/post-receive script.

cstamas-guest pushed a commit to branch master
in repository dh-make-perl.

commit 6ac7b1fad373314d5b26340a97b27c0632f1638b
Author: CSILLAG Tamas <cstamas at cstamas.hu>
Date:   Mon Sep 2 00:50:39 2013 +0200

    add rename_to_debian_package_dir
    
    This will rename the directory name to the canonical name of
    the debian package.
---
 lib/DhMakePerl/Command/make.pm |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/lib/DhMakePerl/Command/make.pm b/lib/DhMakePerl/Command/make.pm
index 675fd72..e6b66dd 100644
--- a/lib/DhMakePerl/Command/make.pm
+++ b/lib/DhMakePerl/Command/make.pm
@@ -51,7 +51,7 @@ use Email::Date::Format qw(email_date);
 use File::Basename qw( basename dirname );
 use File::Copy qw( copy move );
 use File::Path ();
-use File::Spec::Functions qw( catfile );
+use File::Spec::Functions qw( catdir catfile updir );
 use Module::Depends            ();
 use Module::Build::ModuleInfo;
 use Text::Wrap qw( wrap );
@@ -247,6 +247,10 @@ sub execute {
     $self->package_already_exists($apt_contents)
         or $self->modules_already_packaged($apt_contents);
 
+    # explicitly call Debian::Rules destroy
+    $self->rules( undef );
+    $self->rename_to_debian_package_dir;
+
     return(0);
 }
 
@@ -556,6 +560,23 @@ sub search_pkg_perl {
     return undef;
 }
 
+sub rename_to_debian_package_dir {
+    my( $self ) = @_;
+    return unless $self->cfg->cpan;
+
+    my $maindir = $self->main_dir;
+    my $newmaindir = catdir( $maindir, updir(), $self->pkgname );
+
+    if( -d $newmaindir ) {
+      warn "$newmaindir already exists, skipping rename";
+      return;
+    }
+
+    system("mv $maindir $newmaindir") == 0 or die "rename failed: $self->main_dir to $newmaindir";
+    $self->main_dir( $newmaindir );
+    return;
+}
+
 sub package_already_exists {
     my( $self, $apt_contents ) = @_;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/dh-make-perl.git



More information about the Pkg-perl-cvs-commits mailing list