From cc99d745fc6b49cd9820f20a850c761c7fa7f283 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Tue, 19 Apr 2016 16:06:36 +0200 Subject: [PATCH 1/2] Fix dirname bug introduced since #156. --- Makefile | 4 ++-- vimpager | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7c8e5c8..18b9e9e 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,7 @@ standalone/%: ${SRC} inc/* fi; \ cp $@ ${@}.work; \ nlinit="`echo 'nl=\"'; echo '\"'`"; eval "$$nlinit"; \ - sed "/^[ ]*\.[ ]*.*inc\/prologue.sh[ ]*"'$$'"/{$${nl}\ + sed "/^[ ]*\.[ ]*.*inc\/prologue.sh.*"'$$'"/{$${nl}\ x$${nl}\ r inc/prologue.sh$${nl}\ }" ${@}.work > $@; \ @@ -148,7 +148,7 @@ install: docs vimpager.configured vimcat.configured @echo configuring $<; \ MY_SHELL="`scripts/find_shell`"; \ sed -e '1{ s|.*|#!'"$$MY_SHELL"'|; }' \ - -e '/^[ ]*\.[ ]*.*inc\/prologue.sh[ ]*$$/d' \ + -e '/^[ ]*\.[ ]*.*inc\/prologue.sh.*$$/d' \ -e 's|^version=.*|version="'"`git describe`"' (configured, shell='"$$MY_SHELL"')"|' \ -e 's!^ PREFIX=.*! PREFIX=${PREFIX}!' \ -e 's!^ configured=0! configured=1!' $< > $@; \ diff --git a/vimpager b/vimpager index 33ca454..f96fe27 100755 --- a/vimpager +++ b/vimpager @@ -9,7 +9,7 @@ if [ ! -t 1 ]; then exec cat "${@}" fi -. "${0%/*}/inc/prologue.sh" +. "`dirname \"$0\"`/inc/prologue.sh" version="$(cd "${0%/*}"; git describe) (git)" From 253e80b897e8c66233f4b504da88f3efc93ecf03 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Tue, 19 Apr 2016 13:29:42 +0200 Subject: [PATCH 2/2] Fix complicated sed command in Makefile. --- Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 18b9e9e..15cfd7b 100644 --- a/Makefile +++ b/Makefile @@ -62,11 +62,10 @@ standalone/%: ${SRC} inc/* done; \ fi; \ cp $@ ${@}.work; \ - nlinit="`echo 'nl=\"'; echo '\"'`"; eval "$$nlinit"; \ - sed "/^[ ]*\.[ ]*.*inc\/prologue.sh.*"'$$'"/{$${nl}\ - x$${nl}\ - r inc/prologue.sh$${nl}\ - }" ${@}.work > $@; \ + sed -e '/^[ ]*\.[ ]*.*inc\/prologue.sh.*$$/{' \ + -e 'r inc/prologue.sh' \ + -e d \ + -e '}' ${@}.work > $@; \ rm -f ${@}.work; \ if grep '^: if 0$$' ${@} >/dev/null; then \ scripts/balance-vimcat $@; \