]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: mkvers: fix a bug in sed statement
authorCorinna Vinschen <corinna@vinschen.de>
Sat, 1 Dec 2018 15:50:40 +0000 (16:50 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Sat, 1 Dec 2018 16:00:35 +0000 (17:00 +0100)
While reformatting the script, backticks `` were replaced with
brackets $().  This in turn invalidated the \\( ... \\) expressions in the
sed script because backslash resolution in $() works differently from
backslash resolution in ``.  Only a single backslash is valid now.

While at it, fix up the uname(2) date representation when building a
snapshot.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/mkvers.sh

index 5aecb141bc79584fed21eba2dc54afe8be8c6557..6309c84b1d55b5527442a1ef483913312720aa42 100755 (executable)
@@ -140,7 +140,8 @@ done | tee /tmp/mkvers.$$ 1>&9
 trap "rm -f /tmp/mkvers.$$" 0 1 2 15
 
 if [ -n "$snapshotdate" ]; then
-  usedate="$(echo $snapshotdate | sed 's/-\\(..:..[^-]*\\).*$/ \1SNP/')"
+  usedate="$(echo $snapshotdate \
+            | sed -e 's/\(....\)\(..\)\(..\)-\(..:..\).*$/\1-\2-\3 \4SNP/')"
 else
   usedate="$builddate"
 fi
This page took 0.030857 seconds and 5 git commands to generate.