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