aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishal Bhoj <vishal.bhoj@linaro.org>2016-07-05 21:41:47 +0530
committerFathi Boudra <fathi.boudra@linaro.org>2016-07-07 05:46:04 +0000
commita95cc2f25b6956f31ef1665c97ce292780e98e2b (patch)
treefdc60e1490bbb4044f85e1c33f6c68e8eb075f85
parent31950ec97111f093f2f33bae1325f9eb27c3e1da (diff)
downloadlinaro-android-build-tools-a95cc2f25b6956f31ef1665c97ce292780e98e2b.tar.gz
Capture the changelog
Change-Id: I5777dd4e3a355271453477c41cabed955efab841 Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
-rw-r--r--build-scripts/build-android25
-rw-r--r--build-scripts/helpers9
2 files changed, 34 insertions, 0 deletions
diff --git a/build-scripts/build-android b/build-scripts/build-android
index 5afa9ed..d8c2ac9 100644
--- a/build-scripts/build-android
+++ b/build-scripts/build-android
@@ -96,6 +96,30 @@ else
$BUILD_SCRIPT_ROOT/$POST_CHECKOUT_HOOK
fi
+ # Generate a Changelog describing additional patches applied to AOSP codebase
+ export android_version=`grep -rni "refs/tags" .repo/manifest.xml | sed -e "s/.*tags\///" -e "s/\"//g"`
+ repo forall -c 'if git rev-parse $android_version >/dev/null 2>&1
+ then
+ patches=`git log --oneline --no-merges $android_version..HEAD | wc -l`
+ if [ $patches -ne 0 ]; then
+ git_remote=`git remote -v | grep "fetch" | cut -f2 | cut -d " " -f1`
+ echo "====================================================================="
+ echo "Patchsets applied to $git_remote on top of $android_version"
+ git diff --stat $android_version HEAD
+ git log --oneline --no-merges $android_version..HEAD
+ echo ""
+ fi;
+ fi' | cat > temp_changelog.txt
+ files_changed=`add_changes \`grep "files changed" temp_changelog.txt | cut -d " " -f2\``
+ insertions=`add_changes \`grep "files changed" temp_changelog.txt | cut -d " " -f5\``
+ deletions=`add_changes \`grep "files changed" temp_changelog.txt | cut -d " " -f7\``
+ echo "=====================================================================" > changelog.txt
+ echo "=====================================================================" >> changelog.txt
+ echo "$files_changed files changed, $insertions insertions(+), $deletions deletions(-)" >> changelog.txt
+ echo "=====================================================================" >> changelog.txt
+ echo "=====================================================================" >> changelog.txt
+ echo "" >> changelog.txt
+ cat temp_changelog.txt >> changelog.txt
trap - ERR
. build/envsetup.sh
trap infrastructure_error ERR
@@ -275,5 +299,6 @@ cat > out/build_config.json <<EOF
"dtb" : ${dtb}
}
EOF
+cp changelog.txt out/
flatten_artifacts
diff --git a/build-scripts/helpers b/build-scripts/helpers
index 3380ef0..b014b1a 100644
--- a/build-scripts/helpers
+++ b/build-scripts/helpers
@@ -263,3 +263,12 @@ else
echo "/tmp/"
fi
}
+
+add_changes() {
+count=0
+for i in "${@}"
+do
+ count=$(( $count + $i ))
+done
+echo $count
+}