Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MANIFEST verification

0 views
Skip to first unread message

Robert Spier

unread,
Sep 29, 2003, 4:36:58 PM9/29/03
to perl6-i...@perl.org

There's been a little bit of hubbub recently about people checking
things into the languages/ directories and breaking the MANIFEST.

I can setup the CVS repository to notify the user after a checkin where
something has gone awry. But, I'm low on tuits, so I need to farm out
a little of the work.

I need a script that meets the following specs:

Input (via command line)
1) file representing MANIFEST
2) file representing MANIFEST.SKIP
3) file representing list of all files found

Output (via stdout)
error message if manifest check fails

Restrictions:
The script cannot access any other files/filesystems/directory
listings besides the data in the files provided on the command
line.

I think the easiest to implement this is by subclassing
ExtUtils::Manifest, and overriding manifiles() and maybe one or two
other subroutines.

-R (CVS TimeLord)

Jeff Clites

unread,
Sep 29, 2003, 4:51:42 PM9/29/03
to Robert Spier, perl6-i...@perl.org
There's already a test in the form of t/src/manifest.t, which you might
be able to adapt (or invoke directly).

JEff

Nicholas Clark

unread,
Sep 29, 2003, 4:57:28 PM9/29/03
to Jeff Clites, Robert Spier, perl6-i...@perl.org
On Mon, Sep 29, 2003 at 01:51:42PM -0700, Jeff Clites wrote:
> There's already a test in the form of t/src/manifest.t, which you might
> be able to adapt (or invoke directly).

t/src/manifest.t calls ExtUtils::Manifest, which does a recursive find
over the directory tree, and therefore violates one of the constraints:

> On Monday, September 29, 2003, at 01:36 PM, Robert Spier wrote:

> > Restrictions:
> > The script cannot access any other files/filesystems/directory
> > listings besides the data in the files provided on the command
> > line.

Nicholas Clark

Garrett Goebel

unread,
Sep 30, 2003, 9:36:43 AM9/30/03
to Robert Spier, perl6-i...@perl.org
Robert Spier wrote:
>
> I need a script that meets the following specs:
>
> Input (via command line)
> 1) file representing MANIFEST
> 2) file representing MANIFEST.SKIP
> 3) file representing list of all files found
>
> Output (via stdout)
> error message if manifest check fails
>
> Restrictions:
> The script cannot access any other files/filesystems/directory
> listings besides the data in the files provided on the command
> line.
>
> I think the easiest to implement this is by subclassing
> ExtUtils::Manifest, and overriding manifiles() and maybe one or two
> other subroutines.

I assume you can probably yank the Mac and VMS stuff... but left it in
anyway.

Garrett

#!/usr/bin/perl
use ExtUtils::Manifest;

die "expected 3 args" unless 3 == @ARGV;
-f or die "file not found: $_" for @ARGV;

my $found = {};
my $Is_MacOS = $^O eq 'MacOS';
my $Is_VMS = $^O eq 'VMS';
require VMS::Filespec if $Is_VMS;

$ExtUtils::Manifest::MANIFEST = shift;
my $read = ExtUtils::Manifest::maniread() || {};

$ExtUtils::Manifest::DEFAULT_MSKIP = shift;
my $skip = ExtUtils::Manifest::_maniskip();

open IN, shift;
/^(.*)$/ and $found->{$1}++ while (<IN>);
close IN;

# _check_manifest
foreach my $file (sort keys %$found){
next if $skip->($file);
unless ( exists $read->{$file} ) {
my $canon = $Is_MacOS
? "\t".ExtUtils::Manifest::_unmacify($file)
: '';
warn "Not in $ExtUtils::Manifest::MANIFEST: $file$canon\n";
}
}

# _check_files
foreach my $file (sort keys %$read) {
warn "No such file: $file\n" unless exists $found->{$file}
}

1;
__END__

--
Garrett Goebel
IS Development Specialist

ScriptPro Direct: 913.403.5261
5828 Reeds Road Main: 913.384.1008
Mission, KS 66202 Fax: 913.384.2180
www.scriptpro.com garrett at scriptpro dot com

Robert Spier

unread,
Oct 1, 2003, 12:59:17 AM10/1/03
to Garrett Goebel, perl6-i...@perl.org

Thank you Garrett! That's perfect.

Starting now, if anyone does something to make the MANIFEST unhappy,
it will print out a message at the bottom of the commit log.

You'll see things like this:
manicheck: Not in MANIFEST: somefile1
manicheck: File not found: somefile2

Enjoy!

-R (CVS Timelord)

> Robert Spier wrote:
> > I need a script that meets the following specs:

0 new messages