Bug 11937

Summary: fails on some tarballs
Product: Sisyphus Reporter: viy <viy>
Component: cpan2rpmAssignee: Vitaly Lipatov <lav>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: major    
Priority: P2 CC: lav
Version: unstable   
Hardware: all   
OS: Linux   
Attachments:
Description Flags
fix-untar-alt-viy none

Description viy 2007-05-31 19:55:37 MSD
fails on some tarballs VCP-autrijus-snapshot-0.9-20050110.tar.gz, SVN-Simple...
patch is proposed
cpan2rpm-fix-untar-alt-viy.patch:
--- bin/cpan2rpm	2007-03-01 01:35:31 +0200
+++ bin/cpan2rpm	2007-05-31 18:43:35 +0300
@@ -1172,7 +1172,11 @@
     chomp($_ = qx/$cmd/);
     $_ = (split)[5] unless $zip;
-    $dst .= "/$1" if m|^(\S+)/|;
+    if (-d $dst.'/'.$_) { # many CPAN tarballs has directory w/o trailing /
+	$dst .= "/$_";    # example is VCP-autrijus-snapshot-0.9-20050110.tar.gz
+    } elsif (~m|^(\S+)/|) {
+	$dst .= "/$1";
+    }
     $dst =~ s|/*$||;    # path shouldn't end in / or tardir gets wiped
     $dst =~ s|\./||;    # paths in tarballs shouldn't be relative
     return $dst;
Comment 1 viy 2007-05-31 19:56:28 MSD
Created attachment 2003 [details]
fix-untar-alt-viy
Comment 2 viy 2007-06-05 10:17:54 MSD
thanks :)