Whamcloud - gitweb
3593be5044fc8a089eaf48f4ee8e94752cc807c2
[fs/lustre-release.git] / build / update_oldconfig
1 #!/usr/bin/expect -f
2
3 # log all interaction to a file to diagnose failures
4 log_file -a [lindex $argv 0]
5
6 # and not stddout
7 log_user 0
8
9 set spawnid [spawn make oldconfig]
10
11 #match_max 200
12
13 # need to allow for the config tool to be built initially
14 set timeout 30
15
16 expect {
17     timeout {
18         puts "timeout"
19         exit 1
20     }
21     -re "\n *(\[^\n]* \\\[N\/y\/\\?] \\(NEW\\)) " {
22          puts "$expect_out(1,string) n"
23          send "n\r"
24          exp_continue
25     }
26     -re "\n *(\[^\n]* \\\[N\/m\/y\/\\?] \\(NEW\\)) " {
27         puts "$expect_out(1,string) m"
28         send "m\r"
29         exp_continue
30     }
31     -re "\n *(\[^\n]* \\\[N\/y\/m\/\\?] \\(NEW\\)) " {
32         puts "$expect_out(1,string) m"
33         send "m\r"
34         exp_continue
35     }
36     -re "\n *(\[^\n]* \\\[N\/m\/\\?] \\(NEW\\)) " {
37         puts "$expect_out(1,string) m"
38         send "m\r"
39         exp_continue
40     }
41     -re "\n *(\[^\n]* \\\[Y\/n\/\\?] \\(NEW\\)) " {
42         puts "$expect_out(1,string) y"
43         send "y\r"
44         exp_continue
45     }
46     -re "\n *(\[^\n]* \\\[\[0-9]*] \\(NEW\\)) " {
47         puts "$expect_out(1,string) <cr>"
48         send "\r"
49         exp_continue
50     }
51     -re "\n *(\[^\n]* \\\[M\/n\/\\?] \\(NEW\\)) " {
52         puts "$expect_out(1,string) m"
53         send "m\r"
54         exp_continue
55     }
56 }