diff options
author | Yang Xu <yang.xu3@huawei.com> | 2018-10-26 22:08:05 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-10-26 22:08:05 +0000 |
commit | 0c25453409d7a6d949af9b5205ab70b6cd01927d (patch) | |
tree | 5788fb3821bdc67b9f3162aa4a2c89e9522e0292 /version-manifest/src/main/scripts | |
parent | 312fd75bf0a82c92f90789a076bbe3511c84e9f1 (diff) | |
parent | acc5314ed8e916903a1f136ffcbef847ae39fef5 (diff) |
Merge "Check for duplicate entries in manifests"
Diffstat (limited to 'version-manifest/src/main/scripts')
-rwxr-xr-x | version-manifest/src/main/scripts/check-sorted.sh | 9 |
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 |