aboutsummaryrefslogtreecommitdiff
path: root/debian/Makefile.replace.sh
diff options
context:
space:
mode:
Diffstat (limited to 'debian/Makefile.replace.sh')
-rw-r--r--debian/Makefile.replace.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/debian/Makefile.replace.sh b/debian/Makefile.replace.sh
index d47d92bf4..83d6b5b3e 100644
--- a/debian/Makefile.replace.sh
+++ b/debian/Makefile.replace.sh
@@ -1,5 +1,29 @@
# from http://mywiki.wooledge.org/BashFAQ/021
+# The ${a/b/c} substitution is not POSIX compatible. Additionally, in
+# bash 3.x, quotes do not escape slashes. This causes screwed up
+# installation paths.
+#
+# SLES 11, bash-3.2-147.9.13
+# $ dirname="foo/bar"
+# $ echo ${dirname//"foo/bar"/"omg/nei"}
+# bar/omg/nei/bar
+#
+# openSUSE 12.2, bash-4.2-51.6.1
+# $ dirname="foo/bar"
+# $ echo ${dirname//"foo/bar"/"omg/nei"}
+# omg/nei
+#
+# openSUSE 12.2, dash-0.5.7-5.1.2.x86_64
+# $ dirname="foo/bar"
+# $ echo ${dirname//"foo/bar"/"omg/nei"}
+# dash: 2: Bad substitution
+#
+# Source this file into your bash scripts to make available
+# a replacement (the string_rep function) for this substitution
+# mess.
+#
+
string_rep()
{
# initialize vars