r8467 - in /trunk/dh-make-perl: debian/changelog debian/control dh-make-perl

ollyg-guest at users.alioth.debian.org ollyg-guest at users.alioth.debian.org
Mon Oct 22 10:13:31 UTC 2007


Author: ollyg-guest
Date: Mon Oct 22 10:13:31 2007
New Revision: 8467

URL: http://svn.debian.org/wsvn/?sc=1&rev=8467
Log:
Try Module::Depends if M::D::Intrusive fails (Closes: #447520)

Modified:
    trunk/dh-make-perl/debian/changelog
    trunk/dh-make-perl/debian/control
    trunk/dh-make-perl/dh-make-perl

Modified: trunk/dh-make-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/dh-make-perl/debian/changelog?rev=8467&op=diff
==============================================================================
--- trunk/dh-make-perl/debian/changelog (original)
+++ trunk/dh-make-perl/debian/changelog Mon Oct 22 10:13:31 2007
@@ -1,3 +1,10 @@
+dh-make-perl (0.35) UNRELEASED; urgency=low
+
+  * Try Module::Depends if M::D::Intrusive fails (Closes: #447520). This
+    helps Module::Install modules (with META.yml) to work with dh-make-perl.
+
+ -- Oliver Gorwits <oliver.gorwits at oucs.ox.ac.uk>  Mon, 22 Oct 2007 10:42:59 +0100
+
 dh-make-perl (0.34) unstable; urgency=low
 
   * Add Vcs-* fields instead of the obsolete XS-Vcs-* fields when invoked

Modified: trunk/dh-make-perl/debian/control
URL: http://svn.debian.org/wsvn/trunk/dh-make-perl/debian/control?rev=8467&op=diff
==============================================================================
--- trunk/dh-make-perl/debian/control (original)
+++ trunk/dh-make-perl/debian/control Mon Oct 22 10:13:31 2007
@@ -7,7 +7,8 @@
 Uploaders: Gunnar Wolf <gwolf at debian.org>, Wolfgang Schemmel <debian at 37.org>,
  Christopher Sacca <csacca at thecsl.org>,
  Damyan Ivanov <dmn at debian.org>, gregor herrmann <gregor+debian at comodo.priv.at>,
- David Paleino <d.paleino at gmail.com>
+ David Paleino <d.paleino at gmail.com>,
+ Oliver Gorwits <oliver.gorwits at oucs.ox.ac.uk>
 Standards-Version: 3.7.2
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/dh-make-perl/
 Vcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/

Modified: trunk/dh-make-perl/dh-make-perl
URL: http://svn.debian.org/wsvn/trunk/dh-make-perl/dh-make-perl?rev=8467&op=diff
==============================================================================
--- trunk/dh-make-perl/dh-make-perl (original)
+++ trunk/dh-make-perl/dh-make-perl Mon Oct 22 10:13:31 2007
@@ -634,47 +634,65 @@
 	}, $dir);
 }
 
+sub run_depends {
+    my ($depends_module, $dir) = @_;
+
+    no warnings;
+    local *STDERR;
+    open(STDERR, ">/dev/null");
+    my $mod_dep = $depends_module->new();
+
+    $mod_dep->dist_dir( $dir );
+    $mod_dep->find_modules();
+
+    my %dep_hash = %{$mod_dep->requires};
+
+    my $error = $mod_dep->error();
+    die "Error: $error\n" if $error;
+    return %dep_hash;
+}
+
 sub extract_depends {
-	my ($dir, $meta, %dep_hash, $error, @uses, @deps, @not_debs,
-	    $has_apt_file);
-	$dir = shift;
-	$meta = shift;
-	local @INC = ($dir, @INC);
-
-	$dir .= '/' unless $dir =~ m/\/$/;
-
-	### Mental note to self: It'd be worth it to fall back to 
-	### Module:::Depends and _only_ then fail
-	eval {
-	    my $mod_dep;
-	    no warnings;
-	    local *STDERR;
-	    open(STDERR, ">/dev/null");
-	    $mod_dep = Module::Depends::Intrusive->new();
-	
-	    $mod_dep->dist_dir( $dir );
-	    $mod_dep->find_modules();
-
-	    %dep_hash = %{$mod_dep->requires};
-
-	    $error = $mod_dep->error();
-	    die "Error: $error\n" if $error;
-	};
-	if ($@ or $error) {
-	    warn '='x70,"\n";
-	    warn "Could not find the dependencies for the requested module\n";
-
-	    warn "Module::Depends::Intrusive reports: $error\n" if $error;
-	    warn "Generated error: $@" if $@;
-
-	    warn "Please check if your module depends on Module::Install\n" .
-		"for its build process - Automatically finding its\n" .
-		"dependencies is unsupported, please specify them manually\n" .
-		"using the 'depends' option. \n";
-	    warn '='x70,"\n";
-
-	    exit 1;
-	}
+    my $dir = shift;
+    my $meta = shift;
+    my (%dep_hash, @uses, @deps, @not_debs, $has_apt_file);
+    local @INC = ($dir, @INC);
+
+    $dir .= '/' unless $dir =~ m/\/$/;
+
+    # try Module::Depends::Intrusive, but if that fails then
+    # fall back to Module::Depends.
+
+    eval {
+        %dep_hash = run_depends('Module::Depends::Intrusive',$dir);
+    };
+    if ($@) {
+        warn '='x70,"\n";
+        warn "First attempt (Module::Depends::Intrusive) at a dependency\n" .
+        "check failed. Possible use of Module::Install ?\n" .
+        "Trying again with Module::Depends ... \n";
+        warn '='x70,"\n";
+
+        eval {
+            %dep_hash = run_depends('Module::Depends',$dir);
+        };
+
+        if ($@) {
+            warn '='x70,"\n";
+            warn "Could not find the dependencies for the requested module.\n";
+            warn "Generated error: $@";
+
+            warn "Please check if your module depends on Module::Install\n" .
+            "for its build process - Automatically finding its\n" .
+            "dependencies is unsupported, please specify them manually\n" .
+            "using the 'depends' option. \n";
+            warn "Alternatively, including a META.yml file with dependencies\n" .
+            "should allow discovery even for Module::Install modules. \n";
+            warn '='x70,"\n";
+
+            exit 1;
+        }
+    }
 
 	foreach my $module (keys( %dep_hash )) {
 		next if (grep ( /^$module$/, @stdmodules));
@@ -1365,6 +1383,7 @@
   Marc Chantreux (mail withheld)
   Matt Hope E<lt>dopey at debian.orgE<gt>
   Noel Maddy E<lt>noel at zhtwn.comE<gt>
+  Oliver Gorwits E<lt>oliver.gorwits at oucs.ox.ac.ukE<gt>
   Peter Moerch E<lt>mn3k66i02 at sneakemail.comE<gt>
   Stephen Oberholtzer E<lt>oliverklozoff at gmail.comE<gt>
   Ton Nijkes E<lt>tonn at wau.mis.ah.nlE<gt>




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