summaryrefslogtreecommitdiff
path: root/git-cvsimport-script
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2005-07-03 11:02:06 (GMT)
committerSven Verdoolaege <skimo@kotnet.org>2005-07-03 11:02:06 (GMT)
commit34155390a576d8124e0adc864aaf2f11bbf5168b (patch)
tree4918235816314f1d9981456cb05e395b6030c035 /git-cvsimport-script
parent8d0ea3117597933610e02907d14b443f8996ca3b (diff)
downloadgit-34155390a576d8124e0adc864aaf2f11bbf5168b.zip
git-34155390a576d8124e0adc864aaf2f11bbf5168b.tar.gz
git-34155390a576d8124e0adc864aaf2f11bbf5168b.tar.bz2
Support :ext: access method.
Diffstat (limited to 'git-cvsimport-script')
-rwxr-xr-xgit-cvsimport-script23
1 files changed, 21 insertions, 2 deletions
diff --git a/git-cvsimport-script b/git-cvsimport-script
index c514d14..cdd4963 100755
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
@@ -143,13 +143,32 @@ sub conn {
}
$self->{'socketo'} = $s;
$self->{'socketi'} = $s;
- } else { # local: Fork off our own cvs server.
+ } else { # local or ext: Fork off our own cvs server.
my $pr = IO::Pipe->new();
my $pw = IO::Pipe->new();
my $pid = fork();
die "Fork: $!\n" unless defined $pid;
my $cvs = 'cvs';
$cvs = $ENV{CVS_SERVER} if exists $ENV{CVS_SERVER};
+ my $rsh = 'rsh';
+ $rsh = $ENV{CVS_RSH} if exists $ENV{CVS_RSH};
+
+ my @cvs = ($cvs, 'server');
+ my ($local, $user, $host);
+ $local = $repo =~ s/:local://;
+ if (!$local) {
+ $repo =~ s/:ext://;
+ $local = !($repo =~ s/^(?:([^\@:]+)\@)?([^:]+)://);
+ ($user, $host) = ($1, $2);
+ }
+ if (!$local) {
+ if ($user) {
+ unshift @cvs, $rsh, '-l', $user, $host;
+ } else {
+ unshift @cvs, $rsh, $host;
+ }
+ }
+
unless($pid) {
$pr->writer();
$pw->reader();
@@ -157,7 +176,7 @@ sub conn {
dup2($pr->fileno(),1);
$pr->close();
$pw->close();
- exec($cvs,"server");
+ exec(@cvs);
}
$pw->writer();
$pr->reader();