From 7207962f87362cfdba5c34819d3b67cd7d8e6c73 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 21 May 2012 15:11:34 +1000 Subject: [PATCH] portability awk add space between -v and it's argument, if anything has changed add ./COPYRIGHT --- util/recent_changes.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/recent_changes.sh b/util/recent_changes.sh index 8462cc9b8c..729559557f 100644 --- a/util/recent_changes.sh +++ b/util/recent_changes.sh @@ -22,8 +22,10 @@ # current one is seen. Used by merge_copyrights. thisyear=`date +%Y` -git whatchanged --pretty="date %ai" --date=iso8601 | awk -vre="${thisyear}-" ' +git whatchanged --pretty="date %ai" --date=iso8601 | awk -v re="${thisyear}-" ' + BEGIN { change=0 } $1 == "date" && $2 !~ re { exit(0); } $1 == "date" { next; } NF == 0 { next; } - $(NF-1) ~ /[AM]/ { print "./" $NF }' | sort | uniq + $(NF-1) ~ /[AM]/ { print "./" $NF; change=1 } + END { if (change) print "./COPYRIGHT" } ' | sort | uniq