At 09:28 AM 2/27/2001 -0500, Derek R. Price wrote:
>Forrest Aldrich wrote:
>
> > We have a series of scripts from quick.com.au that will assist us in
> > managing our DNS pools. The author mentions that a patch may be required
> > in order to avoid command line argument limitations, especially in the case
> > of > 500 zones (which we have).
> >
> > I'm no FreeBSD-4.x (currently patched and updated) which has CVS
> > 1.11. Does this problem still apply to version 1.11 of CVS? If so, do you
> > have a patch that will run against this code (the one he has is older).
>
>I'm not sure exactly how you think DNS pool management and CVS are related,
>but most systems have a command line argument limitation. It's system
>specific, but on my Linux system, the environment and the command line are
>allowed to total something like 4096 bytes. This can't be fixed by patching
>the executable.
>
>Derek
>
>--
>Derek Price CVS Solutions Architect (
>http://CVSHome.org )
>mailto:[EMAIL PROTECTED] OpenAvenue ( http://OpenAvenue.com )
>--
>Was today really necessary?
[ ... ]
They are related if you USE cvs to manage your DNS pools.
For info on what I'm talking about, here's a patch. I just manually
applied it to the latest /usr/src/contrib/cvs/src/commit.c file on FreeBSD
and it's working.
The patch contains a preamble which will perhaps explain things better for
you. I'd appreciate any feedback or ideas about other ways to handle this
problem.
_F
...............................
Subject:
Pre-commit check failure due to too many args.
Date:
Tue, 8 Dec 1998 15:08:52 +1100 (EST)
From:
"Simon J. Gerraty" <[EMAIL PROTECTED]>
To:
[EMAIL PROTECTED]
CC:
[EMAIL PROTECTED], [EMAIL PROTECTED]
Hi,
we use CVS to maintain our DNS data. We also use a DNS regression
suite (see http://www.quick.com.au/help/dns.html) to do pre-commit
checks - very handy.
The above toolset includes facilities for generating PTR records.
If/when we re-configure said tool, it can cause a few hundred in-addr
zone files to change.
This typically causes the pre-commit checks to fail as the OS command
line length is exceeded when cvs attempts to run the regression suite
in that directory.
The patch below (to cvs-1.10) modifies precommit_proc() such that if
the pre-commit filter command begins with "xargs" or _PATH_XARGS, then
it is run using run_popen() rather than run_exec().
I'm submitting it here in its first cut form to see what others think
(of the idea - not the code :-) It may be better forinstance to
always use run_popen() ? But for now this does the job.
--sjg
Index: commit.c
===================================================================
RCS file: /home/cvsroot/cvs/src/commit.c,v
retrieving revision 1.1.1.1
diff -c -b -r1.1.1.1 commit.c
*** commit.c 1998/12/08 01:08:38 1.1.1.1
--- commit.c 1998/12/08 03:16:36
***************
*** 1089,1100 ****
--- 1089,1104 ----
void *closure;
{
struct logfile_info *li;
+ FILE *fp = closure;
li = (struct logfile_info *) p->data;
if (li->type == T_ADDED
|| li->type == T_MODIFIED
|| li->type == T_REMOVED)
{
+ if (fp)
+ fprintf(fp, "'%s'\n", p->key);
+ else
run_arg (p->key);
}
return (0);
***************
*** 1108,1113 ****
--- 1112,1119 ----
char *repository;
char *filter;
{
+ int rc = -1;
+
/* see if the filter is there, only if it's a full path */
if (isabsolute (filter))
{
***************
*** 1129,1138 ****
free (s);
}
run_setup (filter);
run_arg (repository);
(void) walklist (saved_ulist, precommit_list_proc, NULL);
! return (run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL|RUN_REALLY));
}
/*
--- 1135,1188 ----
free (s);
}
+ #ifndef _PATH_XARGS
+ # define _PATH_XARGS "/usr/bin/xargs"
+ #endif
+ if (strncmp(filter, _PATH_XARGS, sizeof(_PATH_XARGS) - 1) == 0
+ || strncmp(filter, "xargs", 5) == 0) {
+ /*
+ * we expect many args, so don't try run_exec()
+ */
+ char *cmd = xmalloc(strlen(filter) + strlen(repository) + 4);
+ if (cmd) {
+ FILE *fp;
+ int status = -1;
+
+ sprintf(cmd, "%s %s", filter, repository);
+
+ if (fp = run_popen(cmd, "w")) {
+ (void) walklist (saved_ulist,
precommit_list_proc, fp);
+ status = pclose(fp);
+ if (status != -1) {
+ /*
+ * from run_exec()
+ */
+ #ifndef VMS /* status is return status */
+ if (WIFEXITED (status))
+ rc = WEXITSTATUS (status);
+ else if (WIFSIGNALED (status))
+ {
+ if (WTERMSIG (status) == SIGPIPE)
+ error (1, 0, "broken
pipe");
+ rc = 2;
+ }
+ else
+ rc = 1;
+ #else /* VMS */
+ rc = WEXITSTATUS (status);
+ #endif /* VMS */
+ }
+ }
+ free(cmd);
+ }
+
+ } else {
run_setup (filter);
run_arg (repository);
(void) walklist (saved_ulist, precommit_list_proc, NULL);
! rc = run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL|RUN_REALLY);
! }
! return rc;
}
/*
_______________________________________________
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs