Skip to content

Commit b8f3a67

Browse files
committed
Do not remove '/usr/bin/env ...' paths in scripts.
If user explicitly asks to use a particular verion (...by having it in her environment): use it. Signed-off-by: Henry Cox <[email protected]>
1 parent eb0c3c3 commit b8f3a67

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ install:
122122
$(INSTALL) -m 755 bin/$$b $(BIN_INST_DIR)/$$b ; \
123123
$(FIX) --version $(VERSION) --release $(RELEASE) \
124124
--libdir $(LIB_DIR) --bindir $(BIN_DIR) \
125-
--fixinterp --fixver --fixlibdir --fixbindir \
125+
--fixver --fixlibdir --fixbindir \
126126
--exec $(BIN_INST_DIR)/$$b ; \
127127
done
128128
$(INSTALL) -d -m 755 $(SCRIPT_INST_DIR)
@@ -131,7 +131,7 @@ install:
131131
$(INSTALL) -m 755 scripts/$$s $(SCRIPT_INST_DIR)/$$s ; \
132132
$(FIX) --version $(VERSION) --release $(RELEASE) \
133133
--libdir $(LIB_DIR) --bindir $(BIN_DIR) \
134-
--fixinterp --fixver --fixlibdir \
134+
--fixver --fixlibdir \
135135
--fixscriptdir --scriptdir $(SCRIPT_DIR) \
136136
--exec $(SCRIPT_INST_DIR)/$$s ; \
137137
done
@@ -141,7 +141,7 @@ install:
141141
$(INSTALL) -m 644 lib/$$l $(LIB_INST_DIR)/$$l ; \
142142
$(FIX) --version $(VERSION) --release $(RELEASE) \
143143
--libdir $(LIB_DIR) --bindir $(BIN_DIR) \
144-
--fixinterp --fixver --fixlibdir --fixbindir \
144+
--fixver --fixlibdir --fixbindir \
145145
--exec $(LIB_INST_DIR)/$$l ; \
146146
done
147147
for section in 1 5 ; do \

bin/fix.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ ($)
100100
}
101101

102102
if ($opt_fixinterp && defined($path) && $path ne "") {
103-
$source =~ s/^#!.*perl.*\n/#!$path\n/;
103+
$source =~ s/^#!.*perl.*\n/#!$path\n/
104+
unless $source =~ @^#!/usr/bin/env perl$@;
104105
}
105106

106107
if ($opt_fixlibdir) {
@@ -133,7 +134,8 @@ ($)
133134
my $path = $ENV{"LCOV_PYTHON_PATH"};
134135

135136
if ($opt_fixinterp && defined($path) && $path ne "") {
136-
$source =~ s/^#!.*python.*\n/#!$path\n/;
137+
$source =~ s/^#!.*python.*\n/#!$path\n/
138+
unless $source =~ @^#!/usr/bin/env python3?$@;
137139
}
138140

139141
return $source;

0 commit comments

Comments
 (0)