summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuimin Zhang <thehobn@gmail.com>2016-03-30 00:54:16 -0700
committerMartin Roth <martinroth@google.com>2016-04-24 04:19:13 +0200
commit2fb2483d44c69d5a5493cb257c82a28aac326806 (patch)
tree7c7e80b6b267df69ed6a9d82da00790bc4c55e7a
parent477a0d69e55d45b6d7d21dd84128f5a5be5a7227 (diff)
downloadcoreboot-2fb2483d44c69d5a5493cb257c82a28aac326806.tar.xz
Reject duplicate results in board-status.
This is in response to issue #28: board-status should reject duplicate uploads. Change-Id: Iff99be154b35e8c0f9f05f9470d1c2dcff8510b8 Signed-off-by: Huimin Zhang <thehobn@gmail.com> Reviewed-on: https://review.coreboot.org/14187 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
-rwxr-xr-xutil/board_status/board_status.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/util/board_status/board_status.sh b/util/board_status/board_status.sh
index 058a3d9394..b315be1c18 100755
--- a/util/board_status/board_status.sh
+++ b/util/board_status/board_status.sh
@@ -333,6 +333,21 @@ if [ $UPLOAD_RESULTS -eq 1 ]; then
fi
cd "board-status"
+
+ echo "Checking for duplicate results"
+ # get any updates to board-status
+ git pull
+
+ echo "${tagged_version}" | grep dirty >/dev/null 2>&1
+ clean_version=$?
+ existing_results=$(git ls-files "${mainboard_dir}/${tagged_version}")
+
+ # reject duplicate results of non-dirty versions
+ if [ "${clean_version}" -eq 1 ] && [ -n "${existing_results}" ] ; then
+ echo "Result is a duplicate, aborting"
+ exit $EXIT_FAILURE
+ fi
+
echo "Copying results to $(pwd)/${results}"
# Note: Result directory should be unique due to the timestamp.