-.\" $OpenBSD: sysmerge.8,v 1.56 2014/08/11 06:30:39 ajacoutot Exp $
+.\" $OpenBSD: sysmerge.8,v 1.57 2014/08/11 09:03:27 ajacoutot Exp $
.\"
.\" Copyright (c) 2008 Antoine Jacoutot <ajacoutot@openbsd.org>
.\"
.Xr ftp 1 .
.El
.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.
+Files can be excluded from comparison by listing them in
+.Pa /etc/sysmerge.ignore .
The following files will always be skipped from comparison:
.Pa /etc/*.db ,
.Pa /etc/localtime ,
#!/bin/ksh -
#
-# $OpenBSD: sysmerge.sh,v 1.149 2014/08/10 17:15:18 jmc Exp $
+# $OpenBSD: sysmerge.sh,v 1.150 2014/08/11 09:03:27 ajacoutot Exp $
#
# Copyright (c) 2008-2014 Antoine Jacoutot <ajacoutot@openbsd.org>
# Copyright (c) 1998-2003 Douglas Barton <DougB@FreeBSD.org>
echo "$@" >> ${REPORT}
}
+# from OpenBSD's /etc/rc,v 1.438
+stripcom() {
+ local _file="$1"
+ local _line
+
+ {
+ while read _line ; do
+ _line=${_line%%#*} # strip comments
+ test -z "$_line" && continue
+ echo $_line
+ done
+ } < $_file
+}
+
# remove newly created work directory and exit with status 1
error_rm_wrkdir() {
(($#)) && echo "!!!! ERROR: $@"
CF_DIFF=$(diff -q -I "##### " ${TEMPROOT}/${cf} ${DESTDIR}/${cf} 2>/dev/null)
[[ -z ${CF_DIFF} ]] && IGNORE_FILES="${IGNORE_FILES} ${cf}"
done
- if [ -r /etc/sysmerge.ignore ]; then
- while read i; do \
- IGNORE_FILES="${IGNORE_FILES} $(echo ${i} | sed -e 's,\.\.,,g' -e 's,#.*,,g')"
- done < /etc/sysmerge.ignore
+ if [ -f /etc/sysmerge.ignore ]; then
+ IGNORE_FILES="${IGNORE_FILES} $(stripcom /etc/sysmerge.ignore)"
fi
for i in ${IGNORE_FILES}; do
- rm -rf ${TEMPROOT}/${i};
+ rm -f ${TEMPROOT}/${i}
done
}