2011-03-13 12:38:32 -06:00
|
|
|
#!/usr/bin/expect
|
|
|
|
# procedure to attempt connecting; result 0 if OK, 1 otherwise
|
|
|
|
proc connect {} {
|
|
|
|
expect "login:"
|
|
|
|
send "kitteh\r"
|
|
|
|
expect "password:"
|
|
|
|
send "a\r"
|
|
|
|
expect {
|
|
|
|
kitteh {return 0}
|
|
|
|
failed return 1
|
|
|
|
"invalid password" return 1
|
|
|
|
timeout return 1
|
|
|
|
connected
|
|
|
|
}
|
|
|
|
# timed out
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2011-04-01 18:34:21 -06:00
|
|
|
# procedure to do build stuff; result 0 if OK, 1 otherwise
|
|
|
|
proc dobuild {} {
|
|
|
|
set timeout -1
|
|
|
|
send "pkg-win32.bat\r\n"
|
|
|
|
puts "\nBuilding...\n"
|
|
|
|
expect {
|
|
|
|
"BUILD OK" {return 0}
|
|
|
|
"MSVC ERROR" {return 1}
|
|
|
|
"CMAKE ERROR" {return 1}
|
|
|
|
"ENV ERROR" {return 1}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-13 12:38:32 -06:00
|
|
|
spawn telnet win7
|
|
|
|
|
|
|
|
set rez [connect]
|
2011-04-01 18:34:21 -06:00
|
|
|
if { $rez == 1 } {
|
2011-03-13 12:38:32 -06:00
|
|
|
puts "\nError connecting to server!\n"
|
|
|
|
exit 1
|
2011-04-01 18:34:21 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
send "net use X: \\\\vboxsvr\\projects\r\n"
|
|
|
|
expect "The command completed successfully."
|
|
|
|
send "X:\r\n"
|
|
|
|
expect "X:"
|
|
|
|
send "cd X:\\dfhack\\build\r\n"
|
|
|
|
expect "build"
|
|
|
|
|
|
|
|
set buildrez [dobuild]
|
|
|
|
if { $buildrez == 1 } {
|
|
|
|
puts "\nThere was an error during build.\n"
|
|
|
|
} else {
|
|
|
|
puts "\nAll OK.\n"
|
|
|
|
}
|
|
|
|
send "exit\r"
|
|
|
|
expect eof
|
|
|
|
exit $buildrez
|