Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
You've used h2xs to start buliding your module? You've got a nice MANIFEST file? You want to build a nice tarball? Then use MANIFESTIT.(warning, DISTNAME and VERSION regex could probably use improving).
usage: perl MANIFESTIT.PL path/2/manifest/holding/dir
#!/usr/bin/perl -wl use strict; use Archive::Tar; use vars qw/ $DISTNAME $VERSION/; my @MANIFEST; my $MANIFEST = shift @ARGV || ''; die "ERROR: `$MANIFEST/MANIFEST' $!" unless(-e "$MANIFEST/MANIFEST" and -r "$MANIFEST/MANIFEST"); open(MANIFEST, '<', "$MANIFEST/MANIFEST") or die "ERROR: `$MANIFEST/MANIFEST' $!"; while(<MANIFEST>) { chomp; next unless length $_; die "ERROR: `$MANIFEST/$_' $!" unless(-e "$MANIFEST/$_" and -r "$MANIFEST/$_"); push @MANIFEST,"$MANIFEST/$_"; &_MAKEFILE( $MANIFEST[-1] ) if $_ =~ /Makefile.PL/i; } print for @MANIFEST; my $tar = Archive::Tar->new(); $tar->add_files(@MANIFEST); $tar->write("$DISTNAME-$VERSION.tar"); print "created `$DISTNAME-$VERSION.tar'"; exit; sub _MAKEFILE { open(MAKEFILE,'<',$_[0]) or die "ERROR: `$_[0]' $!"; while(<MAKEFILE>) { chomp; if(/^\s*?'?NAME'?\s*?\=\>\s*?(?:\'|\")?([a-zA-Z:_]+)(?:\'|\")? +,/) { print; $DISTNAME = $1; } if(/^\s*?'?DISTNAME'?\s*?\=\>\s*?(?:\'|\")?([a-zA-Z_-]+)(?:\'| +\")?,/) { print; $DISTNAME = $1; } if(/^\s*?'?VERSION'?\s*?\=\>\s*?(?:\'|\")?([a-zA-Z_-]+)(?:\'|\ +")?,/) { print; $VERSION = $1; } if(/^\s*?'?VERSION_FROM'?\s*?\=\>\s*?(?:\'|\")?([^'"]+)(?:\'|\ +")?,/) { print; open(VERSION,'<',"$MANIFEST/$1") or die "ERROR: `$1' $!"; while(<VERSION>) { chomp; if(/([\$*])(([\w\:\']*)\bVERSION)\b.*\=/) { eval $_; } } } } } __END__ F:\dev\Pod_Parser>perl MANIFESTIT.PL Pod/Stripper 'NAME' => 'Pod::Stripper', 'VERSION_FROM' => 'Stripper.pm', # finds $VERSION 'DISTNAME' => 'Pod-Stripper', Pod/Stripper/Changes Pod/Stripper/Stripper.pm Pod/Stripper/Makefile.PL Pod/Stripper/MANIFEST Pod/Stripper/README Pod/Stripper/test.pl Pod/Stripper/test.stripped created `Pod-Stripper-0.2.tar' F:\dev\Pod_Parser>

In reply to MANIFEST IT! by crazyinsomniac

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-03-28 17:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found