xref: /netbsd-src/external/gpl2/xcvs/dist/contrib/newcvsroot.sh (revision a7c918477dd5f12c1da816ba05caf44eab2d06d6)
1#! /bin/sh
2#
3# Copyright 2002 Derek R. Price & Ximbiot <http://ximbiot.com>.
4# All rights reserved.
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2, or (at your option)
9# any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16#
17# ///// ///// ///// ///// ///// ***** \\\\\ \\\\\ \\\\\ \\\\\ \\\\\
18#
19# newcvsroot.sh
20#
21# Recursively change the CVSROOT for a sandbox.
22#
23# INPUTS
24#	$1		The new CVSROOT
25#	$2+		The list of sandbox directories to convert.
26#                       Defaults to the current directory.
27
28usage ()
29{
30	echo "$0: usage: $prog newcvsroot [startdir]" >&2
31}
32
33prog=`basename "$0"`
34
35if test "${1+set}" != set; then
36	usage
37	exit 2
38else :; fi
39
40echo "$1" >/tmp/$prog$$
41shift
42
43for dir in `find "${@:-.}" -name CVS`; do
44	cp /tmp/$prog$$ "$dir"/Root
45done
46
47rm /tmp/$prog$$
48