Skip to content

Commit

Permalink
Do not remove '/usr/bin/env ...' paths in scripts. (#365)
Browse files Browse the repository at this point in the history
If user explicitly asks to use a particular verion (...by having it in her environment):  use it.

Signed-off-by: Henry Cox <[email protected]>
  • Loading branch information
henry2cox authored Dec 20, 2024
1 parent ffd1c1c commit 58e4581
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ install:
$(INSTALL) -m 755 bin/$$b $(BIN_INST_DIR)/$$b ; \
$(FIX) --version $(VERSION) --release $(RELEASE) \
--libdir $(LIB_DIR) --bindir $(BIN_DIR) \
--fixinterp --fixver --fixlibdir --fixbindir \
--fixver --fixlibdir --fixbindir \
--exec $(BIN_INST_DIR)/$$b ; \
done
$(INSTALL) -d -m 755 $(SCRIPT_INST_DIR)
Expand All @@ -131,7 +131,7 @@ install:
$(INSTALL) -m 755 scripts/$$s $(SCRIPT_INST_DIR)/$$s ; \
$(FIX) --version $(VERSION) --release $(RELEASE) \
--libdir $(LIB_DIR) --bindir $(BIN_DIR) \
--fixinterp --fixver --fixlibdir \
--fixver --fixlibdir \
--fixscriptdir --scriptdir $(SCRIPT_DIR) \
--exec $(SCRIPT_INST_DIR)/$$s ; \
done
Expand All @@ -141,7 +141,7 @@ install:
$(INSTALL) -m 644 lib/$$l $(LIB_INST_DIR)/$$l ; \
$(FIX) --version $(VERSION) --release $(RELEASE) \
--libdir $(LIB_DIR) --bindir $(BIN_DIR) \
--fixinterp --fixver --fixlibdir --fixbindir \
--fixver --fixlibdir --fixbindir \
--exec $(LIB_INST_DIR)/$$l ; \
done
for section in 1 5 ; do \
Expand Down
6 changes: 4 additions & 2 deletions bin/fix.pl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ ($)
}

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

if ($opt_fixlibdir) {
Expand Down Expand Up @@ -133,7 +134,8 @@ ($)
my $path = $ENV{"LCOV_PYTHON_PATH"};

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

return $source;
Expand Down

0 comments on commit 58e4581

Please sign in to comment.