[tex-k] Re: newer

Julian Gilbey jdg at debian.org
Thu Apr 7 01:07:06 CEST 2005


Reinhard wrote:
> I assume that someone who uses the UNIX commandline interface is able
> to write shell scripts.  Those people benefit from an enhenced
> `newer'.
> 
> Therefore I'm not interested in removing it even if it is not needed by
> metapost anymore.   

But these people would be happy to have a Perl version, which really
ought to be in something like the GNU coreutils and not necessarily in
teTeX, eg (untested)

#! /usr/bin/perl -w

my $quiet = 0;
if (@ARGV == 0 or $ARGV[0] eq '--help') {
   # give usage information
   exit 0;
}
if ($ARGV[0] eq '--version') {
   # give version information
   exit 0;
}
if ($ARGV[0] eq '--quiet') {
   $quiet = 1;
   shift @ARGV;
}

my $dependent = pop @ARGV;
my $deptime;
my $ret;
if (-e $dependent) {
   $ret = 1;
   $depage = -M $dependent;
} else {
   $ret = 0;
}

foreach (@ARGV) {
   if (! -e $_) {
      warn "file $_ not found" unless $quiet;
   } elsif ($ret and -M $_ < $depage) {
      $ret = 0;
   }
}

exit $ret;


   Julian



More information about the tex-k mailing list