X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=version-manifest%2Fsrc%2Fmain%2Fscripts%2Fcheck-sorted.sh;h=eb41ddef2aef06e6de5de0e94a309996b16c507e;hb=50fe3bb96fd34355aea2ec50199e328f59d16596;hp=70ca5ac04c763fb9f6bc5cbc94ee447f930b414d;hpb=64c540bd168c463f1bb1ba08b7c1a803eee24fcb;p=integration.git 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