[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

dh-make-perl: picks wrong case in case of case collision :-)



Hi,

I created a patch that I think solves this issue. But I'm not sure if
this is worth the trouble: it is a very rare thing to find this kind
of collisions, and also it will make trouble because of name-clashing
it the Debian namespace. What do other people think about it?

See the attached patch.

-- 
Martín Ferrari
Index: dh-make-perl
===================================================================
--- dh-make-perl	(revisión: 11147)
+++ dh-make-perl	(copia de trabajo)
@@ -286,8 +286,19 @@
 		$CPAN::Config->{'histfile'}  = $ENV{'HOME'} . "/.cpan/history";
 		$CPAN::Config->{'keep_source_where'} = $ENV{'HOME'} . "/.cpan/source";
                 
-		$mod = CPAN::Shell->expand('Module', '/^'.$opts{cpan}.'$/') 
-			|| die "Can't find '$opts{cpan}' module on CPAN\n";
+		my @mod = CPAN::Shell->expand('Module', '/^'.$opts{cpan}.'$/') 
+			or die "Can't find '$opts{cpan}' module on CPAN\n";
+		foreach(@mod) {
+			my $file = $_->cpan_file();
+			$file =~ s#.*/##; # remove directory
+			$file =~ s/(.*)-.*/$1/; # remove version and extension
+			$file =~ s/-/::/g; # convert dashes to colons
+			if($file eq $opts{cpan}) {
+				$mod = $_;
+				last;
+			}
+		}
+		$mod = shift @mod unless($mod);
 		$mod_cpan_version = $mod->cpan_version;
 		$cpanversion = $CPAN::VERSION;
 		$cpanversion =~ s/_.*//;

Reply to: