Re: cvsimport still not working with cvsnt

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

 



Sorry for the delay in following up, work has been busy.

On 1/14/2011 4:49 PM, Junio C Hamano wrote:
> As the general principle, in a "we see two, and we cannot tell which one
> the user wants to use" situation like this, I tend to prefer erroring out
> to _force_ the user to fix the configuration once and for all.

That was my original inclination.  As no other opinions have been posted 
since your message, here is my amended patch, incorporating Martin's 
ideas and dieing if the script finds both CVS and CVSNT password files.
I don't know why diff got tripped up on brace indentation; I used only
tabs and everything looks fine in vi.

--- git-cvsimport.org   2011-01-09 03:52:39.000000000 -0500
+++ git-cvsimport.perl  2011-01-30 00:59:29.000000000 -0500
@@ -260,19 +260,27 @@
                if ($pass) {
                        $pass = $self->_scramble($pass);
                } else {
-                       open(H,$ENV{'HOME'}."/.cvspass") and do {
+                       my @cvspasslocations = ($ENV{'HOME'}."/.cvspass", $ENV{'HOME'}."/.cvs/cvspass");
+                       my $filecount = 0;
+                       foreach my $cvspass (@cvspasslocations) {
+
+                               open(H, $cvspass) and do {
                                # :pserver:cvs@xxxxxxxxxxxxxxx:/cvsroot/zmailer Ah<Z
+                                       $filecount++;
                                while (<H>) {
                                        chomp;
                                        s/^\/\d+\s+//;
-                                       my ($w,$p) = split(/\s/,$_,2);
+                                               my ($w,$p) = split(/[\s=]/,$_,2);
                                        if ($w eq $rr or $w eq $rr2) {
                                                $pass = $p;
                                                last;
                                        }
                                }
                        };
-                       $pass = "A" unless $pass;
+                       }
+                       
+                       die("Two CVS password files found: @cvspasslocations, please remove one") if $filecount > 1;
+                       die("Password not found for CVSROOT: $opt_d\n") unless $pass;
                }

                my ($s, $rep);


-- 
Guy Rouillier
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]