From c86a98e8202737fa9cb52e1cabdc9c27c4d24bf7 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 25 May 2010 15:40:32 -0700 Subject: [PATCH] compat-wireless: fix backport code calculation The current computation was not taking into account the compat/*.[ch] files and the include/linux/compat*.h files. Additionally these files were just being counted towards the total sum of the upstream code. Remove the compat code from the total sum of upstream code, and add the compat code to the backport sum. This also adds a new line to indicate to us the size of the total backport work (patches + compat) and compat alone. These are the stats I get today: compat-wireless code metrics 491620 - Total upstream code being pulled 1393 - backport code changes 1163 - backport code additions 230 - backport code deletions 5679 - backport from compat module 7072 - total backport code 1.44 - % of code consists of backport work Signed-off-by: Luis R. Rodriguez --- scripts/admin-update.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh index 813f09e02019..8ff64cd32ddb 100755 --- a/scripts/admin-update.sh +++ b/scripts/admin-update.sh @@ -57,10 +57,16 @@ usage() { } brag_backport() { + COMPAT_FILES_CODE=$(find ./ -type f -name \*.[ch] | egrep "^./compat/|include/linux/compat" | + xargs wc -l | tail -1 | awk '{print $1}') + let COMPAT_ALL_CHANGES=$2+$COMPAT_FILES_CODE printf "${GREEN}%10s${NORMAL} - backport code changes\n" $2 printf "${GREEN}%10s${NORMAL} - backport code additions\n" $3 printf "${GREEN}%10s${NORMAL} - backport code deletions\n" $4 - printf "${RED}%10s${NORMAL} - %% of code consists of backport work\n" $(perl -e 'printf("%.2f", 100 * '$2' / '$1');') + printf "${GREEN}%10s${NORMAL} - backport from compat module\n" $COMPAT_FILES_CODE + printf "${GREEN}%10s${NORMAL} - total backport code\n" $COMPAT_ALL_CHANGES + printf "${RED}%10s${NORMAL} - %% of code consists of backport work\n" \ + $(perl -e 'printf("%.2f", 100 * '$COMPAT_ALL_CHANGES' / '$1');') } nag_next_cherry_pick() { @@ -389,7 +395,9 @@ if [[ "$REFRESH" = "y" ]]; then done fi -ORIG_CODE=$(find ./ -type f -name \*.[ch]| xargs wc -l | tail -1 | awk '{print $1}') +ORIG_CODE=$(find ./ -type f -name \*.[ch] | + egrep -v "^./compat/|include/linux/compat" | + xargs wc -l | tail -1 | awk '{print $1}') printf "\n${CYAN}compat-wireless code metrics${NORMAL}\n\n" > $CODE_METRICS printf "${PURPLE}%10s${NORMAL} - Total upstream code being pulled\n" $ORIG_CODE >> $CODE_METRICS -- 2.30.2