minor(user/bkots):fix verbose comment
[BK-2020-03.git] / user / bkots
index 7600aea1707a6dc58e80f29b753a576120254a91..6627d9db8c7272acf76e5dc19f313fb946640153 100644 (file)
@@ -199,7 +199,7 @@ showVersion() {
     vbm "DEBUG:showVersion function called."
 
     cat <<'EOF'
     vbm "DEBUG:showVersion function called."
 
     cat <<'EOF'
-bkots 0.0.4
+bkots 0.0.6
 Copyright (C) 2022 Steven Baltakatei Sandoval
 License GPLv3: GNU GPL version 3
 This is free software; you are free to change and redistribute it.
 Copyright (C) 2022 Steven Baltakatei Sandoval
 License GPLv3: GNU GPL version 3
 This is free software; you are free to change and redistribute it.
@@ -475,6 +475,12 @@ main() {
             yell "INFO :Skipping file ending in tilde:$item";
             continue; # skip to next item
         fi;
             yell "INFO :Skipping file ending in tilde:$item";
             continue; # skip to next item
         fi;
+
+        ## Ignore files that end in '.ots.bak'.
+        if [[ $item =~ '.ots.bak'$ ]]; then
+            yell "INFO :Skipping file ending in '.ots.bak':item:$item";
+            continue; # skip to next item
+        fi;
         
         ## Add item to file_list_pruned
         file_list_pruned+=("$item");
         
         ## Add item to file_list_pruned
         file_list_pruned+=("$item");
@@ -617,14 +623,15 @@ main() {
         fi;
         vbm "DEBUG:Attempting to upgrade proof file:path_prf:$path_prf";
         if [[ ! $option_dry_run == "true" ]]; then
         fi;
         vbm "DEBUG:Attempting to upgrade proof file:path_prf:$path_prf";
         if [[ ! $option_dry_run == "true" ]]; then
-            #ots upgrade "$path_prf";
-            for url in "${calendars[@]}"; do
-                ots -l "$url" --no-default-whitelist upgrade "$path_prf";
-            done;
+            ### Try upgrade with known calendars in random order
+            while read -r url; do
+                vbm "DEBUG:Upgrading with calendar:url:$url";
+                ots -l "$url" --no-default-whitelist upgrade "$path_prf" && break;
+            done < <(printf "%s\n" "${calendars[@]}" | shuf);
         else
             yell "DEBUG:DRY RUN:Not running:\"ots upgrade $path_prf\"";
         fi;
         else
             yell "DEBUG:DRY RUN:Not running:\"ots upgrade $path_prf\"";
         fi;
-        sleep "$ots_delay";
+        #sleep "$ots_delay";
     done;
 
     ## Verify files
     done;
 
     ## Verify files
@@ -638,14 +645,15 @@ main() {
         vbm "DEBUG:Attempting to verify source file:path_src:$path_src";
         vbm "DEBUG:    against proof file:          path_prf:$path_prf";
         if [[ ! $option_dry_run == "true" ]]; then
         vbm "DEBUG:Attempting to verify source file:path_src:$path_src";
         vbm "DEBUG:    against proof file:          path_prf:$path_prf";
         if [[ ! $option_dry_run == "true" ]]; then
-            #ots verify -f "$path_src" "$path_prf";
-            for url in "${calendars[@]}"; do
-                ots -l "$url" --no-default-whitelist verify -f "$path_src" "$path_prf";
-            done;
+            ### Try verify with known calendars in random order
+            while read -r url; do
+                vbm "DEBUG:Verifying with calendar:url:$url";
+                ots -l "$url" --no-default-whitelist verify -f "$path_src" "$path_prf" && break;
+            done < <(printf "%s\n" "${calendars[@]}" | shuf);
         else
             yell "DEBUG:DRY RUN:Not running:\"ots verify -f $path_src $path_prf\"";
         fi;
         else
             yell "DEBUG:DRY RUN:Not running:\"ots verify -f $path_src $path_prf\"";
         fi;
-        sleep "$ots_delay";
+        #sleep "$ots_delay";
     done;
     
     ## Stamp files
     done;
     
     ## Stamp files
@@ -657,10 +665,7 @@ main() {
         fi;
         vbm "DEBUG:Attempting to stamp source file:path_src:$path_src";
         if [[ ! $option_dry_run == "true" ]]; then
         fi;
         vbm "DEBUG:Attempting to stamp source file:path_src:$path_src";
         if [[ ! $option_dry_run == "true" ]]; then
-            #ots stamp "$item";
-            for url in "${calendars[@]}"; do
-                ots -l "$url" --no-default-whitelist stamp "$item";
-            done;
+            ots stamp "$item";
         else
             yell "DEBUG:DRY RUN:Not running:\"ots stamp $item\"";
         fi;
         else
             yell "DEBUG:DRY RUN:Not running:\"ots stamp $item\"";
         fi;