summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/checkout.c
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2007-09-07 19:36:06 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2007-09-07 19:36:06 +0000
commit6fc08d4f040c12de5dca6c54a0dffc7e434aeb7b (patch)
treea20fd79a9515cf2d0ec25e283d4ffc494ec57777 /usr.bin/cvs/checkout.c
parent62fc1b4a641d37a48a5d409872ac6d05dde89661 (diff)
Added support for single file checkout.
OK joris@
Diffstat (limited to 'usr.bin/cvs/checkout.c')
-rw-r--r--usr.bin/cvs/checkout.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/usr.bin/cvs/checkout.c b/usr.bin/cvs/checkout.c
index 2d64d2fd11b..2b20fb351c0 100644
--- a/usr.bin/cvs/checkout.c
+++ b/usr.bin/cvs/checkout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: checkout.c,v 1.99 2007/07/25 08:45:24 xsa Exp $ */
+/* $OpenBSD: checkout.c,v 1.100 2007/09/07 19:36:05 tobias Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -21,6 +21,7 @@
#include <errno.h>
#include <fcntl.h>
+#include <libgen.h>
#include <string.h>
#include <unistd.h>
@@ -173,8 +174,21 @@ checkout_check_repository(int argc, char **argv)
current_cvsroot->cr_dir, argv[i]);
if (stat(repo, &st) == -1) {
- cvs_log(LP_ERR, "cannot find module `%s' - ignored",
- argv[i]);
+ /* check if a single file was requested */
+ strlcat(repo, RCS_FILE_EXT, MAXPATHLEN);
+
+ if (stat(repo, &st) == -1) {
+ cvs_log(LP_ERR,
+ "cannot find module `%s' - ignored",
+ argv[i]);
+ continue;
+ }
+
+ cr.fileproc = cvs_update_local;
+ cr.flags = flags;
+ cvs_mkpath(dirname(argv[i]), cvs_specified_tag);
+ cvs_file_run(1, &(argv[i]), &cr);
+
continue;
}