File: fixconfigure

package info (click to toggle)
eperl 2.2.14-21
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,304 kB
  • ctags: 738
  • sloc: ansic: 4,694; perl: 584; sh: 556; makefile: 353
file content (30 lines) | stat: -rwxr-xr-x 663 bytes parent folder | download | duplicates (30)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
:
eval 'exec perl -S $0 ${1+"$@"}'
    if $running_under_some_shell;
##
##  add BASH bootstrap hack to a configure script
##  Copyright (c) Ralf S. Engelschall, All Rights Reserved.
##

open(FPI, "<$ARGV[0]");
open(FPO, ">$ARGV[0].n");
while (<FPI>) {
    if (m|#! /bin/sh\n|) {
        print FPO "#! /bin/sh\n";
        print FPO <<'EOF'
# if we can run at the top, why should we stay at the bottom any longer?
if [ ".$BASH" = . ]; then BASH=`which bash`; if [ ".$BASH" != . ]; then exec $BASH $0 $*; fi; fi
EOF
;
	}
	else {
        print FPO $_;
    }
}
close(FPO);
close(FPI);
unlink("$ARGV[0]");
link("$ARGV[0].n", "$ARGV[0]");
unlink("$ARGV[0].n");

##EOF##