version 1.79, 2005/08/03 14:43:08 |
version 1.80, 2005/08/04 13:31:14 |
|
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
*/ |
|
|
|
#include <sys/stat.h> |
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/wait.h> |
#include <sys/wait.h> |
|
|
|
|
char *cvs_homedir = NULL; |
char *cvs_homedir = NULL; |
char *cvs_msg = NULL; |
char *cvs_msg = NULL; |
char *cvs_repo_base = NULL; |
char *cvs_repo_base = NULL; |
|
char *cvs_tmpdir = CVS_TMPDIR_DEFAULT; |
|
|
/* hierarchy of all the files affected by the command */ |
/* hierarchy of all the files affected by the command */ |
CVSFILE *cvs_files; |
CVSFILE *cvs_files; |
|
|
int i, ret, cmd_argc; |
int i, ret, cmd_argc; |
struct cvs_cmd *cmdp; |
struct cvs_cmd *cmdp; |
struct passwd *pw; |
struct passwd *pw; |
|
struct stat st; |
|
|
TAILQ_INIT(&cvs_variables); |
TAILQ_INIT(&cvs_variables); |
|
|
|
|
cvs_homedir = pw->pw_dir; |
cvs_homedir = pw->pw_dir; |
} |
} |
|
|
|
if ((envstr = getenv("TMPDIR")) != NULL) |
|
cvs_tmpdir = envstr; |
|
|
ret = cvs_getopt(argc, argv); |
ret = cvs_getopt(argc, argv); |
|
|
argc -= ret; |
argc -= ret; |
|
|
usage(); |
usage(); |
exit(1); |
exit(1); |
} |
} |
|
|
cvs_command = argv[0]; |
cvs_command = argv[0]; |
|
|
|
/* |
|
* check the tmp dir, either specified through |
|
* the environment variable TMPDIR, or via |
|
* the global option -T <dir> |
|
*/ |
|
if (stat(cvs_tmpdir, &st) == -1) { |
|
cvs_log(LP_ERR, "failed to stat `%s'", cvs_tmpdir); |
|
exit(1); |
|
} else if (!S_ISDIR(st.st_mode)) { |
|
cvs_log(LP_ERR, "`%s' is not valid temporary directory", |
|
cvs_tmpdir); |
|
exit(1); |
|
} |
|
|
if (cvs_readrc == 1) { |
if (cvs_readrc == 1) { |
cvs_read_rcfile(); |
cvs_read_rcfile(); |
|
|
|
|
int ret; |
int ret; |
char *ep; |
char *ep; |
|
|
while ((ret = getopt(argc, argv, "b:d:e:fHlnQqrs:tvz:")) != -1) { |
while ((ret = getopt(argc, argv, "b:d:e:fHlnQqrs:T:tvz:")) != -1) { |
switch (ret) { |
switch (ret) { |
case 'b': |
case 'b': |
/* |
/* |
|
|
*(ep++) = '\0'; |
*(ep++) = '\0'; |
if (cvs_var_set(optarg, ep) < 0) |
if (cvs_var_set(optarg, ep) < 0) |
exit(1); |
exit(1); |
|
break; |
|
case 'T': |
|
cvs_tmpdir = optarg; |
break; |
break; |
case 't': |
case 't': |
(void)cvs_log_filter(LP_FILTER_UNSET, LP_TRACE); |
(void)cvs_log_filter(LP_FILTER_UNSET, LP_TRACE); |