#! /bin/bash if [ ! -e .hgtags ]; then echo "ERROR: run this from the root of the repository" exit 1 fi grep -q -v -E -e ' jdk-[0-9]+(\.[0-9]+){0,3}\+[0-9]+$' -e ' [0-9]+(\.[0-9]+){0,3}-b[0-9]+$' -e ' [0-9]+u[0-9]+-b[0-9]+$' .hgtags if [ $? -eq 0 ]; then echo Fixing .hgtags rm -f .hgtags.tmp cat .hgtags | sed -e 's/ marina-/ 1.2-/' -e 's/ soma-/ 1.3-/' -e 's/ presidio-/ 2.0-/' | grep -E -e ' jdk-[0-9]+(\.[0-9]+){0,3}\+[0-9]+$' -e ' [0-9]+(\.[0-9]+){0,3}-b[0-9]+$' -e ' [0-9]+u[0-9]+-b[0-9]+$' > .hgtags.tmp if [ -f .hgtags.tmp ]; then rm -f .hgtags mv .hgtags.tmp .hgtags fi else echo tags are all OK fi