From 5bbb8e6b3f21fa26b35106580b4f0f3d42b79668 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Thu, 27 Sep 2018 15:15:55 -0500 Subject: [PATCH] Improve snap model assertion code for readability --- live-build/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/live-build/functions b/live-build/functions index e6471b77..cf68ba16 100644 --- a/live-build/functions +++ b/live-build/functions @@ -429,8 +429,8 @@ snap_prepare_assertions() { # Clear the assertions if they already exist if [ -e "$model_assertion" ] ; then - existing_model=$(sed -n 's/^model: \(.*\)$/\1/p' $model_assertion) - existing_brand=$(sed -n 's/^brand-id: \(.*\)$/\1/p' $model_assertion) + existing_model=$(awk '/^model: / {print $2}' $model_assertion) + existing_brand=$(awk '/^brand-id: / {print $2}' $model_assertion) echo "snap_prepare_assertions: replacing $existing_brand:$existing_model with $brand:$model" rm "$model_assertion" rm "$account_key_assertion"