portability awk add space between -v and it's argument, if anything has changed add ./COPYRIGHT

This commit is contained in:
Mark Andrews
2012-05-21 15:17:22 +10:00
parent 3456d2c230
commit 7207962f87
+4 -2
View File
@@ -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