diff options
author | mat <mat@FreeBSD.org> | 2004-03-17 01:35:06 +0800 |
---|---|---|
committer | mat <mat@FreeBSD.org> | 2004-03-17 01:35:06 +0800 |
commit | 7d94f41c0d3bd7f4bf59aaa6e546fc7928e730ef (patch) | |
tree | 2fab6524b25fe47765ddd237f62c64f8166ed489 /net/cvsup-mirror | |
parent | dc7eab602244275802f5003e0aad8b373fd00a21 (diff) | |
download | freebsd-ports-gnome-7d94f41c0d3bd7f4bf59aaa6e546fc7928e730ef.tar.gz freebsd-ports-gnome-7d94f41c0d3bd7f4bf59aaa6e546fc7928e730ef.tar.zst freebsd-ports-gnome-7d94f41c0d3bd7f4bf59aaa6e546fc7928e730ef.zip |
Update to 1.3, allow to add increase history and to compress logs easily
Approved by: jdp (maintainer)
Diffstat (limited to 'net/cvsup-mirror')
-rw-r--r-- | net/cvsup-mirror/Makefile | 3 | ||||
-rw-r--r-- | net/cvsup-mirror/files/update.sh | 24 |
2 files changed, 16 insertions, 11 deletions
diff --git a/net/cvsup-mirror/Makefile b/net/cvsup-mirror/Makefile index ce35e7b595fa..d42a21fb480f 100644 --- a/net/cvsup-mirror/Makefile +++ b/net/cvsup-mirror/Makefile @@ -6,8 +6,7 @@ # PORTNAME= cvsup-mirror -PORTVERSION= 1.2 -PORTREVISION= 1 +PORTVERSION= 1.3 CATEGORIES= net DISTFILES= diff --git a/net/cvsup-mirror/files/update.sh b/net/cvsup-mirror/files/update.sh index eeea8891cc22..c8d6409cfd47 100644 --- a/net/cvsup-mirror/files/update.sh +++ b/net/cvsup-mirror/files/update.sh @@ -11,18 +11,24 @@ export PATH=/bin:/usr/bin:${PREFIX}/bin lock=/var/spool/lock/cvsup.lock log=/var/log/cvsup.log +num_logs=8 +use_gzip=0 + +if [ ${use_gzip} != 0 ] +then + gz_ext=.gz +fi + # 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 + +for i in $(/usr/bin/jot ${num_logs} $((num_logs-1)) 0) +do + test -f ${log}.$i${gz_ext} && mv -f ${log}.$i${gz_ext} ${log}.$((i+1))${gz_ext} +done + +test -f ${log} && mv -f ${log} ${log}.0 && [ ${use_gzip} != 0 ] && /usr/bin/gzip -9 ${log}.0 exec >${log} 2>&1 # Do the update |