5 Test the well-formed-ness of filenames names in the MANIFEST file. Current
10 =item * no more than 39 characters before the dot, and 39 after
12 =item * no filenames starting with -
14 =item * don't use any of these names (regardless of case) before the dot: CON,
15 PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1,
16 LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9
18 =item * no spaces, ( or & in filenames
35 my $manifest = File::Spec->catfile(File::Spec->updir(), 'MANIFEST');
37 open my $m, '<', $manifest or die "Can't open '$manifest': $!";
41 my($path) = split /\t+/;
49 for my $file (@files) {
50 validate_file_name($file);
55 sub validate_file_name {
57 my $filename = basename $path;
59 note("testing $path");
61 my @path_components = split('/',$path);
62 pop @path_components; # throw away the filename
63 for my $component (@path_components) {
64 if ($component =~ /\./) {
65 fail("no directory components containing '.'");
68 if (length $component > 32) {
69 fail("no directory with a name over 32 characters (VOS requirement)");
75 if ($filename =~ /^\-/) {
76 fail("filename does not start with -");
80 my($before, $after) = split /\./, $filename;
81 if (length $before > 39) {
82 fail("filename has 39 or fewer characters before the dot");
86 if (length $after > 39) {
87 fail("filename has 39 or fewer characters after the dot");
92 if ($filename =~ /^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])\./i) {
93 fail("filename has a reserved name");
97 if ($filename =~ /\s|\(|\&/) {
98 fail("filename has a reserved character");