How can I do a CVS checkout without using the Cvs module?
How to do CVS co using Perl without using开发者_开发百科 Cvs module ?
system : http://perldoc.perl.org/functions/system.html
While you asked not to use a module, I always recommend it. CPAN kicks up Cvs::Simple. You may want to consider using it as a reference if you have business case reasons for not using a module.
I wrote this up in my blog but here it is in plain text.
I had to download and install expectperl and the IO::Tty perl module. This little perl script successfully does the cvs update, even with the ssh password prompting.
#!/usr/bin/perl
use Expect;
chdir("/files/hudson_local/jobs/MOJARRA_1_2X_ROLLING_GLASSFISH_2_1_1/workspace");
$ENV{"CVSROOT"} = ":ext:8bit@java.net/cvs/javaserverfaces-sources~cvs-repository";
($cvs = Expect->spawn("cvs update -d -P")) || die "Couldn't spawn cvs, $!";
unless ($cvs->expect(30, "Enter passphrase for key '/files/hudson_local/.ssh/id_rsa':")) {
die "Never got the passphrase prompt";
}
print $cvs "not the real password\r";
unless ($cvs->expect(300, "cvs update: Updating www/legal/jsf-cddl")) {
die "Never saw update starting";
}
精彩评论