Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Bench this BBcode

by VinsWorldcom (Prior)
on Sep 09, 2010 at 13:41 UTC ( [id://859506]=note: print w/replies, xml ) Need Help??

in reply to Bench this BBcode

I've gotten the ""-withoutworldwriteables" appended to some of my modules upon PAUSE upload. I develop on Windows and it doesn't understand rw-r--r-- versus rw-rw-rw-. PAUSE does not like rw-rw-rw- and will 'attempt' to redo your TAR-GZ upload to a rw-r--r-- (without world writeables) TAR-GZ.

You can make sure you develop on *nix or some flavor that understands rw-r--r-- before you package (TAR-GZ) your module. Alternatively, I upload my modules as "my-module-0.01-w.tar.gz". I wait for PAUSE to send me the error email saying it redid my package to "my-module-0.01-w-withoutworldwriteables.tar.gz" and that it's available for a short time at the provided link. I download the module back to my local PC, rename to "my-module-0.01.tar.gz" and re-upload back to PAUSE.

Quite a convoluted process, and some cleanup is needed (remove the "my-module-0.01-w.tar.gz" and "my-module-0.01-w-withoutworldwriteables.tar.gz" from PAUSE). But it does give me nicely named modules on CPAN.

I did find a Perl script that was supposed to go into the tarball and fix the issue on Windows platforms, but I couldn't get it to work for me. Maybe you'll have better luck with it: Fix CPAN uploads for world writable files

Replies are listed 'Best First'.
Re^2: Bench this BBcode
by SFLEX (Chaplain) on Sep 09, 2010 at 21:47 UTC
    If its any help to you, I edited bart's code to not work in a command prompt. The only thing is you have to set the values of the variables in the code.
    #!perl use Archive::Tar; $Archive::Tar::DO_NOT_USE_PREFIX = 1; use strict; my %opt = ( 'quickfix' => 1, # quick fix - with out world writeables 'verbose' => 1, # print some text when working 'output' => 'Fixed_Archive.tar.gz', # rename file to ); my $dist = 'C:\Path\to\with-out-world-writeables.tar.gz'; # Path and F +ile to fix print 'Starting the Fix File: '.$dist."\n".' and rename to '.$opt{outp +ut}."\n" if $opt{verbose}; my $fixes; my $tar = Archive::Tar->new; $tar->read($dist); my @files = $tar->get_files; foreach my $file (@files) { my $fixedmode = my $mode = $file->mode; my $filetype = ''; if($file->is_file) { $filetype = 'file'; if($opt{quickfix}) { $fixedmode &= ~2; } elsif(substr(${ $file->get_content_by_ref }, 0, 2) eq '# +!') { $fixedmode = 0775; } else { $fixedmode = 0664; } } elsif($file->is_dir) { $filetype = 'dir'; if($opt{quickfix}) { $fixedmode &= ~2; } else { $fixedmode = 0775; } } else { next; } next if $mode eq $fixedmode; $file->mode($fixedmode); $fixes++; print "\nChange mode %03o to %03o for %s '%s'\n", $mode, $fixe +dmode, $filetype, $file->name if $opt{verbose}; } if($fixes) { $dist = $opt{output} if $opt{output}; $tar->write($dist, 9); print "\nFile '$dist' saved.\n" if $opt{verbose}; }

    I just tested it on PAUSE and it works.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://859506]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-07-22 13:39 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.