Code Review
/
integration.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Revert "Enable VVP for daily deployment tests""
[integration.git]
/
version-manifest
/
src
/
main
/
scripts
/
check-sorted.sh
diff --git
a/version-manifest/src/main/scripts/check-sorted.sh
b/version-manifest/src/main/scripts/check-sorted.sh
index
fa120f3
..
eb41dde
100755
(executable)
--- a/
version-manifest/src/main/scripts/check-sorted.sh
+++ b/
version-manifest/src/main/scripts/check-sorted.sh
@@
-1,5
+1,13
@@
#!/bin/bash
#!/bin/bash
+
+if [ "$#" -ne 1 ]; then
+ echo This script checks the input file to verify that it is sorted
+ echo "$0 <manifest.csv>"
+ exit 1
+fi
+
LC_ALL=C sort -c $1
LC_ALL=C sort -c $1
+
retval=$?
if [ $retval -ne 0 ]; then
echo
retval=$?
if [ $retval -ne 0 ]; then
echo
@@
-9,4
+17,12
@@
if [ $retval -ne 0 ]; then
echo " mv $1.tmp $1"
echo
fi
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
exit $retval