Re: [PATCH] Makefile: Remove excess backslashes from sed
- From
David Aguilar <davvid@gmail.com>
- Date
- Apr 9, 2010, 06:04 UTC
- Message-ID
- <20100409060427.GA6012@gmail.com>
- In-Reply-To
- <1270783330-35215-1-git-send-email-brian@gernhardtsoftware.com>
On Thu, Apr 08, 2010 at 11:22:10PM -0400, Brian Gernhardt wrote:
> The sed script that was intended to add lines altering the sys.path > had extra backslashes in them. Instead resulting [snip] > import sys; \ import os; \ sys.path.insert( ... )
On linux sed I get (or I was dreaming when I tried it):
import sys; \ import os; \ sys.path.insert(0, os.getenv(foo, bar))
We should instead smash it all into one line instead to avoid differences in sed behavior:
import sys; import os; sys.path.insert(0, os.getenv(foo,
bar))If that's what it is, then your patch would produce this on linux:
import sys; import os; sys.path.insert(foo, bar)
...which is invalid syntax.
So let's smash it all onto one line instead. That way I don't have to think about or test whether there's any difference in how sed handles newlines. It'll be the Obviously Correct(tm) sol'n. Or maybe I was dreaming?
If you don't beat me to it by the tomorrow night I'll try and throw together a patch. Thanks for catching this.
Show 14 quoted lines
> diff --git a/Makefile b/Makefile
> index f0fe351..b9eb1ca 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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@@"));|' \-- David