Hi,
Paul said:
I would like to access a CVS Server which provides pserverv access. I
tried to access via
cvs [Directory here] login
After that i get a login prompt. Can I enter my password with PERL? I am
a beginner in using the PERL language.
I would appreciate any help.
The first help you'll get is a bunch of people telling you the language's
name is "Perl" not "PERL". Please follow that advice.
Ok thanks. I will follow that advice.
The second piece of advice I'll give is that you may want to check out the
CVS module at
http://search.cpan.org/~rsoliv/Cvs-0.06/lib/Cvs.pm
I will have a look at it. Thanks for that hint.
The third piece of advice is that you should read the Posting Guidelines
which are posted regularly to the group. Specifically in this case,
please pay attention to the bit that tells you to "Speak Perl, not
English". That is, what do you mean when you said "I tried to access via
cvs [Directory here] login". Did you execute a system command? Are you
redirecting your Perl script to or from the CVS command? Show us what
you're doing.
Ok, let me try to speak Perl. I'm afraid I have quite a bad accent ;-) I
have a config file with the CVS access data and i want to connect to the
cvs server for a checkout:
test.cfg (the config file)
# CVS Variables
CVS_SERVER = 192.168.0.1
CVS_DIR = /usr/cvs
CVS_RSH = pserver
CVS_USERNAME = holger
CVS_PASSWORD = test
# webEdition Revision Variables
PROJECT = testproject
RELEASE = REL_0_1
test.pl
#!/usr/bin/perl -w
# I don't exactly know if I need all those packages
use File::Find;
use File:
ath;
use File::Basename;
use File::Copy;
use File::Spec;
use File:
osGlob 'glob'; # TinyPerl only seems to work with DosGlob :-/
use FileHandle;
use Getopt::Std;
use Config;
%config = (
);
$scriptbase = dirname($0);
$configfile = "$scriptbase/testfile.cfg" unless $configfile;
parse_cfg($configfile);
my $cvs ="cvs -d
:$config{'CVS_RSH'}:$config{'CVS_USERNAME'}"."@"."$config{'CVS_SERVER'}:"."$config{'CVS_DIR'}";
my $release = $config{'RELEASE'};
my $project = $config{'PROJECT'};
my $checkoutdir = $config{'CHECKOUTDIR'};
system "$cvs login";
#how can I enter the password?
system "$cvs co $project";
sub parse_cfg {
my $inifile = shift;
my ($var, $val);
open(CONFIG, $configfile) || die ("Error opening $configfile !");
print("Config File opened!\n");
while(<CONFIG>) {
next if /^\s*#/;
next unless /(\w+)\s*=\s*(.+)/;
($var, $val) = ($1, $2);
$config{$var} = $val;
}
close(CONFIG);
}
Thanks again.
Holger