[Genquire-dev] Improving the installer to be more self-sufficient on Linux?

Danny Yoo dyoo@acoma.Stanford.EDU
Fri, 28 Jun 2002 09:24:09 -0700 (PDT)


Hi everyone,


I noticed that the Genquire installer on Linux prompts the user to press
enter every so often for CVS interactively.  This is something of a
hassle, but we can fix this by using the 'expect' utility.  'expect' is a
tcl system that simulates keyboard input, so we can use it to type out
'cvs' or press enter on CVS password queries.


Here's an expect script that enters in passwords for us:

######
#!/usr/bin/expect

## Allow CVS commands to be run noninteractively.
## Parameters:  [password] [rest of cvs args]
set password [lindex $argv 0]
set cvsargs [lrange $argv 1 end]
set password_wait 10

set prompt "(%|#|\\$) $"          ;# default prompt
catch {set prompt $env(EXPECT_PROMPT)}
spawn $env(SHELL)

## If a password request comes within $password_wait seconds, we
## enter it in automatically.
send -- "cvs -d $cvsargs\n"
expect -timeout $password_wait -re "word: " {
    send "$password\n"
}

expect  -timeout -1 -re $prompt
send_user "\n"
######

I've added this script into cvs as 'Installer/cvswrapper.sh'; we should be
able to use it with Installer.pl so that the Linux installation goes as
smoothly as the one on Windows.  Can you test it out on your systems?


Hope this helps!