diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2008-02-03 23:34:42 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2008-02-03 23:34:42 +0000 |
commit | cf0c724bcae32234c945a13b2424c9eb0ae6150a (patch) | |
tree | 3de40e907c13b21b59022e777d0fa363c27bc815 /usr.bin | |
parent | 8fe176d9b0a68ee1d04d9b8a2f3e9ba04b77a23e (diff) |
shuffle some stuff around so we dont end up doing the same things
twice in cvs_module_lookup() and checkout_check_directory();
allow single files to be ignored with ! as well;
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/checkout.c | 7 | ||||
-rw-r--r-- | usr.bin/cvs/config.h | 6 | ||||
-rw-r--r-- | usr.bin/cvs/modules.c | 12 | ||||
-rw-r--r-- | usr.bin/cvs/repository.c | 6 |
4 files changed, 14 insertions, 17 deletions
diff --git a/usr.bin/cvs/checkout.c b/usr.bin/cvs/checkout.c index 4fecb920c85..2977edd3d58 100644 --- a/usr.bin/cvs/checkout.c +++ b/usr.bin/cvs/checkout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: checkout.c,v 1.123 2008/02/03 22:50:28 joris Exp $ */ +/* $OpenBSD: checkout.c,v 1.124 2008/02/03 23:34:41 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -228,8 +228,10 @@ checkout_check_repository(int argc, char **argv) if (dflag != NULL) wdir = dflag; + else if (mc->mc_flags & MODULE_ALIAS) + wdir = fl->file_path; else - wdir = mc->mc_wdir; + wdir = mc->mc_name; switch (checkout_classify(repo, fl->file_path)) { case CVS_FILE: @@ -280,7 +282,6 @@ checkout_check_repository(int argc, char **argv) xfree(ip); } - xfree(mc->mc_wdir); xfree(mc); } } diff --git a/usr.bin/cvs/config.h b/usr.bin/cvs/config.h index 19506f3a48a..8d33c4e8a1f 100644 --- a/usr.bin/cvs/config.h +++ b/usr.bin/cvs/config.h @@ -1,4 +1,4 @@ -/* $OpenBSD: config.h,v 1.5 2008/02/03 22:50:28 joris Exp $ */ +/* $OpenBSD: config.h,v 1.6 2008/02/03 23:34:41 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -37,8 +37,7 @@ void modules_parse_line(char *); #define MODULE_RUN_ON_COMMIT 0x08 struct module_checkout { - char *mc_repo; - char *mc_wdir; + char *mc_name; int mc_flags; int mc_canfree; @@ -48,7 +47,6 @@ struct module_checkout { struct module_info { char *mi_name; - char *mi_repository; int mi_flags; struct cvs_flisthead mi_modules; diff --git a/usr.bin/cvs/modules.c b/usr.bin/cvs/modules.c index 9bc2adf47f6..8acdfb82f0e 100644 --- a/usr.bin/cvs/modules.c +++ b/usr.bin/cvs/modules.c @@ -1,4 +1,4 @@ -/* $OpenBSD: modules.c,v 1.5 2008/02/03 22:53:04 joris Exp $ */ +/* $OpenBSD: modules.c,v 1.6 2008/02/03 23:34:41 joris Exp $ */ /* * Copyright (c) 2008 Joris Vink <joris@openbsd.org> * @@ -163,9 +163,6 @@ modules_parse_line(char *line) if (!(mi->mi_flags & MODULE_ALIAS) && TAILQ_EMPTY(&(mi->mi_modules))) cvs_file_get(dirname, 0, &(mi->mi_modules)); - fl = TAILQ_FIRST(&(mi->mi_modules)); - mi->mi_repository = xstrdup(fl->file_path); - TAILQ_INSERT_TAIL(&modules, mi, m_list); } @@ -183,10 +180,7 @@ cvs_module_lookup(char *name) mc->mc_modules = mi->mi_modules; mc->mc_ignores = mi->mi_ignores; mc->mc_canfree = 0; - if (mi->mi_flags & MODULE_ALIAS) - mc->mc_wdir = xstrdup(mi->mi_repository); - else - mc->mc_wdir = xstrdup(mi->mi_name); + mc->mc_name = xstrdup(mi->mi_name); mc->mc_flags = mi->mi_flags; return (mc); } @@ -196,7 +190,7 @@ cvs_module_lookup(char *name) TAILQ_INIT(&(mc->mc_ignores)); cvs_file_get(name, 0, &(mc->mc_modules)); mc->mc_canfree = 1; - mc->mc_wdir = xstrdup(name); + mc->mc_name = xstrdup(name); mc->mc_flags |= MODULE_ALIAS; return (mc); diff --git a/usr.bin/cvs/repository.c b/usr.bin/cvs/repository.c index 9d2c8d2033f..b5718ec3f2c 100644 --- a/usr.bin/cvs/repository.c +++ b/usr.bin/cvs/repository.c @@ -1,4 +1,4 @@ -/* $OpenBSD: repository.c,v 1.18 2008/02/03 22:50:28 joris Exp $ */ +/* $OpenBSD: repository.c,v 1.19 2008/02/03 23:34:41 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -108,8 +108,12 @@ cvs_repository_getdir(const char *dir, const char *wdir, (void)xsnprintf(rpath, MAXPATHLEN, "%s/%s", dir, dp->d_name); if (!TAILQ_EMPTY(&checkout_ign_pats)) { + if ((s = strrchr(fpath, ',')) != NULL) + *s = '\0'; if (cvs_file_chkign(fpath)) continue; + if (s != NULL) + *s = ','; } /* |