diff options
author | John Polstra <jdp@FreeBSD.org> | 1997-02-02 04:11:35 +0000 |
---|---|---|
committer | John Polstra <jdp@FreeBSD.org> | 1997-02-02 04:11:35 +0000 |
commit | a2fac247975b4bffe7cbdc4c56aa69f4009e455f (patch) | |
tree | 30cbdc7bdf911f802be744e3041c09da9de817b6 /net/cvsup-mirror/files | |
parent | d5ae3fb035f3dc9740f8398759ee95d49db2fe3b (diff) |
Notes
Diffstat (limited to 'net/cvsup-mirror/files')
-rw-r--r-- | net/cvsup-mirror/files/cvsupd.sh | 16 | ||||
-rw-r--r-- | net/cvsup-mirror/files/supfile | 11 | ||||
-rw-r--r-- | net/cvsup-mirror/files/update.sh | 68 |
3 files changed, 95 insertions, 0 deletions
diff --git a/net/cvsup-mirror/files/cvsupd.sh b/net/cvsup-mirror/files/cvsupd.sh new file mode 100644 index 000000000000..1190e591c685 --- /dev/null +++ b/net/cvsup-mirror/files/cvsupd.sh @@ -0,0 +1,16 @@ +#! /bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/cvsupd\.sh\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi +base=${PREFIX}/etc/cvsup + +export PATH=/bin:/usr/bin:${PREFIX}/sbin +umask 2 + +test -x ${PREFIX}/sbin/cvsupd || exit 1 +echo -n " cvsupd" +cd ${base} || exit +. config.sh || exit +su -m ${user} -c "cvsupd -C ${maxclients} -l @${facility}" diff --git a/net/cvsup-mirror/files/supfile b/net/cvsup-mirror/files/supfile new file mode 100644 index 000000000000..fb82b1916263 --- /dev/null +++ b/net/cvsup-mirror/files/supfile @@ -0,0 +1,11 @@ +# +# Standard supfile for CVSup FreeBSD mirrors. +# +*default delete use-rel-suffix +cvs-all release=cvs prefix=prefixes/FreeBSD.cvs norsync +cvs-crypto release=cvs prefix=prefixes/FreeBSD-crypto.cvs +src-sys release=lite2 prefix=prefixes/FreeBSD.lite2 norsync +src-sys release=smp prefix=prefixes/FreeBSD.smp norsync +gnats release=current prefix=prefixes/FreeBSD-gnats.current +www release=current prefix=prefixes/FreeBSD-www.current +distrib release=self prefix=prefixes/distrib.self diff --git a/net/cvsup-mirror/files/update.sh b/net/cvsup-mirror/files/update.sh new file mode 100644 index 000000000000..c6b73c474e91 --- /dev/null +++ b/net/cvsup-mirror/files/update.sh @@ -0,0 +1,68 @@ +#! /bin/sh + +if ! export PREFIX=$(expr $0 : "\(/.*\)/etc/cvsup/update\.sh\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +export PATH=/bin:/usr/bin:${PREFIX}/bin + +lock=/var/spool/lock/cvsup.lock +log=/var/log/cvsup.log + +# Rotate the log files + +umask 22 +test -f ${log}.7 && mv -f ${log}.7 ${log}.8 +test -f ${log}.6 && mv -f ${log}.6 ${log}.7 +test -f ${log}.5 && mv -f ${log}.5 ${log}.6 +test -f ${log}.4 && mv -f ${log}.4 ${log}.5 +test -f ${log}.3 && mv -f ${log}.3 ${log}.4 +test -f ${log}.2 && mv -f ${log}.2 ${log}.3 +test -f ${log}.1 && mv -f ${log}.1 ${log}.2 +test -f ${log}.0 && mv -f ${log}.0 ${log}.1 +test -f ${log} && mv -f ${log} ${log}.0 +exec >${log} 2>&1 + +# Do the update + +date "+CVSup update begins at %Y/%m/%d %H:%M:%S" + +# The rest of this is executed while holding the lock file, to ensure that +# multiple instances won't collide with one another. + +lockf -t 0 ${lock} /bin/sh << 'E*O*F' + +base=${PREFIX}/etc/cvsup +cd ${base} || exit +. config.sh || exit + +colldir=sup.client +startup=${PREFIX}/etc/rc.d + +umask 2 + +if [ ${host_crypto} = ${host} ]; then + echo "Updating from ${host}" + cvsup -gL 1 -c ${colldir} -h ${host} supfile +else + if [ -d prefixes/FreeBSD-crypto.cvs ]; then + echo "Updating from ${host_crypto}" + cvsup -gL 1 -c ${colldir} -h ${host_crypto} supfile.crypto + fi + echo "Updating from ${host}" + cvsup -gL 1 -c ${colldir} -h ${host} supfile.non-crypto +fi + +if [ -f .start_server ]; then + if [ -x ${startup}/cvsupd.sh ]; then + echo -n "Starting the server:" + /bin/sh ${startup}/cvsupd.sh + echo "." + fi + rm -f .start_server +fi + +E*O*F + +date "+CVSup update ends at %Y/%m/%d %H:%M:%S" |