diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2007-09-07 19:36:06 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2007-09-07 19:36:06 +0000 |
commit | 6fc08d4f040c12de5dca6c54a0dffc7e434aeb7b (patch) | |
tree | a20fd79a9515cf2d0ec25e283d4ffc494ec57777 /usr.bin/cvs/checkout.c | |
parent | 62fc1b4a641d37a48a5d409872ac6d05dde89661 (diff) |
Added support for single file checkout.
OK joris@
Diffstat (limited to 'usr.bin/cvs/checkout.c')
-rw-r--r-- | usr.bin/cvs/checkout.c | 20 |
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; } |