bug-gnulib
[Top][All Lists]
Advanced

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

Re: Explicit interpreter paths considered harmful


From: Jim Meyering
Subject: Re: Explicit interpreter paths considered harmful
Date: Fri, 30 Oct 2009 09:52:28 +0100

Ludovic Courtès wrote:
> address@hidden (Karl Berry) writes:
>
>>     -#!/usr/bin/perl
>>     +#!/bin/sh
>>
>> Just to mention that an alternative would be #!/usr/bin/env perl.
>
> It won’t work on NixOS, which doesn’t have /usr/bin.  (On NixOS, the
> only “standard” path that can be relied on is /bin/sh.)

FYI, this appears to work, both when invoked directly, and when invoked
as "perl gitlog-to-changelog ...", but I'm still on the fence...
Is it worth the ugliness, when invoking with $(PERL) is so easy, and
when the recommended usage is not to run them from the command line.

diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index a0f8a08..7f1880c 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -1,7 +1,9 @@
-#!/usr/bin/perl
+eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
+  & eval 'exec /usr/bin/perl -wS "$0" $argv:q'
+    if 0;
 # Convert git log output to ChangeLog format.

-my $VERSION = '2009-08-12 16:49'; # UTC
+my $VERSION = '2009-10-30 08:49'; # UTC
 # The definition above must lie within the first 8 lines in order
 # for the Emacs time-stamp write hook (at end) to update it.
 # If you change this file with Emacs, please let the write hook




reply via email to

[Prev in Thread] Current Thread [Next in Thread]