From 0c66bc8ed92a1827eec57482a12c318f0eedff8b Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 15 Jun 2010 17:15:07 -0700 Subject: [PATCH] compat-wireless: fix code-metrics for 1 patch If we only have one patch then the currently grep will not parse correctly, force the grep to always include the filename so that the existing computation can be used for both the case we use only one patch file in the directories: linux-next-pending/ linux-next-cherry-pick/ crap/ This fixes the computation for linux-next-pending/ right now. Signed-off-by: Luis R. Rodriguez --- scripts/admin-update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh index 6ffdc75da738..d0b01cde24b8 100755 --- a/scripts/admin-update.sh +++ b/scripts/admin-update.sh @@ -94,8 +94,8 @@ nagometer() { CHANGES=0 ORIG_CODE=$2 - ADD=$(grep -c ^+ $1/*.patch| awk -F":" 'BEGIN {sum=0} {sum += $2} END { print sum}') - DEL=$(grep -c ^- $1/*.patch| awk -F":" 'BEGIN {sum=0} {sum += $2} END { print sum}') + ADD=$(grep -Hc ^+ $1/*.patch| awk -F":" 'BEGIN {sum=0} {sum += $2} END { print sum}') + DEL=$(grep -Hc ^- $1/*.patch| awk -F":" 'BEGIN {sum=0} {sum += $2} END { print sum}') # Total code is irrelevant unless you take into account each part, # easier to just compare against the original code. # let TOTAL_CODE=$ORIG_CODE+$ADD-$DEL -- 2.30.2