[dh-make-perl-cvs-dev] CVS dh-make-perl

CVS User gwolf cvs at dh-make-perl.alioth.debian.org
Tue Sep 6 21:53:43 UTC 2005


Update of /cvsroot/dh-make-perl/dh-make-perl
In directory haydn:/tmp/cvs-serv10172

Modified Files:
	dh-make-perl 
Log Message:
No longer dies when YAML is not well formed.
Fixed a small problem in the generated debian/watch


--- /cvsroot/dh-make-perl/dh-make-perl/dh-make-perl	2005/08/29 18:11:20	1.37
+++ /cvsroot/dh-make-perl/dh-make-perl/dh-make-perl	2005/09/06 21:53:43	1.38
@@ -318,13 +318,26 @@
 }
 
 sub process_meta {
-    my ($file);
+    my ($file, $yaml);
     $file = shift;
     # Command line option nometa causes this function not to be run
     return {} if $nometa;
 
+    # YAML::LoadFile has the bad habit of dying when it cannot properly parse
+    # a file - Catch it in an eval, and if it dies, return -again- just an
+    # empty hashref. Oh, were it not enough: It dies, but $! is not set, so we
+    # check against $@. Crap, crap, crap :-/
+    eval {
+	$yaml = YAML::LoadFile($file);
+    };
+    if ($@) {
+	print "Error parsing $file - Ignoring it.\n";
+	print "Please notify module upstream maintainer.\n";
+	$yaml = {};
+    }
+
     # Returns a simple hashref with all the keys/values defined in META.yml
-    return YAML::LoadFile($file);
+    return {};
 }
 
 sub extract_basic_copyright {
@@ -730,7 +743,7 @@
 	
 	$perl_path_name =~ s|::|-|g;
 	$perl_path_name =~ s|(\w+)(-.*)|$1/$1$2|;
-	$perl_path_name .= "-(.*)(\.tar\.gz|\.tar|\.tgz)";
+	$perl_path_name .= "-(.*)\.(tar\.gz|tar|tgz)";
 
 	print C "\# format version number, currently 2; this line is compulsory!\n";
 	print C "version=2\n";




More information about the Dh-make-perl-cvs-dev mailing list