aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/double_shebang_replacement___47__usr__47__bin__47__perl5.185.18.mdwn
blob: 63dcae897f5d9571e2fc9e62b1b691a00c991422 (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
Please consider this [[patch]] for merging in.
[[!format  diff """
From e697ba4ef7952ce549d449c4e4daea2e3f0a1aa7 Mon Sep 17 00:00:00 2001
From: Nikolay Orlyuk <virkony@gmail.com>
Date: Sun, 19 Oct 2014 18:46:34 +0300
Subject: [PATCH] fix shebang paths manipulations

Small enhancements for 67e778f4 to avoid erroneous she-bangs
"/usr/bin/perl5.185.18" (version suffix added twice).
---
 Makefile.PL | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.PL b/Makefile.PL
index 61fe336..2d54658 100755
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -63,7 +63,7 @@ docwiki:
 perl_shebangs:
 ifneq "$(PERL)" "/usr/bin/perl"
 	for file in $(shebang_scripts); do \
-		$(SED) -e "1s|^#!/usr/bin/perl|#!$(PERL)|" < $$file > "$$file.new"; \
+		$(SED) -e "1s|^#!/usr/bin/perl\>|#!$(PERL)|" < $$file > "$$file.new"; \
 		[ -x $$file ] && chmod +x "$$file.new"; \
 		mv -f "$$file.new" $$file; \
 	done
@@ -72,7 +72,7 @@ endif
 perl_shebangs_clean:
 ifneq "$(PERL)" "/usr/bin/perl"
 	for file in $(shebang_scripts); do \
-		$(SED) -e "1s|^#!$(PERL)|#!/usr/bin/perl|" < $$file > "$$file.new"; \
+		$(SED) -e "1s|^#!$(PERL)\>|#!/usr/bin/perl|" < $$file > "$$file.new"; \
 		[ -x $$file ] && chmod +x "$$file.new"; \
 		mv -f "$$file.new" $$file; \
 	done
-- 
2.1.2
"""]]

[[Done]], but this word-boundary construct didn't work on at least
one of my systems, so now we're using `$(PERL)` to do the job
portably. --[[schmonz]]