blob: b485682ca7752b4473bb88dfec4455b2fc698bd8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
#! /bin/sh
# sv_www_loginfo: Fix up CVSROOT/loginfo for projects web pages
# Copyright 2005, 2007 Sergey Poznyakoff
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
PROGNAME=`basename $0`
WEBCVSROOT=/webcvs
PATH=/usr/local/bin:$PATH
update_loginfos()
{
find $WEBCVSROOT -follow -type d -mindepth 1 -maxdepth 1 |
while read cvsroot
do
name=$cvsroot/CVSROOT/loginfo
s=`grep -v \# $name`
if [ -z "$s" ]; then
echo 'ALL /usr/local/bin/sv_sync_www_schedule ${USER} ${CVSROOT} %s' > $name
rcs -q -U $name
ci -q -m"added by sv_web_loginfo" $name
co -q $name
echo "Updated $name"
fi
done
}
usage() {
cat - <<EOF
usage: $PROGNAME [OPTIONS]
$PROGNAME updates CVSROOT/loginfo files in projects web CVS repository on
Savannah.
OPTIONS are:
-h, --help Display this help summary
--cron Execute from crontab
EOF
}
case ${1:-start} in
--cr|--cro|--cron) update_loginfos | sv_logger -t $PROGNAME -p local1.info;;
start) update_loginfos;;
-h|--h|--he|--hel|--help) usage;;
*) echo "$PROGNAME: Unknown switch: $1" >&2;;
esac
exit 0
|