Subject: | Fix for tarballs with no subdirs for .pm files |
Without this patch, packages like Image::Xbm and Image::Xpm cannot be installed. Here's what I see:
-- module: Image::Xbm --
Using cached URL: http://search.cpan.org//CPAN/authors/id/S/SU/SUMMER/Image-Xbm-1.08.tar.gz
Tarball found - not fetching
Metadata retrieval
Tarball extraction: [/usr/src/redhat/SOURCES/Image-Xbm-1.08.tar.gz]
get_meta(): Not a directory at /usr/bin/cpan2rpm line 396.
-- Done --
line 396 is:
chdir $info->{evaldir} || die "get_meta(): $!";
and $info->{evaldir} contained the string /tmp/ykd6B8II7D/Image-Xbm-1.08/MANIFEST
With the patch, these modules can install properly. Doesn't seem to break any other functionality.
diff -ru cpan2rpm-2.028/cpan2rpm cpan2rpm-new/cpan2rpm
--- cpan2rpm-2.028/cpan2rpm 2005-06-17 22:06:54.000000000 -0700
+++ cpan2rpm-new/cpan2rpm 2005-06-30 09:35:49.000000000 -0700
@@ -26,6 +26,7 @@
use strict;
use warnings;
+use File::Basename;
use Getopt::Long;
use Sys::Hostname;
use Pod::Text;
@@ -387,6 +388,9 @@
$info->{buildarch} = "noarch" if $xs == 0;
}
+ if (not -d $info->{evaldir}) {
+ $info->{evaldir} = dirname($info->{evaldir});
+ }
chdir $info->{evaldir} || die "get_meta(): $!";
$_ = "$info->{evaldir}/Build.PL";