From ec5b2adbf1e1fb87cf904479d13f64738602f9dc Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Sat, 11 Jan 2014 12:39:10 +0100 Subject: [PATCH] autoupdater: Use awk instead of grep+head+tail to split manifest --- gluon/gluon-autoupdater/files/usr/sbin/autoupdater | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gluon/gluon-autoupdater/files/usr/sbin/autoupdater b/gluon/gluon-autoupdater/files/usr/sbin/autoupdater index 2f949a9..2821c41 100755 --- a/gluon/gluon-autoupdater/files/usr/sbin/autoupdater +++ b/gluon/gluon-autoupdater/files/usr/sbin/autoupdater @@ -71,11 +71,7 @@ manifest_lower=$(mktemp) wget -O$manifest "$BASE"/manifest || fail "Couldn't fetch manifest" -seperator_line=$(cat $manifest|grep -n "^---$"|cut -d: -f1|head -n1) || \ - fail "Could't find --- marker!" - -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; else print > "'$manifest_lower'" }' $manifest > $manifest_upper signatures="" while read sig; do