Subject: pkg/36930: net/csup can't update from CVS repository containing commitid keywords
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <qhwt+nbsd@les.ath.cx>
List: pkgsrc-bugs
Date: 09/06/2007 07:50:01
>Number:         36930
>Category:       pkg
>Synopsis:       net/csup can't update from CVS repository containing commitid keywords
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 06 07:50:01 +0000 2007
>Originator:     YONETANI Tomokazu
>Release:        
>Organization:
>Environment:
>Description:
Csup is a rewrite of CVSup client program in C, and it supports client
operation in checkout mode.

Csup has problem checking out from a CVSup collection whose repository
has been committed by cvs-1.12.  CVS developers has recently decided to
add a new keyword, commitid, a unique session ID of the CVS process, to
each committed repository file.  If you check in a change to a CVS
repository using cvs-1.12, affected files have the commitid keywords.
This commitid keyword is unknown to the currently release version of csup,
or CVSup as of cvsup-snap-16.1h.

CVSup and its variants have specific knowledge of CVS repository database
(i.e. RCS files) and exploit it for better performance.  An RCS file
consists of keywords at the beginning, followed by commitlogs and deltas.
Any new keywords are treated as "newphrase" and CVSup server transmits a
special information in addition to the normal delta commands to note this.
Although this additional information appears to be only useful when you're
updating the CVS repository, the CVSup server also sends it out in checkout
mode.

CVSup client program operating in checkout mode does nothing when it
received this additional information, so you can checkout this repository
using CVSup program without a problem.  Csup, on the other hand, aborts as
soon as it received this additional information.  I'm not 100% sure if
ignoring this additional information for "newphrase" (i.e. any new keywords
other than commitid), but since it's how CVSup client program currently
works, and since no CVS clients are required to do anything for unknown
keywords (see rcsfile(5)), I find that the current csup behavior to be
inconvenient.

I talked to the author of Csup last year but failed to convince him to
change the behavior.  I also asked the author of CVSup about this issue
but received no replies yet.

>How-To-Repeat:
Checkout using csup from a cvsup collection whose repository has been
committed by cvs-1.12 (version with commitid support).  You can reproduce
the problem by checking out with two different tags or branches, so that
the cvsup server sends you the delta for revisions containing a commitid
keyword.

>Fix:
$NetBSD$

--- updater.c.orig	14 Mar 2006 03:51:10 -0000
+++ updater.c
@@ -856,6 +856,15 @@ updater_diff_batch(struct updater *up, s
 			if (error)
 				goto bad;
 			break;
+
+		case 'N':
+			fprintf(stderr, "newphrase %s ignored\n", line);
+			/* ignore appended phrases(like commitid) */
+			while ((line = stream_getln(rd, NULL)) != NULL) {
+				if (strcmp(line, ".") == 0)
+					break;
+			}
+			break;
 		default:
 			error = UPDATER_ERR_PROTO;
 			goto bad;