On Wed, Jan 07, 2004 at 10:01:02AM +0100, Stefano Zacchiroli wrote: > On Wed, Jan 07, 2004 at 03:53:51AM +0100, Sven Luther wrote: > > Well, mostly bug reports, especially the state of the examples and such. > > There is also the idea Stefano suggested for gzipped .dvi support, or > > the camlzip solution to the same problem. > > I don't remember if it's on the BTS or not, but I successfully use the > attached perl script to run advi on gzipped dvi. I think is suitable for > distribution, maybe just adding a signal handler which trigger deletion > of tempfiles at exit ... > > Cheers. > > PS really funny: this is the second time I sent this mail, the first one > carried an advi.pl attachment which was rejected as dangerous by the > mailing list manager >
Hi, It is also in the BTS. But sorry : i will just rewrite it in sh... I just don't want to rely too heavily on perl ( when sh script is equivalent ). Thanks for the script Sylvain LE GALL > -- > ^Stefano Zacchiroli -- Master in Computer Science @ Uni. Bologna, Italy$ > [EMAIL PROTECTED],debian.org,bononia.it} -- http://www.bononia.it/zack$ > ^Frequentando il mio maestro mi ero reso conto [.] che la logica poteva$ > ^servire a molto a condizione di entrarci dentro e poi di uscirne -Adso$ > #!/usr/bin/perl -w > use strict; > > # Launcher script for advi with support for .gz and .bz2 files > # Copyright (C) 2003 Stefano Zacchiroli <[EMAIL PROTECTED]> > # > # This program is free software; you can redistribute it and/or modify it > under > # the terms of the GNU General Public License as published by the Free > Software > # Foundation; either version 2 of the License, or (at your option) any later > # version. > # > # See /usr/share/common-licenses/GPL on a Debian GNU/Linux system. > > my $advi = "/usr/bin/advi"; > my $gunzip = "/bin/gunzip"; > my $bunzip2 = "/usr/bin/bunzip2"; > my @tempfiles = (); > for (my $i=0; $i<=$#ARGV; $i++) { > if (-f $ARGV[$i] && $ARGV[$i] =~ /\.(gz|bz2)$/) { > my $tmp = `tempfile -p advi_ -s .dvi`; > chomp $tmp; > push @tempfiles, $tmp; > if ($ARGV[$i] =~ /\.gz$/) { > if (-x $gunzip) { > system "$gunzip -c $ARGV[$i] > $tmp"; > } else { > print STDERR "Warning: can't find gunzip ($gunzip)\n"; > } > } else { # ($ARGV[$i] =~ /\.bz2$/) > if (-x $bunzip2) { > system "$bunzip2 -c $ARGV[$i] > $tmp"; > } else { > print STDERR "Warning: can't find bunzip2 ($bunzip2)\n"; > } > } > $ARGV[$i] = $tmp; > } > } > my $retval = system $advi, @ARGV; > foreach my $tmp (@tempfiles) { > unlink $tmp; > } > exit $retval; >

