#!/usr/bin/perl # # # Copyright (c) 2007, Hiroyuki Ohsaki. # All rights reserved. # # $Id: chkarchive,v 1.5 2009/03/14 07:10:04 oosaki Exp oosaki $ # no diagnostics; no warnings; use File::Basename; use Getopt::Std; use Smart::Comments; use strict; sub usage { my $prog = basename($0); die <) { next if /^(RCS|README|bib|camera-ready|figure|misc|submit)$/; next if /\.tex$/; msg_invaild($_); } ### check existence of invalid bib files for () { next if /\.bib$/; msg_invaild($_); } # check existence of invalid figure files my %hash; for (
) { next if /\.def$/; if (/\.eps$/) { my $base = basename($_, '.eps'); $hash{$base} = $_; } elsif (/\.(res|obj|ai|ppt|vsd)$/) { my $base = basename($_, qw(.res .obj .ai .ppt .vsd .xcf .ppt)); delete $hash{$base} if defined $hash{$base}; } else { msg_invaild($_); } } for (sort keys %hash) { msg "$hash{$_}:\tmissing source file"; } # my @unused; # for (sort keys %hash) { # qx(fgrep '{$_}' *.tex >/dev/null 2>/dev/null); # push(@unused, $_) unless $@; # } # for (@unused) { # msg "$hash{$_}:\tunused by any TeX/LaTeX files"; # } ### check existence of final version for my $dir ('.', 'camera-ready') { next unless (-d $dir); for (<$dir/submit/*>) { next if /\.(ps\.gz|pdf|ppt)$/; msg_invaild($_); } for (qw(paper.ps.gz paper.pdf)) { msg "$dir/submit/$_:\tmissing final version" unless (-f "$dir/submit/$_"); } } ### check existence of presentation slide my $dir = (-d 'camera-ready' ? 'camera-ready' : '.'); msg "$dir/submit/slide.ppt:\tmissing PPT file" unless (-f "$dir/submit/slide.ppt"); warn "$err_count error(s)/warning(s) found\n";