Skip to content

Instantly share code, notes, and snippets.

@aroig
Created March 4, 2013 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aroig/5082616 to your computer and use it in GitHub Desktop.
Save aroig/5082616 to your computer and use it in GitHub Desktop.
magit Makefile patch
From 6caa5a8f8a2534e56fc0470c3c636ca15765eac6 Mon Sep 17 00:00:00 2001
From: Abdo Roig-Maranges <abdo.roig@gmail.com>
Date: Mon, 4 Mar 2013 15:15:49 +0100
Subject: [PATCH] replace echo's by printf in the Makefile
echo is inconsistent regarding the treatment of escaped characters (like
'\n'). It replaces them in zsh, but not in bash, for instance. printf is
more portable.
---
Makefile | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 7caabae..4544fda 100644
--- a/Makefile
+++ b/Makefile
@@ -57,9 +57,9 @@ magit-$(VERSION).tar.gz: $(DIST_FILES) $(DIST_FILES_CONTRIB)
mkdir -p magit-$(VERSION)/contrib
cp -p $(DIST_FILES) magit-$(VERSION)
cp -p $(DIST_FILES_CONTRIB) magit-$(VERSION)/contrib
- echo "1s/=.*/=$(VERSION)/\nw" | ed -s magit-$(VERSION)/Makefile #NO_DIST
- echo "g/NO_DIST/d\nw" | ed -s magit-$(VERSION)/Makefile #NO_DIST
- echo ",s/@GIT_DEV_VERSION@/$(VERSION)/\nw" | ed -s magit-$(VERSION)/magit.el #NO_DIST
+ printf "1s/=.*/=$(VERSION)/\nw\n" | ed -s magit-$(VERSION)/Makefile #NO_DIST
+ printf "g/NO_DIST/d\nw\n" | ed -s magit-$(VERSION)/Makefile #NO_DIST
+ printf ",s/@GIT_DEV_VERSION@/$(VERSION)/\nw\n" | ed -s magit-$(VERSION)/magit.el #NO_DIST
tar -cvzf magit-$(VERSION).tar.gz magit-$(VERSION)
rm -rf magit-$(VERSION)
@@ -68,7 +68,7 @@ elpa: magit-$(VERSION).tar
magit-$(VERSION).tar: $(ELPA_FILES)
mkdir magit-$(VERSION)
cp -p $(ELPA_FILES) magit-$(VERSION)
- echo ",s/@GIT_DEV_VERSION@/$(VERSION)/\nw" | ed -s magit-$(VERSION)/magit.el #NO_DIST
+ printf ",s/@GIT_DEV_VERSION@/$(VERSION)/\nw\n" | ed -s magit-$(VERSION)/magit.el #NO_DIST
tar -cvf magit-$(VERSION).tar magit-$(VERSION)
rm -rf magit-$(VERSION)
@@ -77,7 +77,7 @@ install: install_core install_docs
install_core: core
mkdir -p $(ELISP_INSTALL_DIR)
install -m 644 $(ELS) $(ELCS) $(ELISP_INSTALL_DIR)
- echo ",s/@GIT_DEV_VERSION@/$(VERSION)/\nw" | ed -s $(ELISP_INSTALL_DIR)/magit.el #NO_DIST
+ printf ",s/@GIT_DEV_VERSION@/$(VERSION)/\nw\n" | ed -s $(ELISP_INSTALL_DIR)/magit.el #NO_DIST
mkdir -p $(DESTDIR)$(SYSCONFDIR)/emacs/site-start.d
install -m 644 50magit.el $(DESTDIR)$(SYSCONFDIR)/emacs/site-start.d/50magit.el
--
1.8.1.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment