0

Im trying to build perl-Heap-Priority for RHEL6. Weired thing is when I run cpan2rpm Heap::Priority it shows following

...
Tarball extraction: [/root/rpm/SOURCES/Heap-Priority-0.01.tar.gz]
Can't stat /tmp/CldQkErG6r/18:51: No such file or directory
 at /usr/bin/cpan2rpm line 392
get_meta(): No such file or directory at /usr/bin/cpan2rpm line 396.
...

Practically this temporary folder is not created. Buy why? my tmp folder permission is 777

drwxrwxrwt.   3 root root  4096 May 29 16:35 tmp
4

2 に答える 2

1

Known problem, see https://rt.cpan.org/Ticket/Display.html?id=72421. The problem is the space in the user column of the output.

$ tar -tzvf $HOME/rpmbuild/SOURCES/Heap-Priority-0.01.tar.gz |head -1
drwxr-xr-x James Freeman/544 0 2002-05-07 14:51 Heap-Priority-0.01/

Apply the following patch to fix the problem for this module. To get the name, instead of accessing the fifth column, we're accessing the last one. I do not know what else this patch might break, but it should be less wrong than the original code on average.

 diff --git a/cpan2rpm b/cpan2rpm
 index 28e8b01..6a36b68 100755
 --- a/cpan2rpm
 +++ b/cpan2rpm
 @@ -1259,7 +1259,7 @@ sub untar($) {
          ;

      chomp($_ = qx/$cmd/);
 -    $_ = (split)[5] unless $zip;
 +    $_ = (split)[-1] unless $zip;
      $dst .= "/$1" if m|^(\S+)/?|;
      $dst =~ s|/*$||;    # path shouldn't end in / or tardir gets wiped
      $dst =~ s|\./||;    # paths in tarballs shouldn't be relative

You could have found out all of this by yourself by using the debugger. Learn to use this tool, it is invaluable.

于 2012-05-29T17:25:16.727 に答える
0

I think this might be a sightly cleaner way to do it:

--- /usr/bin/cpan2rpm.orig  2017-10-20 14:45:57.000000000 -0700
+++ /usr/bin/cpan2rpm   2017-10-23 12:29:07.006118950 -0700
@@ -1258,7 +1258,7 @@

     my $cmd = $zip
         ? "unzip -l $_ | grep -P -o '\\S+/\$' |tail -1"
-        : "tar -t${z}vf $_ |head -1"
+        : "tar --numeric-owner -t${z}vf $_ |head -1"
         ;

     chomp($_ = qx/$cmd/);
于 2017-10-23T19:34:02.550 に答える