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

CVS User csacca-guest cvs@dh-make-perl.alioth.debian.org
Wed, 30 Mar 2005 18:33:31 +0000


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

Modified Files:
	dh-make-perl 
Log Message:
* dh-make-perl: Added a function to make a watch file for modules from
  CPAN.  (Closes: #253919)


--- /cvsroot/dh-make-perl/dh-make-perl/dh-make-perl	2005/03/30 15:14:36	1.32
+++ /cvsroot/dh-make-perl/dh-make-perl/dh-make-perl	2005/03/30 18:33:30	1.33
@@ -214,6 +214,7 @@
 create_changelog("$debiandir/changelog");
 create_rules("$debiandir/rules");
 create_compat("$debiandir/compat");
+create_watch("$debiandir/watch", $cpanmodule) if ($cpanmodule);
 #create_readme("$debiandir/README.Debian");
 create_copyright("$debiandir/copyright");
 fix_rules("$debiandir/rules", (defined $changelog ? $changelog : ''), @docs);
@@ -653,6 +654,20 @@
 	close(C);
 }
 
+sub create_watch {
+	my ($file, $perl_path_name) = @_;
+	open(C, ">$file") || die "Cannot open $file: $!\n";
+	
+	$perl_path_name =~ s|::|-|g;
+	$perl_path_name =~ s|(\w+)(-.*)|$1/$1$2|;
+	$perl_path_name .= "-(.*)(\.tar\.gz|\.tar|\.tgz)";
+
+	print C "\# format version number, currently 2; this line is compulsory!\n";
+	print C "version=2\n";
+	print C "http://www.cpan.org/modules/by-module/$perl_path_name\n";
+	close(C);
+}
+
 sub get_maintainer {
 	my $user = $ENV{LOGNAME} || $ENV{USER};
 	my $pwnam = getpwuid($<);