From a3559a4d322eaf1c48d9ec47775c1b8b4bd9afcf Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Thu, 26 Mar 2015 20:59:27 +0100 Subject: [PATCH] contrib/sign.sh: fix handling of filenames with spaces --- contrib/sign.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/contrib/sign.sh b/contrib/sign.sh index a88c52df..082e967e 100755 --- a/contrib/sign.sh +++ b/contrib/sign.sh @@ -18,23 +18,23 @@ See also EOHELP exit 1 fi - -SECRET=$1 - -manifest=$2 -upper=$(mktemp) -lower=$(mktemp) - + +SECRET="$1" + +manifest="$2" +upper="$(mktemp)" +lower="$(mktemp)" + awk "BEGIN { sep=0 } /^---\$/ { sep=1; next } { if(sep==0) print > \"$upper\"; else print > \"$lower\"}" \ - $manifest - -ecdsasign $upper < $SECRET >> $lower - -cat $upper > $manifest -echo --- >> $manifest -cat $lower >> $manifest - -rm -f $upper $lower + "$manifest" + +ecdsasign "$upper" < "$SECRET" >> "$lower" + +cat "$upper" > "$manifest" +echo --- >> "$manifest" +cat "$lower" >> "$manifest" + +rm -f "$upper" "$lower"