git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guy Rouillier <guyr@burntmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	Martin Langhoff <martin@laptop.org>,
	Emil Medve <Emilian.Medve@freescale.com>,
	git <git@vger.kernel.org>, Pascal Obry <pascal@obry.net>,
	Clemens Buchacher <drizzd@aon.at>
Subject: Re: cvsimport still not working with cvsnt
Date: Sun, 30 Jan 2011 01:33:57 -0500	[thread overview]
Message-ID: <4D450655.5090501@burntmail.com> (raw)
In-Reply-To: <7v8vynnokt.fsf@alter.siamese.dyndns.org>

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@mea.tmt.tele.fi:/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

  reply	other threads:[~2011-01-30  6:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-20  4:05 cvsimport still not working with cvsnt Guy Rouillier
2010-12-20 21:36 ` Jonathan Nieder
2010-12-21 22:09   ` Emil Medve
2010-12-22  5:43     ` Guy Rouillier
2011-01-10  7:33       ` Guy Rouillier
2011-01-10 15:38         ` Martin Langhoff
2011-01-14  6:38           ` Guy Rouillier
2011-01-14  7:44             ` Jonathan Nieder
2011-01-14 21:49               ` Junio C Hamano
2011-01-30  6:33                 ` Guy Rouillier [this message]
2011-01-30 20:19                   ` Martin Langhoff
2011-02-10 22:01                     ` Junio C Hamano
2011-02-18  6:26                       ` Guy Rouillier
2011-02-18 18:34                         ` Junio C Hamano
2011-02-19  7:17                           ` Guy Rouillier
2011-02-20  7:21                             ` Junio C Hamano
2011-02-21  4:30                               ` Guy Rouillier
2011-02-21 23:33                                 ` Junio C Hamano
2011-02-22 23:08                                   ` Junio C Hamano
2011-02-22 23:50                                     ` Martin Langhoff
2011-02-23  0:08                                       ` Guy Rouillier
2011-02-23  0:45                                         ` Junio C Hamano
2011-02-23  2:33                                           ` Guy Rouillier
2011-02-23  5:24                                             ` Junio C Hamano
2011-02-27  5:20                                           ` Guy Rouillier
2011-02-27  8:26                                             ` Junio C Hamano
2011-04-29  4:27                                               ` Guy Rouillier
2011-04-29 22:27                                                 ` Jonathan Nieder
2011-05-01  5:33                                                   ` Guy Rouillier
2011-05-01 18:44                                                     ` Junio C Hamano
2011-02-23  0:42                                       ` Junio C Hamano
2011-02-24  3:14                                         ` Guy Rouillier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D450655.5090501@burntmail.com \
    --to=guyr@burntmail.com \
    --cc=Emilian.Medve@freescale.com \
    --cc=drizzd@aon.at \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=martin@laptop.org \
    --cc=pascal@obry.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).