* [PATCH] configure: fix $prefix expansion for libdir_expanded
@ 2017-01-01 17:20 Tomi Ollila
0 siblings, 0 replies; only message in thread
From: Tomi Ollila @ 2017-01-01 17:20 UTC (permalink / raw)
To: notmuch; +Cc: tomi.ollila
Since the sed expansion line which did $prefix expansion for
libdir_expanded was changed from the legacy `...` format to the
new $(...) expression, the subtle backslash expansion change went
unnoticed -- \\$ which used to escape '$' now escapes '\' and the
following '$prefix' was attempted to expand as a variable. So
changing \\$ to \$ fixes this.
Also, replaced echo with printf %s -- echo does expansions of its own.
While at it, the following 2 inconsistencies were fixed:
1) the /g flag was removed from first expression; second didn't have it
2) first expression did not end with /, so "dropped" it from second
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index 72db26d..ddfbbab 100755
--- a/configure
+++ b/configure
@@ -284,7 +284,7 @@ if [ -z "$LIBDIR" ] ; then
libdir_expanded="${PREFIX}/lib"
else
# very non-general variable expansion
- libdir_expanded=$(echo "$LIBDIR" | sed "s|\\${prefix}|${PREFIX}|g; s|\\$prefix/|${PREFIX}/|; s|//*|/|g")
+ libdir_expanded=$(printf %s "$LIBDIR" | sed "s|\${prefix}|${PREFIX}|; s|\$prefix\>|${PREFIX}|; s|//*|/|g")
fi
cat <<EOF
--
2.9.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-01-01 17:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-01 17:20 [PATCH] configure: fix $prefix expansion for libdir_expanded Tomi Ollila
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).