mkmodules.c (102843) | mkmodules.c (128269) |
---|---|
1/* 2 * Copyright (c) 1992, Brian Berliner and Jeff Polk 3 * Copyright (c) 1989-1992, Brian Berliner 4 * 5 * You may distribute under the terms of the GNU General Public License as 6 * specified in the README file that comes with the CVS kit. 7 * | 1/* 2 * Copyright (c) 1992, Brian Berliner and Jeff Polk 3 * Copyright (c) 1989-1992, Brian Berliner 4 * 5 * You may distribute under the terms of the GNU General Public License as 6 * specified in the README file that comes with the CVS kit. 7 * |
8 * $FreeBSD: head/contrib/cvs/src/mkmodules.c 102843 2002-09-02 05:57:14Z peter $ | 8 * $FreeBSD: head/contrib/cvs/src/mkmodules.c 128269 2004-04-15 01:17:28Z peter $ |
9 */ 10 11#include "cvs.h" | 9 */ 10 11#include "cvs.h" |
12#include "savecwd.h" | |
13#include "getline.h" | 12#include "getline.h" |
13#include "history.h" 14#include "savecwd.h" |
|
14 15#ifndef DBLKSIZ 16#define DBLKSIZ 4096 /* since GNU ndbm doesn't define it */ 17#endif 18 19static int checkout_file PROTO((char *file, char *temp)); 20static char *make_tempfile PROTO((void)); 21static void rename_rcsfile PROTO((char *temp, char *real)); --- 173 unchanged lines hidden (view full) --- 195 "#\n", 196 "# The first entry on a line is a filename which will be checked out from\n", 197 "# the corresponding RCS file in the $CVSROOT/CVSROOT directory.\n", 198 "# The remainder of the line is an error message to use if the file cannot\n", 199 "# be checked out.\n", 200 "#\n", 201 "# File format:\n", 202 "#\n", | 15 16#ifndef DBLKSIZ 17#define DBLKSIZ 4096 /* since GNU ndbm doesn't define it */ 18#endif 19 20static int checkout_file PROTO((char *file, char *temp)); 21static char *make_tempfile PROTO((void)); 22static void rename_rcsfile PROTO((char *temp, char *real)); --- 173 unchanged lines hidden (view full) --- 196 "#\n", 197 "# The first entry on a line is a filename which will be checked out from\n", 198 "# the corresponding RCS file in the $CVSROOT/CVSROOT directory.\n", 199 "# The remainder of the line is an error message to use if the file cannot\n", 200 "# be checked out.\n", 201 "#\n", 202 "# File format:\n", 203 "#\n", |
203 "# [<whitespace>]<filename><whitespace><error message><end-of-line>\n", | 204 "# [<whitespace>]<filename>[<whitespace><error message>]<end-of-line>\n", |
204 "#\n", 205 "# comment lines begin with '#'\n", 206 NULL 207}; 208 209static const char *const cvswrappers_contents[] = { 210 "# This file affects handling of files based on their names.\n", 211 "#\n", --- 82 unchanged lines hidden (view full) --- 294 "#PreservePermissions=no\n", 295 "\n", 296#endif 297 "# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top\n", 298 "# level of the new working directory when using the `cvs checkout'\n", 299 "# command.\n", 300 "#TopLevelAdmin=no\n", 301 "\n", | 205 "#\n", 206 "# comment lines begin with '#'\n", 207 NULL 208}; 209 210static const char *const cvswrappers_contents[] = { 211 "# This file affects handling of files based on their names.\n", 212 "#\n", --- 82 unchanged lines hidden (view full) --- 295 "#PreservePermissions=no\n", 296 "\n", 297#endif 298 "# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top\n", 299 "# level of the new working directory when using the `cvs checkout'\n", 300 "# command.\n", 301 "#TopLevelAdmin=no\n", 302 "\n", |
302 "# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the\n", | 303 "# Set `LogHistory' to `all' or `" ALL_HISTORY_REC_TYPES "' to log all transactions to the\n", |
303 "# history file, or a subset as needed (ie `TMAR' logs all write operations)\n", | 304 "# history file, or a subset as needed (ie `TMAR' logs all write operations)\n", |
304 "#LogHistory=TOFEWGCMAR\n", | 305 "#LogHistory=" ALL_HISTORY_REC_TYPES "\n", |
305 "\n", 306 "# Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg\n", 307 "# script to change the log message. Set it to `stat' to force CVS to verify", 308 "# that the file has changed before reading it (this can take up to an extra\n", 309 "# second per directory being committed, so it is not recommended for large\n", 310 "# repositories. Set it to `never' (the previous CVS behavior) to prevent\n", 311 "# verifymsg scripts from changing the log message.\n", 312 "#RereadLogAfterVerify=always\n", --- 145 unchanged lines hidden (view full) --- 458 free (temp); 459 } 460 461 fp = CVS_FOPEN (CVSROOTADM_CHECKOUTLIST, "r"); 462 if (fp) 463 { 464 /* 465 * File format: | 306 "\n", 307 "# Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg\n", 308 "# script to change the log message. Set it to `stat' to force CVS to verify", 309 "# that the file has changed before reading it (this can take up to an extra\n", 310 "# second per directory being committed, so it is not recommended for large\n", 311 "# repositories. Set it to `never' (the previous CVS behavior) to prevent\n", 312 "# verifymsg scripts from changing the log message.\n", 313 "#RereadLogAfterVerify=always\n", --- 145 unchanged lines hidden (view full) --- 459 free (temp); 460 } 461 462 fp = CVS_FOPEN (CVSROOTADM_CHECKOUTLIST, "r"); 463 if (fp) 464 { 465 /* 466 * File format: |
466 * [<whitespace>]<filename><whitespace><error message><end-of-line> | 467 * [<whitespace>]<filename>[<whitespace><error message>]<end-of-line> |
467 * 468 * comment lines begin with '#' 469 */ 470 while (getline (&line, &line_allocated, fp) >= 0) 471 { 472 /* skip lines starting with # */ 473 if (line[0] == '#') 474 continue; --- 14 unchanged lines hidden (view full) --- 489 490 temp = make_tempfile (); 491 if (checkout_file (fname, temp) == 0) 492 { 493 rename_rcsfile (temp, fname); 494 } 495 else 496 { | 468 * 469 * comment lines begin with '#' 470 */ 471 while (getline (&line, &line_allocated, fp) >= 0) 472 { 473 /* skip lines starting with # */ 474 if (line[0] == '#') 475 continue; --- 14 unchanged lines hidden (view full) --- 490 491 temp = make_tempfile (); 492 if (checkout_file (fname, temp) == 0) 493 { 494 rename_rcsfile (temp, fname); 495 } 496 else 497 { |
498 /* Skip leading white space before the error message. */ |
|
497 for (cp++; | 499 for (cp++; |
498 cp < last && *last && isspace ((unsigned char) *last); | 500 cp < last && *cp && isspace ((unsigned char) *cp); |
499 cp++) 500 ; 501 if (cp < last && *cp) | 501 cp++) 502 ; 503 if (cp < last && *cp) |
502 error (0, 0, cp, fname); | 504 error (0, 0, "%s", cp); |
503 } 504 if (unlink_file (temp) < 0 505 && !existence_error (errno)) 506 error (0, errno, "cannot remove %s", temp); 507 free (temp); 508 } 509 if (line) 510 free (line); --- 335 unchanged lines hidden (view full) --- 846{ 847 /* Name of CVSROOT directory. */ 848 char *adm; 849 /* Name of this administrative file. */ 850 char *info; 851 /* Name of ,v file for this administrative file. */ 852 char *info_v; 853 /* Exit status. */ | 505 } 506 if (unlink_file (temp) < 0 507 && !existence_error (errno)) 508 error (0, errno, "cannot remove %s", temp); 509 free (temp); 510 } 511 if (line) 512 free (line); --- 335 unchanged lines hidden (view full) --- 848{ 849 /* Name of CVSROOT directory. */ 850 char *adm; 851 /* Name of this administrative file. */ 852 char *info; 853 /* Name of ,v file for this administrative file. */ 854 char *info_v; 855 /* Exit status. */ |
854 int err; | 856 int err = 0; |
855 856 const struct admin_file *fileptr; 857 858 umask (cvsumask); 859 860 if (argc == -1 || argc > 1) 861 usage (init_usage); 862 --- 115 unchanged lines hidden (view full) --- 978 } 979 980 free (info); 981 free (info_v); 982 983 mkmodules (adm); 984 985 free (adm); | 857 858 const struct admin_file *fileptr; 859 860 umask (cvsumask); 861 862 if (argc == -1 || argc > 1) 863 usage (init_usage); 864 --- 115 unchanged lines hidden (view full) --- 980 } 981 982 free (info); 983 free (info_v); 984 985 mkmodules (adm); 986 987 free (adm); |
986 return 0; | 988 return err; |
987} | 989} |