Optionally show queries used in list-of-lists-updater
authorAlex Dehnert <adehnert@mit.edu>
Sun, 18 Nov 2012 23:17:00 +0000 (18:17 -0500)
committerAlex Dehnert <adehnert@mit.edu>
Sun, 18 Nov 2012 23:17:00 +0000 (18:17 -0500)
Copied in from ~/bin/.

list-of-lists-updater

index 4018ac04bbef49cb551b03b17e10b645377e5733..756dae927064ec5dc7b2ed7c2a0f80df39edaa96 100755 (executable)
@@ -11,6 +11,11 @@ prev=${prev:-ua-lists}
 anti=${anti:-ua-foreign-lists}
 nativepat=${nativepat:-ua}
 
+function prefix {
+    #echo "$@"
+    "$@"
+}
+
 function add_lists
 {
     (
@@ -18,23 +23,23 @@ function add_lists
     for list in $lists; do # for each list we already know about
         # Add a list's sublists
         for newlist in $(blanche $list | grep LIST | cut -d : -f 2); do
-            blanche $prev -a $newlist;
+            prefix blanche $prev -a $newlist;
         done;
         # Add a list's owner and memacl
         owner=$(athrun ops qy -s -f ace_name glin $list)
         towner=$(athrun ops qy -s -f ace_type glin $list)
         if [[ "$towner" == "LIST" ]]; then
-            blanche $prev -a $owner
+            prefix blanche $prev -a $owner
         fi
         macl=$(athrun ops qy -s -f memace_name glin $list)
         tmacl=$(athrun ops qy -s -f memace_type glin $list)
         if [[ "$tmacl" == "LIST" ]]; then
-            blanche $prev -a $macl
+            prefix blanche $prev -a $macl
         fi
         # Add stuff this owns
         owned=$(athrun ops qy -s get_ace_use list $list | grep -v ^$prev\$ | grep LIST | cut -d " " -f 2)
         for newlist in $owned; do
-            blanche $prev -a $newlist;
+            prefix blanche $prev -a $newlist;
         done;
     done
     ) 2>&1 | grep -v "Record already exists" | grep -v "moira (query): No records in database match query"