#!/bin/sh

OUT="$(find "$(dirname "$0")/../packaging/dbscripts" | grep -P '^\d{2}_\d{2}_\d{2,8}' -o | sort | uniq -d)"

if [ -n "${OUT}" ]; then
	echo "Found duplicate upgrade scripts with version $(echo ${OUT}), please resolve and retry" >&2
	exit 1
fi

exit 0

#!/bin/sh

OUT="$(find "$(dirname "$0")/../packaging/dbscripts" -exec basename {} \; | grep -P '^\d{2}_\d{2}_\d{2,8}' -o | sort | uniq -d)"

if [ -n "${OUT}" ]; then
	echo "Found duplicate upgrade scripts with version $(echo ${OUT}), please resolve and retry" >&2
	exit 1
fi

exit 0

Fix db upgrage scripts numbering check
core: Fix db upgrage scripts numbering check

Fixes issue in db upgrade scripts numbering check to prevent duplicate
scripts with same number.

Previous version of the script allows duplicates.

Change-Id: I4e48052b4e65e9e1cccd8be82acf0b4bcd59f7c4
Signed-off-by: Jakub Niedermertl <67f5da8ed331c4624c6ad915f5d80efd84163b22@redhat.com>
