Skip to content
Snippets Groups Projects
Commit 17958d87 authored by Nick Boldt's avatar Nick Boldt
Browse files

Check that the name follows the expected drop directory pattern, S-3.17.0.M2-20200130040242


Signed-off-by: default avatarnickboldt <nboldt@redhat.com>
parent f890cd4c
No related branches found
Tags R3_18 R3_19 R3_21
No related merge requests found
......@@ -222,14 +222,18 @@ i=0
for FN in ${mostRecentDir}/*
do
dropDirName=$(basename ${FN})
if [ $verboseFlag ]
then
echo -n "${i}: "
echo ${dropDirName}
# Check that the name follows the expected drop directory pattern, S-3.17.0.M2-20200130040242
if [[ ${dropDirName} =~ ^.*[0-9]{14}$ ]]; then
dropDirList[${i}]=${dropDirName}
i=$(($i + 1))
if [ $verboseFlag ]; then
echo "${i}: ${dropDirName}"
fi
else
if [ $verboseFlag ]; then
echo "${i}: SKIP: ${dropDirName} (does not match expected directory pattern)"
fi
fi
# todo: could check that the name follows the expected drop directory pattern
dropDirList[${i}]=${dropDirName}
i=$(($i + 1))
done
ndropDir=${#dropDirList[*]}
......@@ -237,7 +241,7 @@ ndropDir=${#dropDirList[*]}
# there should be exactly one drop directory
if [ $ndropDir != 1 ]
then
printf "\n\t%s\n" "Error: there was not exactly one drop direc:tory. There was $ndropDir found instead." >&2
printf "\n\t%s\n" "Error: there was not exactly one drop directory. There was $ndropDir found instead." >&2
usage
exit 5
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment