aboutsummaryrefslogtreecommitdiff
path: root/debian/Makefile.replace.sh
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2017-12-15 12:55:17 +0100
committerMihai Moldovan <ionic@ionic.de>2017-12-15 12:55:17 +0100
commit1dad092caf01d733990648e6df64cbf964df5143 (patch)
tree39de0e643e76754a3e23ca9dd0350b8ba4f76250 /debian/Makefile.replace.sh
parent6d70b9e3c47f27a166f4aacb522c5c1e49092dd9 (diff)
parent2b9025f797ee322e21077e100c2ee27c2e7fa0e0 (diff)
downloadnx-libs-1dad092caf01d733990648e6df64cbf964df5143.tar.gz
nx-libs-1dad092caf01d733990648e6df64cbf964df5143.tar.bz2
nx-libs-1dad092caf01d733990648e6df64cbf964df5143.zip
Merge branch '3.6.x'
Diffstat (limited to 'debian/Makefile.replace.sh')
-rw-r--r--debian/Makefile.replace.sh51
1 files changed, 0 insertions, 51 deletions
diff --git a/debian/Makefile.replace.sh b/debian/Makefile.replace.sh
deleted file mode 100644
index 83d6b5b3e..000000000
--- a/debian/Makefile.replace.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-# 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
- in=$1
- unset out
-
- # SEARCH must not be empty
- test -n "$2" || return
-
- while true; do
- # break loop if SEARCH is no longer in "$in"
- case "$in" in
- *"$2"*) : ;;
- *) break;;
- esac
-
- # append everything in "$in", up to the first instance of SEARCH, and REP, to "$out"
- out=$out${in%%"$2"*}$3
- # remove everything up to and including the first instance of SEARCH from "$in"
- in=${in#*"$2"}
- done
-
- # append whatever is left in "$in" after the last instance of SEARCH to out, and print
- printf '%s%s\n' "$out" "$in"
-}