[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

a2ping (was: magic headers)



Norbert Preining <preining@logic.at> wrote:

> Ok, I took a look at the various files, here are the bad ones, and note
> that all of them are in /usr/bin and no wrappers (they were called
> indirectly via texexec, but this would have created an useless dep on
> texlive-context from several others, so I preferred to move them to
> /usr/bin):
>
> a2ping:
> #! /bin/sh
> eval '(exit $?0)' && eval 'PERL_BADLANG=x;export PERL_BADLANG;: \
> ;exec perl -x -S -- "$0" ${1+"$@"};#'if 0;
> eval 'setenv PERL_BADLANG x;exec perl -x -S -- "$0" $argv:q;#'.q+
> #!perl -w
> package Htex::a2ping; $0=~/(.*)/s;unshift@INC,'.';do($1);die$@if$@;__END__+if !1;
> # This Perl script was generated by JustLib2 at Wed Apr 23 09:14:13 2003.
> # Don't touch/remove any lines above; http://www.inf.bme.hu/~pts/justlib
> ...
> and continues as perl script
>
[...]
> AFAIR I tried to remove the magic headers and always ended up with
> *non-functional* rest. Especially the a2ping header made me go crazy.
> Removing the whole bunch just adding the perl shebang didn't work. There
> must be some magic hidden in these lines I do not understand - and I am
> not sure whether I WANT to understand it!

It uses a weird way of calling itself at least once.  The script has
been generated by Peter Szabo's justlib, this is what makes it so hard.
However, in fact I think this file isn't a problem with respect to magic
headers:  It is valid sh syntax as far as sh will execute it, and valid
perl syntax in the rest.  lintian is just too dump to grok it.

The real problem with a2ping is that is a generated file, and we do not
have the sources.  This has been missed since a generated Perl script is
really a rare thing.

Someone should ask Peter for the sources; I hope the script can be
generated with justlib present in its own directory, and no installation
of justlib is required.  Otherwise we would need to to package justlib
for Debian...

As for the others, we could put them into TEXMF/scripts and create our
own wrapper, stealing from texexec and dropping the hacks for strange
shells:

#!/bin/sh

what=`echo $0 | sed 's@.*/@@'`

p=`kpsewhich -format=texmfscripts $what.pl`
{ test -n "$p" && test -f "$p"; } \
  || { echo "\`$what.pl' not found."; exit 1; }

perl "$p" ${1+"$@"}


Regards, Frank
-- 
Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)



Reply to: