aboutsummaryrefslogtreecommitdiffstats
path: root/version-manifest/src/main/scripts
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-10-26 13:21:05 -0700
committerGary Wu <gary.i.wu@huawei.com>2018-10-26 13:21:05 -0700
commitacc5314ed8e916903a1f136ffcbef847ae39fef5 (patch)
treed5000e2d05bbf93cd1d0e45cbe54b1699f82e998 /version-manifest/src/main/scripts
parent73e35266be6609f1eb59d2de3bf819ebd3cb4a79 (diff)
Check for duplicate entries in manifests
Change-Id: Ibb63db5372d0000670e5c35df5c0c4e3313881ba Issue-ID: INT-586 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'version-manifest/src/main/scripts')
-rwxr-xr-xversion-manifest/src/main/scripts/check-sorted.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/version-manifest/src/main/scripts/check-sorted.sh b/version-manifest/src/main/scripts/check-sorted.sh
index 70ca5ac04..eb41ddef2 100755
--- a/version-manifest/src/main/scripts/check-sorted.sh
+++ b/version-manifest/src/main/scripts/check-sorted.sh
@@ -7,6 +7,7 @@ if [ "$#" -ne 1 ]; then
fi
LC_ALL=C sort -c $1
+
retval=$?
if [ $retval -ne 0 ]; then
echo
@@ -16,4 +17,12 @@ if [ $retval -ne 0 ]; then
echo " mv $1.tmp $1"
echo
fi
+
+# check that there are no duplicate records
+DUPLICATES=$(rev < $1 | cut -f2- -d, | uniq -d | rev | tr ',' ':')
+for DUP in $DUPLICATES; do
+ echo "[ERROR] $DUP has duplicate entries"
+ ((retval++))
+done
+
exit $retval