Whamcloud - gitweb
An expect script to interact with make oldconfig answering questions for new
[fs/lustre-release.git] / build / update_oldconfig
diff --git a/build/update_oldconfig b/build/update_oldconfig
new file mode 100755 (executable)
index 0000000..e04e5fa
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/expect
+
+log_user 1
+set spawnid [spawn make oldconfig]
+
+match_max 200
+
+# need to allow for the config tool to be built initially
+set timeout 30
+
+expect {
+    timeout {
+        puts "timeout"
+        exit 1
+    }
+    -re "\n  *(\[^\n]* \\\[N\/y\/\\?] \\(NEW\\)) " {
+         puts "$expect_out(1,string) n"
+         send "n\r"
+         exp_continue
+    }
+    -re "\n  *(\[^\n]* \\\[N\/m\/y\/\\?] \\(NEW\\)) " {
+        puts "$expect_out(1,string) m"
+        send "m\r"
+        exp_continue
+    }
+    -re "\n  *(\[^\n]* \\\[N\/m\/\\?] \\(NEW\\)) " {
+        puts "$expect_out(1,string) m"
+        send "m\r"
+        exp_continue
+    }
+}