From 10b04783d40bcd0e7aa395b76f1a6d02417a64e2 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Mon, 19 Nov 2018 03:17:30 +1100 Subject: [PATCH] tidy up some awk invocations --- do_merge | 4 ++-- update_trees | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/do_merge b/do_merge index d1c52e7..391fbee 100755 --- a/do_merge +++ b/do_merge @@ -91,7 +91,7 @@ do_rebase() } -heads=$(grep -v '^#' "$CTRL_FILE" | awk -F '\t' '$2=="quilt" || $2=="git" { printf("%s/%s ", $3, $5); } $2=="branch" { printf("branch/%s ", $1); }') +heads=$(awk -F '\t' '/^#/ { next; } $2=="quilt" || $2=="git" { printf("%s/%s ", $3, $5); } $2=="branch" { printf("branch/%s ", $1); }' "$CTRL_FILE") need_build=false @@ -179,7 +179,7 @@ for h in $heads; do } $need_build || continue - do_build=$(grep -v '^#' $CTRL_FILE | awk -F ' ' '$3=="'$tree'" { print $6; }') + do_build=$(awk -F '\t' '/^[^#]/ && $3=="'$tree'" { print $6; }' "$CTRL_FILE") [ "$do_build" = "yes" ] || continue git push -f "${build_host}${build_host:+:}${build_dir}" master:refs/heads/next || { diff --git a/update_trees b/update_trees index 5d4e90a..b09a01a 100755 --- a/update_trees +++ b/update_trees @@ -19,14 +19,14 @@ execute() cpwd=$(pwd) -quilters=$(grep -v '^#' $CTRL_FILE | awk -F '\t' '$2=="quilt" { print $3; }') +quilters=$(awk -F '\t' '/^[^#]/ && $2=="quilt" { print $3; }' "$CTRL_FILE") for name in $quilters; do sfile="../quilt/$name/series" base=$(sed -n 's/^#[ \t]*NEXT[-_]BASE[ \t]*\([^ \t]*\)[ \t]*$/\1/p' "$sfile") if [ -n "$base" ]; then - nbase=$(grep -v '^#' $CTRL_FILE | awk -F '\t' '$3=="'"$base"'" { printf("%s/%s", "'"$base"'", $5); }') + nbase=$(awk -F '\t' '/^[^#]/ && $3=="'"$base"'" { printf("%s/%s", "'"$base"'", $5); }' "$CTRL_FILE") [ -n "$nbase" ] && base="$nbase" else base=$(sed -n 's/^#[ \t]*BASE[ \t]*\(.*\)[ \t]*$/\1/p' "$sfile") -- 2.39.5