summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2009-04-12 07:43:18 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2009-04-12 07:43:18 +0000
commit698a8afbb51921620e987ffc94814c323c114eb9 (patch)
treee3c4aca9f086a779eaeb6af8ceb2e3027d48210f
parenteead79ee1e534af57a6d2e9f3be6e706aa848102 (diff)
When in automode, sysmerge will now automatically install files
that only differ by CVS Id (adapted from FreeBSD mergemaster) Ground work on the man page, from jmc@ * do not duplicate info * rewordings * move some stuffs around ok jmc@ sthen@
-rw-r--r--usr.sbin/sysmerge/sysmerge.8104
-rw-r--r--usr.sbin/sysmerge/sysmerge.sh15
2 files changed, 56 insertions, 63 deletions
diff --git a/usr.sbin/sysmerge/sysmerge.8 b/usr.sbin/sysmerge/sysmerge.8
index 54444834c5c..46bd6fc210c 100644
--- a/usr.sbin/sysmerge/sysmerge.8
+++ b/usr.sbin/sysmerge/sysmerge.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sysmerge.8,v 1.20 2009/04/09 14:43:54 ajacoutot Exp $
+.\" $OpenBSD: sysmerge.8,v 1.21 2009/04/12 07:43:17 ajacoutot Exp $
.\"
.\" Copyright (c) 2008 Antoine Jacoutot <ajacoutot@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: April 9 2009 $
+.Dd $Mdocdate: April 12 2009 $
.Dt SYSMERGE 8
.Os
.Sh NAME
@@ -82,30 +82,6 @@ and
.Pa xetcXX.tgz
when upgrading from binary sets.
.Pp
-When run in
-.Em automatic
-mode
-.Pq Fl a
-.Nm
-will skip files with identical CVS Id and install missing ones.
-In
-.Em manual
-mode (the default unless
-.Fl a
-is specified),
-.Nm
-will perform a strict comparison of files.
-.Pa /etc/fbtab ,
-.Pa /etc/login.conf ,
-.Pa /etc/sysctl.conf ,
-and
-.Pa /etc/ttys
-are created using helper scripts and will
-.Sy always
-be strictly compared even in
-.Fl a
-mode.
-.Pp
.Nm
will work through the fileset,
offering the chance to merge any differences using ${MERGE_CMD}.
@@ -116,40 +92,6 @@ 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
-When updating from sets, a tarball from an older snapshot or release
-may be provided using the
-.Fl S
-or
-.Fl X
-options.
-If files differ between the supplied tarballs, then installed
-files which have not been modified from the originals will
-be updated automatically.
-Those that have been modified will be offered for comparison.
-.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 ,
-.Pa /etc/passwd ,
-.Pa /etc/motd ,
-.Pa /etc/myname ,
-.Pa /var/mail/root .
-.Pp
-The
-.Xr sendmail 8
-configuration files
-.Pa /etc/mail/localhost.cf ,
-.Pa /etc/mail/sendmail.cf
-and
-.Pa /etc/mail/submit.cf
-will always differ because they include their build date and directories.
-A special test was added to handle this
-and they are offered for comparison only if they really differ.
-.Pp
.Nm
will finish by running
.Xr mtree 8
@@ -161,8 +103,19 @@ The options are as follows:
Automatic mode.
If this option is specified,
.Nm
-will automatically install missing files and disable strict file
-comparison when possible (using CVS Ids).
+will automatically install missing files
+and files differing only by CVS Id,
+and will disable strict file comparison when possible (using CVS Id).
+.Pa /etc/fbtab ,
+.Pa /etc/login.conf ,
+.Pa /etc/sysctl.conf ,
+and
+.Pa /etc/ttys
+are created using helper scripts and will
+.Sy always
+be strictly compared, even when
+.Fl a
+is specified.
.It Fl b
Batch mode.
If this option is specified,
@@ -178,6 +131,8 @@ will attempt to automatically upgrade files from this version
to the one specified by
.Fl s ,
provided that the file has no local changes.
+Files that have not been modified between the supplied tarballs will
+not be offered for comparison.
A tarball path specified as an FTP or HTTP URL will be passed
to ${FETCH_CMD}.
.It Fl s Ar src \*(Ba etcXX.tgz
@@ -195,6 +150,8 @@ will attempt to automatically upgrade files from this version
to the one specified by
.Fl x ,
provided that the file has no local changes.
+Files that have not been modified between the supplied tarballs will
+not be offered for comparison.
A tarball path specified as an FTP or HTTP URL will be passed
to ${FETCH_CMD}.
.It Fl x Ar xetcXX.tgz
@@ -203,6 +160,29 @@ xetcXX.tgz tarball.
A tarball path specified as an FTP or HTTP URL will be passed
to ${FETCH_CMD}.
.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.
+The following files will always be skipped from comparison:
+.Pa /etc/*.db ,
+.Pa /etc/mail/*.db ,
+.Pa /etc/passwd ,
+.Pa /etc/motd ,
+.Pa /etc/myname ,
+.Pa /var/mail/root .
+.Pp
+The
+.Xr sendmail 8
+configuration files
+.Pa /etc/mail/localhost.cf ,
+.Pa /etc/mail/sendmail.cf
+and
+.Pa /etc/mail/submit.cf
+will always differ because they include their build date and directories.
+A special test was added to handle this
+and they are offered for comparison only if they really differ.
.Sh ENVIRONMENT
.Bl -tag -width "DESTDIRXXX"
.It Ev DESTDIR
diff --git a/usr.sbin/sysmerge/sysmerge.sh b/usr.sbin/sysmerge/sysmerge.sh
index 213f002a431..64f4c12ad0b 100644
--- a/usr.sbin/sysmerge/sysmerge.sh
+++ b/usr.sbin/sysmerge/sysmerge.sh
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $OpenBSD: sysmerge.sh,v 1.35 2009/04/09 10:44:50 ajacoutot Exp $
+# $OpenBSD: sysmerge.sh,v 1.36 2009/04/12 07:43:17 ajacoutot Exp $
#
# This script is based on the FreeBSD mergemaster script, written by
# Douglas Barton <DougB@FreeBSD.org>
@@ -363,6 +363,19 @@ diff_loop() {
echo "\n========================================================================\n"
fi
if [ -f "${DESTDIR}${COMPFILE#.}" -a -f "${COMPFILE}" ]; then
+ # automatically install files which differ only by CVS Id
+ if [ "${AUTOMODE}" ]; then
+ if diff -q -I'[$]OpenBSD:.*$' "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > /dev/null 2>&1; then
+ if mm_install "${COMPFILE}"; then
+ echo "===> ${COMPFILE} installed successfully"
+ AUTO_INSTALLED_FILES="${AUTO_INSTALLED_FILES}${DESTDIR}${COMPFILE#.}\n"
+ else
+ echo " *** Warning: problem installing ${COMPFILE}, it will remain to merge by hand"
+ fi
+ return
+ fi
+ fi
+
# if current != new and current = old, auto-install new
if [ "${OTGZ}" -o "${OXTGZ}" ]; then
if diff -q "${DESTDIR}${COMPFILE#.}" "${OTEMPROOT}${COMPFILE#.}" > /dev/null 2>&1; then