[gnutls-devel] [PATCH 3/4] tests: nist-pkits: cleanup shell/perl usage

Alon Bar-Lev alon.barlev at gmail.com
Fri Jun 19 23:26:45 CEST 2015


On 19 June 2015 at 07:02, Alon Bar-Lev <alon.barlev at gmail.com> wrote:
>
> On 18 June 2015 at 14:25, Nikos Mavrogiannopoulos <nmav at gnutls.org> wrote:
> >
> > On Thu, Jun 18, 2015 at 11:05 AM, Alon Bar-Lev <alon.barlev at gmail.com> wrote:
> > > On 18 June 2015 at 11:57, Nikos Mavrogiannopoulos <nmav at gnutls.org> wrote:
> > >> Thanks. I've applied all except for this one. In that case
> > >> "#!/usr/bin/perl" part is not needed. It is handled by the eval part
> > >> which will detect perl even if in a different path.
> > > This is ugly! :)
> > > consider #!/usr/bin/env perl ?
> > > or better, I can add autoconf detection for perl.
> >
> > Very ugly. I don't even remember why it was added. The problem it
> > solved was supposedly to detect perl in all systems, by avoiding hard
> > coded paths, but I'm not sure whether that was a real problem. If you
> > have a better solution I'm certainly interested.
>
> At least add #!/bin/sh in this case for now?

it is confusing... you use multiple methods to locate perl.

Examples:

cfg.mk: perl $< elf >> $@
devel/perlasm/cpuid-x86.pl:#!/usr/bin/env perl
tests/suite/asn1random.pl:#!/usr/bin/perl -w
tests/suite/x509random.pl:#!/usr/bin/perl -w
tests/nist-pkits/build-chain:eval '(exit $?0)' && eval 'exec perl -wST
"$0" ${1+"$@"}' & eval 'exec perl -wST "$0" $argv:q'

Maybe reduce that to one?

The #!/usr/bin/env perl is the closest to what you want to achieve and
as it already there, it can serve all cases.

>
> >
> > > or convert this script to shell? it is not using much of perl
> > > anyway... just executing shell over and over.
> >
> > There many other scripts in perl, so it wouldn't make much sense.
> >
> > regards,
> > Nikos



More information about the Gnutls-devel mailing list