r56679 - in /trunk/dh-make-perl: Changes TODO dh-make-perl lib/DhMakePerl/Command/make.pm lib/DhMakePerl/Config.pm

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Fri Apr 23 06:19:13 UTC 2010


Author: dmn
Date: Fri Apr 23 06:18:54 2010
New Revision: 56679

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=56679
Log:
make: implement --recursive

Modified:
    trunk/dh-make-perl/Changes
    trunk/dh-make-perl/TODO
    trunk/dh-make-perl/dh-make-perl
    trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm
    trunk/dh-make-perl/lib/DhMakePerl/Config.pm

Modified: trunk/dh-make-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/Changes?rev=56679&op=diff
==============================================================================
--- trunk/dh-make-perl/Changes (original)
+++ trunk/dh-make-perl/Changes Fri Apr 23 06:18:54 2010
@@ -6,3 +6,6 @@
     Add support for version relations in META
 
     Debian::Dependency now survives being given a string with leading spaces
+
+    make: implement recursive making of missing dependencies when --recursive
+        is given. (Debian bug #342751)

Modified: trunk/dh-make-perl/TODO
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/TODO?rev=56679&op=diff
==============================================================================
--- trunk/dh-make-perl/TODO (original)
+++ trunk/dh-make-perl/TODO Fri Apr 23 06:18:54 2010
@@ -4,16 +4,6 @@
   May be similar to #525847
 * when ITP for the package is found, try to deduce short/long description from
   the bug report
-* add new command, --trace-depends. To be used like
-
-   dh-make-perl --trace-depends --cpan Foo-Bar
-
-  it shall output a tree-like structure of missing dependencies without
-  preparing any packaging yet
-
-  Ryan52 already has a program which does this, in svn as
-   ./scripts/cpan-unpackaged-deps.pl. Steal code. or wait for Ryan52
-   to eventually do it himself.
 * versioned dependencies should add the epochs too (found in
   libpoex-role-sessioninstantiation-perl, where META.yml and Build.PL
   request 'POE 1.005' which should translate to "libpoe-perl (>= 2:1.0050)")

Modified: trunk/dh-make-perl/dh-make-perl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/dh-make-perl?rev=56679&op=diff
==============================================================================
--- trunk/dh-make-perl/dh-make-perl (original)
+++ trunk/dh-make-perl/dh-make-perl Fri Apr 23 06:18:54 2010
@@ -310,6 +310,17 @@
 Sets C<Maintainer>, C<Uploaders>, C<Vcs-Svn> and C<Vcs-Browser> fields in
 F<debian/control> accordingly.
 
+=item B<--recursive>
+
+Valid only in L</make> mode with L</--cpan> or I<directory> arguments. Causes
+dh-make-perl to try to create packaging (and possibly build and install the
+packages if L</--build> and L</--install> options are also given) for any
+dependencies which are missiing packages.
+
+This works like this: when the 'main' package is constructed, any missing
+packages are put in a list, and then the debianisaion procedure is run in turn
+on each of them, recursively.
+
 =item B<--requiredeps>
 
 Fail if a dependency Perl package was not found (dependency tracking

Modified: trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm?rev=56679&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm Fri Apr 23 06:18:54 2010
@@ -76,7 +76,7 @@
 }
 
 sub execute {
-    my ($self) = @_;
+    my ( $self, $already_done ) = @_;
 
     die "CPANPLUS support disabled, sorry" if $self->cfg->cpanplus;
 
@@ -123,7 +123,7 @@
     my $apt_contents = $self->get_apt_contents;
     my $src = $self->control->source;
 
-    $self->discover_dependencies;
+    my @missing = $self->discover_dependencies;
 
     $bin->Depends->add( $self->cfg->depends )
         if $self->cfg->depends;
@@ -191,6 +191,29 @@
 
     $self->package_already_exists($apt_contents);
 
+    if ( $self->cfg->recursive ) {
+        $already_done //= {};
+        my $mod_name = $self->perlname;
+        $mod_name =~ s/-/::/g;
+        $already_done->{$mod_name} = 1;
+
+        for my $m (@missing) {
+            next if exists $already_done->{$m};
+
+            if ( $self->cfg->verbose ) {
+                print "\n";
+                print "==================================\n";
+                print "  recursively building $m\n";
+                print "==================================\n";
+            }
+
+            my $new_cfg
+                = DhMakePerl::Config->new( { %{ $self->cfg }, cpan => $m, } );
+            my $maker = $self->new( { cfg => $new_cfg } );
+            $maker->execute($already_done)
+        }
+    }
+
     return(0);
 }
 

Modified: trunk/dh-make-perl/lib/DhMakePerl/Config.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl/Config.pm?rev=56679&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl/Config.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl/Config.pm Fri Apr 23 06:18:54 2010
@@ -31,6 +31,7 @@
     'nometa',          'notest',
     'only|o=s@',
     'packagename|p=s', 'pkg-perl!',
+    'recursive!',
     'requiredeps',     'sources-list=s',
     'source-format=s',
     'verbose!',        'version=s',




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