All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guy Rouillier <guyr@burntmail.com>
To: Emil Medve <Emilian.Medve@Freescale.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	git@vger.kernel.org, Pascal Obry <pascal@obry.net>,
	Clemens Buchacher <drizzd@aon.at>,
	Martin Langhoff <martin@laptop.org>
Subject: Re: cvsimport still not working with cvsnt
Date: Mon, 10 Jan 2011 02:33:17 -0500	[thread overview]
Message-ID: <4D2AB63D.7040803@burntmail.com> (raw)
In-Reply-To: <4D119015.6020207@burntmail.com>

On 12/22/2010 12:43 AM, Guy Rouillier wrote:
>
> Emil and Jonathan, thanks for the feedback. Perl is not my strong point,
> but I'll take a crack at it over the upcoming holidays. I'm inclined not
> to get too fancy and try to second-guess the user's environment. Perhaps
> he has both cvs and cvsnt installed for some reason (testing one, using
> the other for regular work); perhaps a tool installed one or the other
> and he doesn't even know he has them both. Etc.
>
> So, at most I can see, as Emil suggested, seeing if the entry exists in
> both files and is the same in both. If so, or if the entry is only in
> one of them, then just use the entry. However, if the entry is in both
> files and is different, I'd prefer to just exit with an error and have
> the user clarify his environment.

Here is my patch for accomplishing the above.  As this is my first time
submitting a patch, please let me know the correct procedure if
submitting a diff here is not appropriate.  Thanks.

--- git-cvsimport.org	2011-01-09 03:52:39.000000000 -0500
+++ git-cvsimport.cvsnt	2011-01-10 01:42:29.000000000 -0500
@@ -260,6 +260,8 @@
  		if ($pass) {
  			$pass = $self->_scramble($pass);
  		} else {
+			# First try the original CVS location.
+
  			open(H,$ENV{'HOME'}."/.cvspass") and do {
  				# :pserver:cvs@mea.tmt.tele.fi:/cvsroot/zmailer Ah<Z
  				while (<H>) {
@@ -272,7 +274,30 @@
  					}
  				}
  			};
-			$pass = "A" unless $pass;
+
+			# Now try the CVSNT location.
+
+			open(H,$ENV{'HOME'}."/.cvs/cvspass") and do {
+				# :pserver:cvs@mea.tmt.tele.fi:/cvsroot/zmailer Ah<Z
+				while (<H>) {
+					chomp;
+					s/^\/\d+\s+//;
+					my ($w,$p) = split(/=/,$_,2);
+					if ($w eq $rr or $w eq $rr2) {
+						my $cvsntpass = $p;
+
+						if (!$pass) {
+							$pass = $cvsntpass;
+						} elsif ($pass ne $cvsntpass) {
+							die("CVSROOT found in both CVS and CVSNT cvspass files, passwords do not match\n");
+						}
+						last;
+					}
+				}
+			};
+
+
+			die("Password not found for CVSROOT: $opt_d\n") unless $pass;
  		}

  		my ($s, $rep);



-- 
Guy Rouillier

  reply	other threads:[~2011-01-10  7: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 [this message]
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
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=4D2AB63D.7040803@burntmail.com \
    --to=guyr@burntmail.com \
    --cc=Emilian.Medve@Freescale.com \
    --cc=drizzd@aon.at \
    --cc=git@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.