[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Unattended package install.



> #!/usr/bin/expect -f
> #
> 
> set timeout -1
> spawn dpkg -i/cdrom/bo/binary-i386/devel/kernel-source-2.0.30_2.0.30-7.deb 
> match_max 100000
> expect -exact "Please supply the full name of the local kernel maintainer"
> send -- "Henry Hollenberg\r"
> expect -exact "Please supply the email address of the local kernel 
> maintainer"
> send -- "speed@barney.iamerica.net\r"
> expect eof
> 
> 
> Anybody see where I've gone astray?

Could this be because the package that prompts for ``local kernel maintainer'' 
is kernel-package, not kernel-source ?

BTW, here is a script that does this using Austin Schutz <tex@habit.com>'s
Expect.pm module for perl:

---<cut here>---
#!/usr/bin/perl

use Expect ;

# these should be got from the user or a database
$name="Philip Hands" ;
$email='phil@hands.com' ;

$dpkg = Expect->spawn("dpkg -i kernel-package_4.04.deb") ||
   die "Couldn't spawn dpkg, $!" ;

$dpkg->expect(undef, "Please supply the full name of the local kernel maintainer\r\n\t:") ||
   die "Never got name prompt\n" ;
print $dpkg "$name\r" ;

$dpkg->expect(undef, "Please supply the email address of the local kernel maintainer\r\n\t:") ||
   die "Never got email prompt\n" ;
print $dpkg "$email\r" ;

# wait for dpkg to exit.
$dpkg->soft_close() ;
---<cut here>---


Has anyone debianised Expect.pm (I've not found it as a .deb) ?
Also has anyone debianised IO::Tty/Pty and IO::Stty (which are required
by Expect.pm) ?

If not, I'll do so.  I seem to remember someone talking about standardising 
the packaging of CPAN perl libraries a while back.  Did anything come of that ?

Cheers, Phil.



--
To UNSUBSCRIBE, email to debian-firewall-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: