#!/usr/bin/perl # # Copyright © 2015-2020 by Vincent Slyngstad # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS LISTED ABOVE BE LIABLE # FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF # CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the names of the authors above # shall not be used in advertising or otherwise to promote the sale, use # or other dealings in this Software without prior written authorization # from those authors. sub process { local($d) = @_; opendir(DIR, $d) || die "$d: $!"; foreach $f (readdir(DIR)) { next if $f =~ /^\..*$/; if ($f !~ /^([-\w]+)-(\w+)([.\w]+)*$/) { warn "Skipping '$f'\n"; next; } ($base, $ext, $ext2) = ($1, $2, $3); if ($ext2 =~ /[.]{bin|pal|lst}/) { # warn "$f:$base:$ext:$ext2:\n"; ($base, $ext, $ext2) = ("$base-$ext", $ext2, ""); # warn "Got here $base:$ext:$ext2\n"; } $ext .= $ext2 if $ext2; $ext =~ s/[.]/_/g; $ext =~ s/^_//; if ($base !~ /^[-A-Za-z0-9]+$/) { warn "Skipping $base ($f)\n"; next; } $files{$base} = 0 unless defined $files{$base}; $files{$base}++; $eval = '$' . $ext . '{$base} = 1;'; # print "$eval\n"; eval "$eval"; } foreach $k (sort keys %files) { if (!defined $pb{$k} && !defined $pm{$k}) { print "binary (-pb) is missing for $k\n"; } else { print "tape label (-pb.lbl) is missing for $k\n" unless defined $pb_lbl{$k} || defined $pm_lbl{$k}; print "od (-pb.od) is missing for $k\n" unless defined $pb_od{$k} || defined $pm_od{$k}; } print "write-up (-d.pdf) is missing for $k\n" unless defined $d_pdf{$k}; } } &process(".");