Skip to contentSkip to conversation

Makefile: Remove excess backslashes from sed

PATCH In review Brian Gernhardt 2 participants 2 messages Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Remove excess backslashes from sed

The sed script that was intended to add lines altering the sys.path had extra backslashes in them. Instead resulting in

import sys; import os; sys.path.insert( ... )

It output

import sys; \ import os; \ sys.path.insert( ... )

Unfortunately this caused python (2.6.1 on OS X 10.6.3) to error

SyntaxError: unexpected character after line continuation character

Removing two of the backslashes solves this problem.

---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index f0fe351..b9eb1ca 100644
@@ -1632,8 +1632,8 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : %.py
 	sed -e '1{' \
 	    -e '	s|#!.*python|#!$(PYTHON_PATH_SQ)|' \
 	    -e '}' \
-	    -e 's|^import sys.*|&; \\\
-	           import os; \\\
+	    -e 's|^import sys.*|&; \
+	           import os; \
 	           sys.path.insert(0, os.getenv("GITPYTHONLIB",\
 	                                        "@@INSTLIBDIR@@"));|' \
 	    -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
Signature · 1 line
1.7.1.rc0.243.g2ce66
#1 lore raw

This is the same patch as before. I forgot --dry-run while testing git-send-email. My apologies.

Quoted 42 lines · Brian Gernhardt

The sed script that was intended to add lines altering the sys.path had extra backslashes in them. Instead resulting in

import sys; import os; sys.path.insert( ... )

It output

import sys; \ import os; \ sys.path.insert( ... )

Unfortunately this caused python (2.6.1 on OS X 10.6.3) to error

SyntaxError: unexpected character after line continuation character

Removing two of the backslashes solves this problem.

---
Makefile | 4 ++--

1 files changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index f0fe351..b9eb1ca 100644
@@ -1632,8 +1632,8 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : %.py
 	sed -e '1{' \
 	    -e '	s|#!.*python|#!$(PYTHON_PATH_SQ)|' \
 	    -e '}' \
-	    -e 's|^import sys.*|&; \\\
-	           import os; \\\
+	    -e 's|^import sys.*|&; \
+	           import os; \
 	           sys.path.insert(0, os.getenv("GITPYTHONLIB",\
 	                                        "@@INSTLIBDIR@@"));|' \
 	    -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
Signature · 6 lines
1.7.1.rc0.243.g2ce66

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html