aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-03-03 22:02:42 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2014-03-03 22:08:21 +0200
commit221e390d04a2ba01a1e4e1514bdb95faef0145a9 (patch)
treef7f02557f1d778ee6d5489a12e54b095f9d35c3e
parent9de01d771dcbd167c006ced9d12c422c5d0cdd10 (diff)
downloadvcsync-221e390d04a2ba01a1e4e1514bdb95faef0145a9.tar.gz
vcsync-221e390d04a2ba01a1e4e1514bdb95faef0145a9.tar.bz2
Remove repository-root statement and -R command line option.
* src/cmdline.opt: Remove the --repository-root (-R) option. * src/config.c: Remove the repository-root statement. * src/cvs.c (cvs_proc): Get the repository path from the CVSROOT envar. * src/vcsync.c (repository_root,repo_name): Remove. * src/vcsync.h (repository_root,repo_name): Remove. (vcsync_config)<repo_root>: Remove. * tests/cvsimp.at: Reflect the changes. * tests/doinstrc-rec.at: Likewise. * tests/doinstrc.at: Likewise. * tests/namedconf00.at: Likewise. * tests/testsuite.at: Likewise. * doc/vcsync.texi: Update.
-rw-r--r--doc/vcsync.texi4
-rw-r--r--src/cmdline.opt6
-rw-r--r--src/config.c11
-rw-r--r--src/cvs.c14
-rw-r--r--src/vcsync.c7
-rw-r--r--src/vcsync.h3
-rw-r--r--tests/cvsimp.at1
-rw-r--r--tests/doinstrc-rec.at2
-rw-r--r--tests/doinstrc.at2
-rw-r--r--tests/namedconf00.at2
-rw-r--r--tests/testsuite.at4
11 files changed, 13 insertions, 43 deletions
diff --git a/doc/vcsync.texi b/doc/vcsync.texi
index a63696c..ac58644 100644
--- a/doc/vcsync.texi
+++ b/doc/vcsync.texi
@@ -111,10 +111,6 @@ type. Please see the corresponding section in @ref{VCS} for a
detailed discussion.
@end deffn
-@deffn {Config} repository-root @var{string}
-Sets the pathname of the repository root.
-@end deffn
-
@deffn {Config} destination-root @var{string}
Sets the pathname of the of the WWW root directory.
@end deffn
diff --git a/src/cmdline.opt b/src/cmdline.opt
index ce35505..e29f336 100644
--- a/src/cmdline.opt
+++ b/src/cmdline.opt
@@ -73,12 +73,6 @@ BEGIN
config_name = optarg;
END
-OPTION(repository-root,R,[<DIR>],
- [<override repository root>])
-BEGIN
- repository_root = optarg;
-END
-
OPTION(destination-root,w,[<DIR>],
[<override destination root directory>])
BEGIN
diff --git a/src/config.c b/src/config.c
index 0adf710..2bbed7d 100644
--- a/src/config.c
+++ b/src/config.c
@@ -179,7 +179,6 @@ vcsync_config_free(struct vcsync_config *cp)
{
free(cp->name);
free(cp->vcs_command);
- free(cp->repo_root);
free(cp->dest_root);
free(cp->message);
free(cp);
@@ -227,9 +226,6 @@ static struct grecs_keyword vcsync_config_kw[] = {
{ "vcs-command", "command", "Set VCS command line",
grecs_type_string, GRECS_DFLT,
NULL, offsetof(struct vcsync_config, vcs_command) },
- { "repository-root", "dir", "Pathname of the repository root",
- grecs_type_string, GRECS_DFLT,
- NULL, offsetof(struct vcsync_config, repo_root) },
{ "destination-root",
"dir", "Pathname of the of the WWW root directory",
grecs_type_string, GRECS_DFLT,
@@ -260,9 +256,6 @@ static struct grecs_keyword vcsync_kw[] = {
{ "vcs-command", "command", "Set VCS command line",
grecs_type_string, GRECS_DFLT,
&default_config.vcs_command },
- { "repository-root", "dir", "Pathname of the repository root",
- grecs_type_string, GRECS_DFLT,
- &default_config.repo_root },
{ "destination-root",
"dir", "Pathname of the of the WWW root directory",
grecs_type_string, GRECS_DFLT,
@@ -329,10 +322,6 @@ config_finish(struct grecs_node *tree)
assert(config->proc != NULL);
}
- if (repository_root)
- config->repo_root = repository_root;
- else if (!config->repo_root)
- config->repo_root = "/webcvs";
if (destination_root)
config->dest_root = destination_root;
else if (!config->dest_root)
diff --git a/src/cvs.c b/src/cvs.c
index cc2106c..d68c500 100644
--- a/src/cvs.c
+++ b/src/cvs.c
@@ -20,7 +20,7 @@
To synchronize web directories on each commit add the following to
CVSROOT/loginfo:
- ALL /bin/vcsync -R ${CVSROOT} %{s}
+ ALL /bin/vcsync %{s}
Make sure to add the following statements to your vcsync.conf file:
@@ -107,12 +107,17 @@ cvs_proc(int argc, char **argv)
struct wordsplit ws;
char *cmd = NULL;
size_t cmdsize;
+ char *repo_root;
if (argc != 1)
die(EX_USAGE, "expected one argument");
debug(1, ("cvs: %s", argv[0]));
-
+
+ repo_root = getenv("CVSROOT");
+ if (!repo_root)
+ die(EX_FAIL, "CVSROOT not defined");
+ diag(LOG_INFO, "CVSROOT=%s",repo_root);
/* Set up VCS-dependent defaults */
if (!config->vcs_command)
config->vcs_command = "/usr/bin/cvs -q -z3";
@@ -121,7 +126,7 @@ cvs_proc(int argc, char **argv)
if (!dry_run && directory && files) {
struct stat st;
- char *dir = repo_name(directory);
+ char *dir = mkfilename(repo_root, directory);
if (stat(dir, &st))
die(EX_FAIL, "cannot stat repository %s: %s",
dir, strerror(errno));
@@ -159,7 +164,7 @@ cvs_proc(int argc, char **argv)
grecs_asprintf(&cmd, &cmdsize,
"%s -d %s checkout %s",
config->vcs_command,
- config->repo_root, directory);
+ repo_root, directory);
} else if (files)
grecs_asprintf(&cmd, &cmdsize, "%s update -l",
config->vcs_command);
@@ -175,6 +180,5 @@ cvs_proc(int argc, char **argv)
if (directory)
register_directory(directory, !files);
-
}
diff --git a/src/vcsync.c b/src/vcsync.c
index c03f095..303bdea 100644
--- a/src/vcsync.c
+++ b/src/vcsync.c
@@ -22,7 +22,6 @@ int debug_level;
int lint_only;
int stderr_only;
char *config_file;
-char *repository_root;
char *destination_root;
struct vcs_tab {
@@ -83,12 +82,6 @@ mkfilename(const char *dir, const char *name)
return pathcat(a);
}
-char *
-repo_name(const char *project)
-{
- return mkfilename(config->repo_root, project);
-}
-
#include "cmdline.h"
diff --git a/src/vcsync.h b/src/vcsync.h
index 7b04473..b670cdf 100644
--- a/src/vcsync.h
+++ b/src/vcsync.h
@@ -22,7 +22,6 @@ extern int debug_level;
extern int dry_run;
extern const char *progname;
extern int log_to_stderr;
-extern char *repository_root;
extern char *destination_root;
void setprogname(const char *arg);
@@ -47,7 +46,6 @@ struct vcsync_config {
int debug_level;
vcs_proc_fn proc;
char *vcs_command; /* FIXME: additional VCS parameters? */
- char *repo_root;
char *dest_root;
unsigned timeout;
unsigned sleep_time;
@@ -99,7 +97,6 @@ int runcmd_wait(void);
char *pathcat(const char **path);
char *mkfilename(const char *dir, const char *name);
-char *repo_name(const char *project);
void doinstrc(const char *dir);
void register_directory(const char *dir, int recursive);
diff --git a/tests/cvsimp.at b/tests/cvsimp.at
index 12f6239..2984303 100644
--- a/tests/cvsimp.at
+++ b/tests/cvsimp.at
@@ -28,7 +28,6 @@ cat > vcsync.conf <<EOT
detach yes;
sleep 2;
vcs-type cvs;
-repository-root $cwd/repo;
destination-root $cwd/home;
EOT
diff --git a/tests/doinstrc-rec.at b/tests/doinstrc-rec.at
index 6c5e3c5..8dba620 100644
--- a/tests/doinstrc-rec.at
+++ b/tests/doinstrc-rec.at
@@ -47,7 +47,7 @@ EOT
cd ../..
set -e
-vcsync -e -c /dev/null -R $cwd/repo -w $cwd/home -D test/ -d 2>err
+vcsync -e -c /dev/null -w $cwd/home -D test/ -d 2>err
sed "s|$cwd/||" err >&2
test -x home/test/x && echo "x OK"
diff --git a/tests/doinstrc.at b/tests/doinstrc.at
index 042a91a..49ee02a 100644
--- a/tests/doinstrc.at
+++ b/tests/doinstrc.at
@@ -38,7 +38,7 @@ EOT
cd ../..
set -e
-vcsync -e -c /dev/null -R $cwd/repo -w $cwd/home -D test -d 2>err
+vcsync -e -c /dev/null -w $cwd/home -D test -d 2>err
sed "s|$cwd/||" err >&2
test -x home/test/x && echo "x OK"
diff --git a/tests/namedconf00.at b/tests/namedconf00.at
index cf56df8..44f60ef 100644
--- a/tests/namedconf00.at
+++ b/tests/namedconf00.at
@@ -28,13 +28,11 @@ cat > vcsync.conf <<EOT
detach yes;
sleep 2;
vcs-type cvs;
-repository-root $cwd/a;
destination-root $cwd/b;
config x {
detach yes;
sleep 2;
vcs-type cvs;
- repository-root $cwd/repo;
destination-root $cwd/home;
}
EOT
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 42ae640..509062e 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -26,7 +26,7 @@ dnl CVS_REPO_INIT(DIR, CONF [, NAME])
m4_define([CVS_REPO_INIT],[
$CVS_BIN -d $1 init
chmod +w $1/CVSROOT/loginfo
-echo "ALL [$BINDIR]/vcsync -c $2 m4_if([$3],,,[--name $3]) -R [\${CVSROOT}] %{s}" > $1/CVSROOT/loginfo
+echo "ALL [$BINDIR]/vcsync -c $2 m4_if([$3],,,[--name $3]) %{s}" > $1/CVSROOT/loginfo
chmod -w $1/CVSROOT/loginfo
])
@@ -38,8 +38,8 @@ cat > vcsync.conf <<EOT
detach yes;
sleep 2;
vcs-type cvs;
-repository-root $cwd/repo;
destination-root $cwd/home;
+debug 4;
EOT
# Initialize repository

Return to:

Send suggestions and report system problems to the System administrator.