Bug 11937 - fails on some tarballs
: fails on some tarballs
Status: CLOSED FIXED
: Sisyphus
(All bugs in Sisyphus/cpan2rpm)
: unstable
: all Linux
: P2 major
Assigned To:
:
:
:
:
:
  Show dependency tree
 
Reported: 2007-05-31 19:55 by
Modified: 2007-06-05 10:18 (History)


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


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-05-31 19:55:37
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 From 2007-05-31 19:56:28 -------
Created an attachment (id=2003) [details]
fix-untar-alt-viy
------- Comment #2 From 2007-06-05 10:17:54 -------
thanks :)