Whamcloud - gitweb
Recognize and answer an additional expression.
[fs/lustre-release.git] / build / update_oldconfig
index a9b240d..033b744 100755 (executable)
@@ -1,6 +1,11 @@
-#!/usr/bin/expect
+#!/usr/bin/expect -f
 
+# log all interaction to a file to diagnose failures
+log_file -a [lindex $argv 0]
+
+# and not stddout
 log_user 0
+
 set spawnid [spawn make oldconfig]
 
 #match_max 200
@@ -13,24 +18,34 @@ expect {
         puts "timeout"
         exit 1
     }
-    -re "\n  *(\[^\n]* \\\[N\/y\/\\?] \\(NEW\\)) " {
+    -re "\n *(\[^\n]* \\\[N\/y\/\\?] \\(NEW\\)) " {
          puts "$expect_out(1,string) n"
          send "n\r"
          exp_continue
     }
-    -re "\n  *(\[^\n]* \\\[N\/m\/y\/\\?] \\(NEW\\)) " {
+    -re "\n *(\[^\n]* \\\[N\/m\/y\/\\?] \\(NEW\\)) " {
         puts "$expect_out(1,string) m"
         send "m\r"
         exp_continue
     }
-    -re "\n*(\[^\n]* \\\[N\/y\/m\/\\?] \\(NEW\\)) " {
+    -re "\n *(\[^\n]* \\\[N\/y\/m\/\\?] \\(NEW\\)) " {
         puts "$expect_out(1,string) m"
         send "m\r"
         exp_continue
     }
-    -re "\n  *(\[^\n]* \\\[N\/m\/\\?] \\(NEW\\)) " {
+    -re "\n *(\[^\n]* \\\[N\/m\/\\?] \\(NEW\\)) " {
         puts "$expect_out(1,string) m"
         send "m\r"
         exp_continue
     }
+    -re "\n *(\[^\n]* \\\[Y\/n\/\\?] \\(NEW\\)) " {
+        puts "$expect_out(1,string) y"
+        send "y\r"
+        exp_continue
+    }
+    -re "\n *(\[^\n]* \\\[\[0-9]*] \\(NEW\\)) " {
+        puts "$expect_out(1,string) <cr>"
+        send "\r"
+        exp_continue
+    }
 }