Skip to content
Permalink
Browse files

Added a fix for an annoying cvs bug

git-svn-id: https://svn.macports.org/repository/macports/trunk/dports@3013 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
landonf committed Jul 9, 2003
1 parent 807aed6 commit 135aa8583b8001e30772930b54d103e5c1e12a57
Showing with 79 additions and 1 deletion.
  1. +6 −1 devel/cvs-port/Portfile
  2. +73 −0 devel/cvs-port/files/patch-client.c
@@ -1,4 +1,4 @@
# $Id: Portfile,v 1.2 2003/06/07 05:57:00 ranger Exp $
# $Id: Portfile,v 1.3 2003/07/09 05:02:57 landonf Exp $
PortSystem 1.0
name cvs
version 1.11.5
@@ -11,3 +11,8 @@ maintainers Landon Fuller <landonf@opendarwin.org>
master_sites http://ftp.gnu.org/non-gnu/cvs/
categories devel net
checksums md5 b0b5e955c0d83b694c7835dc3e6f0b7d

# With certain servers (namely the one at work), cvs attempts to write a
# CVS/Template file when doing an export. There are no CVS directories
# created, so this fails. The below patch fixes this bug
patchfiles patch-client.c
@@ -0,0 +1,73 @@
diff -rub cvs-1.11.5.orig/src/client.c cvs-1.11.5/src/client.c
--- src/client.c Tue Jul 8 21:51:08 2003
+++ src/client.c Tue Jul 8 21:51:57 2003
@@ -1431,7 +1431,8 @@
the contents of that file and write them to FILENAME. FULLNAME is
the name of the file for use in error messages. FIXME-someday:
extend this to deal with compressed files and make update_entries
- use it. On error, gives a fatal error. */
+ use it. On error, gives a fatal error.
+ If filename is NULL, do not actually write to a file */
static void
read_counted_file (filename, fullname)
char *filename;
@@ -1450,7 +1451,7 @@
size_t nread;
size_t nwrite;

- FILE *fp;
+ FILE *fp = NULL;

read_line (&size_string);
if (size_string[0] == 'z')
@@ -1471,9 +1472,12 @@
is binary or not. I haven't carefully looked into whether
CVS/Template files should use local text file conventions or
not. */
+ if (filename != NULL) {
fp = CVS_FOPEN (filename, "wb");
if (fp == NULL)
error (1, errno, "cannot write %s", fullname);
+ }
+
nread = size;
nwrite = 0;
pread = buf;
@@ -1492,16 +1496,20 @@
if (nwrite > 0)
{
+ if (fp != NULL) {
n = fwrite (pwrite, 1, nwrite, fp);
if (ferror (fp))
error (1, errno, "cannot write %s", fullname);
+ }
nwrite -= n;
pwrite += n;
}
}
free (buf);
+ if (fp != NULL) {
if (fclose (fp) < 0)
error (1, errno, "cannot close %s", fullname);
+ }
}
/* OK, we want to swallow the "U foo.c" response and then output it only
@@ -2529,9 +2537,15 @@
char *short_pathname;
char *filename;
{
+ char *output;
+ if (strcmp (command_name, "export") == 0)
+ output = NULL;
+ else
+ output = CVSADM_TEMPLATE;
+
/* FIXME: should be computing second argument from CVSADM_TEMPLATE
and short_pathname. */
- read_counted_file (CVSADM_TEMPLATE, "<CVS/Template file>");
+ read_counted_file (output, "<CVS/Template file>");
}
static void handle_template PROTO ((char *, int));

0 comments on commit 135aa85

Please sign in to comment.
You can’t perform that action at this time.