diff options
author | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2008-06-13 00:46:58 +0000 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2008-06-13 00:46:58 +0000 |
commit | c2a30ac94fe9ef480e673a92a91b4c345d954dcc (patch) | |
tree | 665f17db9c5b76127385d0b1a2bf97cf22496ec5 | |
parent | 0c1bc4a0e8b8d5328ef132a97fd5e85b48ac992b (diff) |
- add support for ignoring files and directories from comparison
through an optionnal /etc/sysmerge.ignore file
requested by many
man page tweak from jmc@
/etc/changelist addition suggested by sthen@
ok sthen@ jdixon@ jmc@ naddy@
-rw-r--r-- | etc/changelist | 3 | ||||
-rw-r--r-- | usr.sbin/sysmerge/sysmerge.8 | 8 | ||||
-rw-r--r-- | usr.sbin/sysmerge/sysmerge.sh | 9 |
3 files changed, 16 insertions, 4 deletions
diff --git a/etc/changelist b/etc/changelist index acbc079555c..4619478b6aa 100644 --- a/etc/changelist +++ b/etc/changelist @@ -1,4 +1,4 @@ -# $OpenBSD: changelist,v 1.57 2008/06/08 03:03:37 jdixon Exp $ +# $OpenBSD: changelist,v 1.58 2008/06/13 00:46:57 ajacoutot Exp $ # # List of files which the security script backs up and checks # for modifications. @@ -131,6 +131,7 @@ /etc/suid_profile /etc/sysctl.conf /etc/syslog.conf +/etc/sysmerge.ignore /etc/ttys /etc/usermgmt.conf /etc/weekly diff --git a/usr.sbin/sysmerge/sysmerge.8 b/usr.sbin/sysmerge/sysmerge.8 index 0620e5662c5..64078fd2926 100644 --- a/usr.sbin/sysmerge/sysmerge.8 +++ b/usr.sbin/sysmerge/sysmerge.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sysmerge.8,v 1.7 2008/06/13 00:33:04 ajacoutot Exp $ +.\" $OpenBSD: sysmerge.8,v 1.8 2008/06/13 00:46:57 ajacoutot Exp $ .\" .\" Copyright (c) 2008 Antoine Jacoutot <ajacoutot@openbsd.org> .\" @@ -113,6 +113,10 @@ Should any problems occur, such as a failure to upgrade a file, the user will be notified and have to deal with the issue by hand. .Pp +Files and directories can be excluded from comparison +by listing them in the file +.Pa /etc/sysmerge.ignore , +each entry separated by white space or a new line. The following files will always be skipped from comparison: .Pa /etc/*.db , .Pa /etc/mail/*.db , @@ -183,6 +187,8 @@ The and .Sy backup directories are created relative to this. +.It /etc/sysmerge.ignore +Files and directories to ignore from comparison. .El .Sh SEE ALSO .Xr cap_mkdb 1 , diff --git a/usr.sbin/sysmerge/sysmerge.sh b/usr.sbin/sysmerge/sysmerge.sh index d8a43608757..aee9f9e13f7 100644 --- a/usr.sbin/sysmerge/sysmerge.sh +++ b/usr.sbin/sysmerge/sysmerge.sh @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: sysmerge.sh,v 1.13 2008/06/13 00:33:04 ajacoutot Exp $ +# $OpenBSD: sysmerge.sh,v 1.14 2008/06/13 00:46:57 ajacoutot Exp $ # # This script is based on the FreeBSD mergemaster script, written by # Douglas Barton <DougB@FreeBSD.org> @@ -101,8 +101,13 @@ do_populate() { IGNORE_FILES="${IGNORE_FILES} ${cf}" fi done + if [ -r /etc/sysmerge.ignore ]; then + while read i; do \ + IGNORE_FILES="${IGNORE_FILES} $(echo ${i} | sed -e 's,\.\.,,g')" + done < /etc/sysmerge.ignore + fi for i in ${IGNORE_FILES}; do - rm -f ${TEMPROOT}/${i}; + rm -rf ${TEMPROOT}/${i}; done } |