X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-cvsimport.perl;h=a7d215c8aa479bc6b456ec5c3792e931598ac365;hb=f2c0ca4fae299c2515c1554dbeec2080af5c6792;hp=593832d813d88971aea00c8052c451f66e209830;hpb=64d5fe0a23e3a16179c7c185662f25d85fe631dd;p=git.git diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 593832d81..a7d215c8a 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -238,7 +238,9 @@ sub conn { } my $rr = ":pserver:$user\@$serv:$port$repo"; - unless ($pass) { + if ($pass) { + $pass = $self->_scramble($pass); + } else { open(H,$ENV{'HOME'}."/.cvspass") and do { # :pserver:cvs@mea.tmt.tele.fi:/cvsroot/zmailer Ah) { @@ -251,10 +253,9 @@ sub conn { } } }; + $pass = "A" unless $pass; } - $pass = $self->_scramble($pass); - my ($s, $rep); if ($proxyhost) { @@ -578,10 +579,21 @@ sub get_headref ($) { return $r; } +my $user_filename_prepend = ''; +sub munge_user_filename { + my $name = shift; + return File::Spec->file_name_is_absolute($name) ? + $name : + $user_filename_prepend . $name; +} + -d $git_tree or mkdir($git_tree,0777) or die "Could not create $git_tree: $!"; -chdir($git_tree); +if ($git_tree ne '.') { + $user_filename_prepend = getwd() . '/'; + chdir($git_tree); +} my $last_branch = ""; my $orig_branch = ""; @@ -643,7 +655,7 @@ unless (-d $git_dir) { -f "$git_dir/cvs-authors" and read_author_info("$git_dir/cvs-authors"); if ($opt_A) { - read_author_info($opt_A); + read_author_info(munge_user_filename($opt_A)); write_author_info("$git_dir/cvs-authors"); } @@ -678,7 +690,7 @@ unless ($opt_P) { $? == 0 or die "git-cvsimport: fatal: cvsps reported error\n"; close $cvspsfh; } else { - $cvspsfile = $opt_P; + $cvspsfile = munge_user_filename($opt_P); } open(CVS, "<$cvspsfile") or die $!;