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: Martin Langhoff <martin@laptop.org>,
	Jonathan Nieder <jrnieder@gmail.com>,
	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: Fri, 18 Feb 2011 01:26:30 -0500	[thread overview]
Message-ID: <4D5E1116.7040501@burntmail.com> (raw)
In-Reply-To: <7vhbcb35xk.fsf@alter.siamese.dyndns.org>

On 2/10/2011 5:01 PM, Junio C Hamano wrote:
> Martin Langhoff <martin@laptop.org> writes:
> 
>> On Sat, Jan 29, 2011 at 11:33 PM, Guy Rouillier<guyr@burntmail.com>  wrote:
>>> 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.
>>
>> ACK! Thanks!
> 
> Can somebody resubmit an appliable patch with a proper commit message that
> describes the problem and the solution please.
> 
> Thanks.

Junio, sorry for the delay in response.  I'm new to all this and I thought 
perhaps one of the listed committers had to submit the official patch.  
Perhaps they do.  I followed the directions in SubmittingPatches.  The result 
is below.  Please let me know if I need to do something differently.  I 
didn't simply send the result of format-match because that would have started 
a different message thread.  Thanks.

>From d3ae7d304ee2b89740225b0433bf7d7e07248f59 Mon Sep 17 00:00:00 2001
From: Guy Rouillier <guyr@burntmail.com>
Date: Fri, 18 Feb 2011 00:53:10 -0500
Subject: [PATCH] Look for password in both CVS and CVSNT password files.

The existing code looks for the CVS reposity password only in
the CVS password file in HOME/.cvspass. Accommodate the CVS
alternative CVSNT by also looking in HOME/.cvs/cvspass.  Die
if both files are found, and ask the user to remove one.

Signed-off-by: Guy Rouillier <guyr@burntmail.com>
---
 git-cvsimport.perl |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 8e683e5..76b4765 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -259,19 +259,27 @@ sub conn {
 		if ($pass) {
 			$pass = $self->_scramble($pass);
 		} else {
-			open(H,$ENV{'HOME'}."/.cvspass") and do {
-				# :pserver:cvs@mea.tmt.tele.fi:/cvsroot/zmailer Ah<Z
-				while (<H>) {
-					chomp;
-					s/^\/\d+\s+//;
-					my ($w,$p) = split(/\s/,$_,2);
-					if ($w eq $rr or $w eq $rr2) {
-						$pass = $p;
-						last;
+			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);
+						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);
--
1.7.3.4



-- 
Guy Rouillier

  reply	other threads:[~2011-02-18  6:27 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
2011-01-30 20:19                   ` Martin Langhoff
2011-02-10 22:01                     ` Junio C Hamano
2011-02-18  6:26                       ` Guy Rouillier [this message]
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=4D5E1116.7040501@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).