summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/fixpaths
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2008-07-22 18:58:19 +0000
committerdes <des@FreeBSD.org>2008-07-22 18:58:19 +0000
commit666aa9cc1660793c97ef29a6cb66dfbb894dde8f (patch)
tree209e642fbe2a816041f67bc27c9800879f5541bc /crypto/openssh/fixpaths
parent624d93001f28e236c027516d88282351eb7bffbe (diff)
downloadFreeBSD-src-666aa9cc1660793c97ef29a6cb66dfbb894dde8f.zip
FreeBSD-src-666aa9cc1660793c97ef29a6cb66dfbb894dde8f.tar.gz
Revert part of 180714 - the intent was to flatten dist, not to nuke it.
Diffstat (limited to 'crypto/openssh/fixpaths')
-rwxr-xr-xcrypto/openssh/fixpaths22
1 files changed, 22 insertions, 0 deletions
diff --git a/crypto/openssh/fixpaths b/crypto/openssh/fixpaths
new file mode 100755
index 0000000..60a6799
--- /dev/null
+++ b/crypto/openssh/fixpaths
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# fixpaths - substitute makefile variables into text files
+# Usage: fixpaths -Dsomething=somethingelse ...
+
+die() {
+ echo $*
+ exit -1
+}
+
+test -n "`echo $1|grep -- -D`" || \
+ die $0: nothing to do - no substitutions listed!
+
+test -n "`echo $1|grep -- '-D[^=]\+=[^ ]\+'`" || \
+ die $0: error in command line arguments.
+
+test -n "`echo $*|grep -- ' [^-]'`" || \
+ die Usage: $0 '[-Dstring=replacement] [[infile] ...]'
+
+sed `echo $*|sed -e 's/-D\([^=]\+\)=\([^ ]*\)/-e s=\1=\2=g/g'`
+
+exit 0
OpenPOWER on IntegriCloud