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

Signed-off-by: nickboldt <nboldt@redhat.com>
diff --git a/releng.control/promote.sh b/releng.control/promote.sh
index 7d8c39f..bdba2f9 100755
--- a/releng.control/promote.sh
+++ b/releng.control/promote.sh
@@ -222,14 +222,18 @@
 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 @@
 # 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