From 54620d62318d9bf6ed88dca96ce388f57e9490b0 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Fri, 17 Jan 2014 16:09:34 +0100 Subject: [PATCH] autoupdater: Use awk instead of grep+head+tail to split manifest --- .../gluon-autoupdater/files/usr/sbin/autoupdater | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/package/gluon-autoupdater/files/usr/sbin/autoupdater b/package/gluon-autoupdater/files/usr/sbin/autoupdater index 6a543fad..bdd23245 100755 --- a/package/gluon-autoupdater/files/usr/sbin/autoupdater +++ b/package/gluon-autoupdater/files/usr/sbin/autoupdater @@ -59,15 +59,11 @@ if test $? -ne 0; then exit 1 fi -seperator_line=$(cat $manifest|grep -n "^---$"|cut -d: -f1|head -n1) - -if test -z "$seperator_line"; then - echo "Couldn't find --- marker!" >&2 - exit 1 -fi - -head -n$(($seperator_line-1)) $manifest > $manifest_upper -tail -n+$(($seperator_line+1)) $manifest > $manifest_lower +awk "BEGIN { sep=0 } + /^---\$/ { sep=1; next } + { if(sep==0) print > \"$manifest_upper\"; + else print > \"$manifest_lower\"}" \ + $manifest signatures="" while read sig; do