Bug 11937 - fails on some tarballs
Summary: fails on some tarballs
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: cpan2rpm (show other bugs)
Version: unstable
Hardware: all Linux
: P2 major
Assignee: Vitaly Lipatov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-31 19:55 MSD by viy
Modified: 2007-06-05 10:18 MSD (History)
1 user (show)

See Also:


Attachments
fix-untar-alt-viy (568 bytes, patch)
2007-05-31 19:56 MSD, viy
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 :)