superseded by sysmerge(8)

This commit is contained in:
naddy 2008-08-20 15:04:19 +00:00
parent 95f99e1887
commit 470f889e92
6 changed files with 0 additions and 403 deletions

View File

@ -1,34 +0,0 @@
# $OpenBSD: Makefile,v 1.14 2008/05/08 14:59:49 naddy Exp $
COMES_WITH= 4.4 # sysmerge(8)
COMMENT= aids with merging configuration files during an upgrade
DISTNAME= mergemaster-1.46
PKGNAME= ${DISTNAME}p2
CATEGORIES= sysutils
MAINTAINER= Christian Weisgerber <naddy@openbsd.org>
# BSD
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
MASTER_SITES= http://sites.inka.de/~mips/unix/distfiles/
NO_BUILD= Yes
NO_REGRESS= Yes
PKG_ARCH= *
WRKDIST= ${WRKDIR}/mergemaster
do-install:
@perl -pi -e 's:\@SYSCONFDIR@:${SYSCONFDIR}:g;' \
-e 's:\@LOCALBASE@:${LOCALBASE}:g;' \
${WRKSRC}/mergemaster.sh ${WRKSRC}/mergemaster.8
${INSTALL_SCRIPT} ${WRKSRC}/mergemaster.sh ${PREFIX}/sbin/mergemaster
${INSTALL_MAN} ${WRKSRC}/mergemaster.8 ${PREFIX}/man/man8
.include <bsd.port.mk>

View File

@ -1,5 +0,0 @@
MD5 (mergemaster-1.46.tar.gz) = tlYF+pBVFzY9QTjDg+m/lA==
RMD160 (mergemaster-1.46.tar.gz) = XCM+vsVef2Yqdu52Y7MBMjP0qnA=
SHA1 (mergemaster-1.46.tar.gz) = 1g+WK80qEmNnCcdYbPPOYvWca80=
SHA256 (mergemaster-1.46.tar.gz) = omdJF8tYNkiBluWR0q3eFM6mCXjF9O7xeCNV9SAVJAg=
SIZE (mergemaster-1.46.tar.gz) = 12607

View File

@ -1,91 +0,0 @@
$OpenBSD: patch-mergemaster_8,v 1.4 2003/05/12 21:54:32 naddy Exp $
--- mergemaster.8.orig Sat May 10 16:06:02 2003
+++ mergemaster.8 Sat May 10 18:17:03 2003
@@ -45,7 +45,7 @@ The
utility is a Bourne shell script which is designed to aid you
in updating the various configuration and other files
associated with
-.Fx .
+.Ox .
It is
.Sy HIGHLY
recommended that you back up your
@@ -82,13 +82,13 @@ By default it creates the temporary root
.Pa /var/tmp/temproot
and compares the
.Xr cvs 1
-version $Id/$FreeBSD strings for files that have them, deleting
+version $OpenBSD strings for files that have them, deleting
the temporary file if the strings match.
If there is
-no $Id string, or if the strings are different it
+no $OpenBSD string, or if the strings are different it
compares the files themselves.
You can
-also specify that the script ignore the $Id strings and
+also specify that the script ignore the $OpenBSD strings and
compare every file.
.Pp
The merge menu option is designed to let you easily combine your
@@ -168,6 +168,13 @@ on a previously cleaned directory, skipp
the temporary root environment.
This option is compatible
with all other options.
+In particular, it can be used with
+.Fl t
+to specify the directory containing an extracted copy of the
+.Pa /etc
+distribution from an
+.Ox
+snapshot.
.It Fl v
Be more verbose about the process.
You should probably use
@@ -197,14 +204,12 @@ destination directory.
.It Fl p
Pre-buildworld mode.
Compares only files known to be essential to the success of
-{build|install}world,
-including
-.Pa /etc/make.conf .
+.Dq make build .
.It Fl C
After a standard
.Nm
run,
-compares your rc.conf[.local] options to the defaults.
+compares your rc.conf.local options to the defaults.
.It Fl P
Preserve files that you replace in
.Pa /var/tmp/mergemaster/preserved-files-<date> ,
@@ -317,7 +322,7 @@ with all values commented out:
#DIFF_FLAG='-u'
#
# Additional options for diff. This will get unset when using -s.
-#DIFF_OPTIONS='-I$\&FreeBSD:.*[$]' # Ignores CVS Id tags
+#DIFF_OPTIONS='-I$\&OpenBSD:.*[$]' # Ignores CVS Id tags
#
# Verbose mode includes more details and additional checks
#VERBOSE=
@@ -366,9 +371,9 @@ with all values commented out:
.Pp
.Pa /usr/src/etc/Makefile
.Rs
-.%O http://www.FreeBSD.org/doc/handbook/makeworld.html
-.%T The Cutting Edge (using make world)
-.%A Nik Clayton
+.%O http://www.openbsd.org/faq/upgrade-minifaq.html
+.%T Mini-FAQ: Upgrading OpenBSD
+.%A Kjell Wooding
.Re
.Sh DIAGNOSTICS
Exit status is 0 on successful completion, or if the user bails out
@@ -389,7 +394,7 @@ web pages in a much simpler form under t
.Pa comproot
on 13 March 1998. The idea for creating the
temporary root environment comes from Nik Clayton's
-make world tutorial which is referenced above.
+FreeBSD make world tutorial.
.Sh AUTHORS
This manual page and the script itself were written by
.An Douglas Barton Aq DougB@FreeBSD.org .

View File

@ -1,259 +0,0 @@
$OpenBSD: patch-mergemaster_sh,v 1.9 2005/12/27 21:58:44 naddy Exp $
--- mergemaster.sh.orig Sun May 11 00:06:02 2003
+++ mergemaster.sh Tue Dec 27 22:44:22 2005
@@ -10,7 +10,7 @@
# $FreeBSD: mergemaster.sh,v 1.46 2003/05/03 06:35:19 dougb Exp $
-PATH=/bin:/usr/bin:/usr/sbin
+PATH=/bin:/usr/bin:/usr/sbin:@LOCALBASE@/bin
display_usage () {
VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4`
@@ -224,10 +224,10 @@ press_to_continue () {
#
TEMPROOT='/var/tmp/temproot'
-# Read /etc/mergemaster.rc first so the one in $HOME can override
+# Read @SYSCONFDIR@/mergemaster.rc first so the one in $HOME can override
#
-if [ -r /etc/mergemaster.rc ]; then
- . /etc/mergemaster.rc
+if [ -r @SYSCONFDIR@/mergemaster.rc ]; then
+ . @SYSCONFDIR@/mergemaster.rc
fi
# Read .mergemasterrc before command line so CLI can override
@@ -404,7 +404,7 @@ fi
# Define what CVS $Id tag to look for to aid portability.
#
-CVS_ID_TAG=FreeBSD
+CVS_ID_TAG=OpenBSD
delete_temproot () {
rm -rf "${TEMPROOT}" 2>/dev/null
@@ -506,10 +506,7 @@ case "${RERUN}" in
make DESTDIR=${DESTDIR} distrib-dirs
;;
esac
- make DESTDIR=${TEMPROOT} distrib-dirs &&
- make MAKEOBJDIRPREFIX=${TEMPROOT}/usr/obj obj &&
- make MAKEOBJDIRPREFIX=${TEMPROOT}/usr/obj DESTDIR=${TEMPROOT} \
- distribution;} ||
+ make DESTDIR=${TEMPROOT} -DNOMAKEDEV distribution-etc-root-var;} ||
{ echo '';
echo " *** FATAL ERROR: Cannot 'cd' to ${SOURCEDIR} and install files to";
echo " the temproot environment";
@@ -555,11 +552,6 @@ case "${RERUN}" in
;;
esac
- # Avoid trying to update MAKEDEV if /dev is on a devfs
- if /sbin/sysctl vfs.devfs.generation > /dev/null 2>&1 ; then
- rm -f ${TEMPROOT}/dev/MAKEDEV ${TEMPROOT}/dev/MAKEDEV.local
- fi
-
;; # End of the "RERUN" test
esac
@@ -567,11 +559,8 @@ esac
# or spwd.db. Instead, we want to compare the text versions, and run *_mkdb.
# Prompt the user to do so below, as needed.
#
-rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd
+rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/mail/*.db ${TEMPROOT}/etc/passwd
-# We only need to compare things like freebsd.cf once
-find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null
-
# Get ready to start comparing files
# Check umask if not specified on the command line,
@@ -605,50 +594,6 @@ fi
CONFIRMED_UMASK=${NEW_UMASK:-0022}
-#
-# Warn users who still have old rc files
-#
-for file in atm devfs diskless1 diskless2 isdn network network6 pccard \
- serial syscons sysctl alpha amd64 i386 ia64 sparc64; do
- if [ -f "${DESTDIR}/etc/rc.${file}" ]; then
- OLD_RC_PRESENT=1
- break
- fi
-done
-
-case "${OLD_RC_PRESENT}" in
-1)
- echo ''
- echo " *** There are elements of the old rc system in ${DESTDIR}/etc/."
- echo ''
- echo ' While these scripts will not hurt anything, they are not'
- echo ' functional on an up to date system, and can be removed.'
- echo ''
-
- case "${AUTO_RUN}" in
- '')
- echo -n 'Move these files to /var/tmp/mergemaster/old_rc? [yes] '
- read MOVE_OLD_RC
-
- case "${MOVE_OLD_RC}" in
- [nN]*) ;;
- *)
- mkdir -p /var/tmp/mergemaster/old_rc
- for file in atm devfs diskless1 diskless2 isdn network network6 pccard \
- serial syscons sysctl alpha amd64 i386 ia64 sparc64; do
- if [ -f "${DESTDIR}/etc/rc.${file}" ]; then
- mv ${DESTDIR}/etc/rc.${file} /var/tmp/mergemaster/old_rc/
- fi
- done
- echo ' The files have been moved'
- press_to_continue
- ;;
- esac
- ;;
- *) ;;
- esac
-esac
-
# Use the umask/mode information to install the files
# Create directories as needed
#
@@ -666,12 +611,8 @@ do_install_and_rm () {
rm -f "${2}"
}
-# 4095 = "obase=10;ibase=8;07777" | bc
find_mode () {
- local OCTAL
- OCTAL=$(( ~$(echo "obase=10; ibase=8; ${CONFIRMED_UMASK}" | bc) & 4095 &
- $(echo "obase=10; ibase=8; $(stat -f "%OMp%OLp" ${1})" | bc) ))
- printf "%04o\n" ${OCTAL}
+ perl -e 'printf "%04o\n", (((stat("$ARGV[0]"))[2] & 07777) &~ oct("$ARGV[1]"))' "${1}" "${CONFIRMED_UMASK}"
}
mm_install () {
@@ -698,65 +639,17 @@ mm_install () {
NEED_NEWALIASES=yes
;;
/etc/login.conf)
- NEED_CAP_MKDB=yes
+ if [ -f /etc/login.conf.db ]; then
+ NEED_CAP_MKDB=yes
+ fi
;;
/etc/master.passwd)
do_install_and_rm 600 "${1}" "${DESTDIR}${INSTALL_DIR}"
NEED_PWD_MKDB=yes
DONT_INSTALL=yes
;;
- /.cshrc | /.profile)
- case "${AUTO_INSTALL}" in
- '')
- case "${LINK_EXPLAINED}" in
- '')
- echo " *** Historically BSD derived systems have had a"
- echo " hard link from /.cshrc and /.profile to"
- echo " their namesakes in /root. Please indicate"
- echo " your preference below for bringing your"
- echo " installed files up to date."
- echo ''
- LINK_EXPLAINED=yes
- ;;
- esac
-
- echo " Use 'd' to delete the temporary ${COMPFILE}"
- echo " Use 'l' to delete the existing ${DESTDIR}${COMPFILE#.} and create the link"
- echo ''
- echo " Default is to leave the temporary file to deal with by hand"
- echo ''
- echo -n " How should I handle ${COMPFILE}? [Leave it to install later] "
- read HANDLE_LINK
- ;;
- *) # Part of AUTO_INSTALL
- HANDLE_LINK=l
- ;;
esac
- case "${HANDLE_LINK}" in
- [dD]*)
- rm "${COMPFILE}"
- echo ''
- echo " *** Deleting ${COMPFILE}"
- ;;
- [lL]*)
- echo ''
- rm -f "${DESTDIR}${COMPFILE#.}"
- if ln "${DESTDIR}/root/${COMPFILE##*/}" "${DESTDIR}${COMPFILE#.}"; then
- echo " *** Link from ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/} installed successfully"
- rm "${COMPFILE}"
- else
- echo " *** Error linking ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/}, ${COMPFILE} will remain to install by hand"
- fi
- ;;
- *)
- echo " *** ${COMPFILE} will remain for your consideration"
- ;;
- esac
- DONT_INSTALL=yes
- ;;
- esac
-
case "${DONT_INSTALL}" in
'')
do_install_and_rm "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}"
@@ -1015,47 +908,27 @@ fi
case "${COMP_CONFS}" in
'') ;;
*)
- . ${DESTDIR}/etc/defaults/rc.conf
+ . ${DESTDIR}/rc.conf
(echo ''
- echo "*** Comparing conf files: ${rc_conf_files}"
+ echo "*** Comparing conf files: ${local_rcconf}"
- for CONF_FILE in ${rc_conf_files}; do
+ for CONF_FILE in ${local_rcconf}; do
if [ -r "${DESTDIR}${CONF_FILE}" ]; then
echo ''
echo "*** From ${DESTDIR}${CONF_FILE}"
- echo "*** From ${DESTDIR}/etc/defaults/rc.conf"
+ echo "*** From ${DESTDIR}/etc/rc.conf"
for RC_CONF_VAR in `grep -i ^[a-z] ${DESTDIR}${CONF_FILE} |
cut -d '=' -f 1`; do
echo ''
grep -w ^${RC_CONF_VAR} ${DESTDIR}${CONF_FILE}
- grep -w ^${RC_CONF_VAR} ${DESTDIR}/etc/defaults/rc.conf ||
+ grep -w ^${RC_CONF_VAR} ${DESTDIR}/etc/rc.conf ||
echo ' * No default variable with this name'
done
fi
done) | ${PAGER}
echo ''
- ;;
-esac
-
-case "${PRE_WORLD}" in
-'') ;;
-*)
- MAKE_CONF="${SOURCEDIR%etc}share/examples/etc/make.conf"
-
- (echo ''
- echo '*** Comparing make variables'
- echo ''
- echo "*** From ${DESTDIR}/etc/make.conf"
- echo "*** From ${MAKE_CONF}"
-
- for MAKE_VAR in `grep -i ^[a-z] ${DESTDIR}/etc/make.conf | cut -d '=' -f 1`; do
- echo ''
- grep -w ^${MAKE_VAR} ${DESTDIR}/etc/make.conf
- grep -w ^#${MAKE_VAR} ${MAKE_CONF} ||
- echo ' * No example variable with this name'
- done) | ${PAGER}
;;
esac

View File

@ -1,11 +0,0 @@
The mergemaster script is designed to aid you in updating the various
configuration and other files associated with OpenBSD. The script
produces a temporary root environment using /usr/src/etc/Makefile which
builds the temporary directory structure from / down, then populates that
environment with the various files. It then compares each file in that
environment to its installed counterpart. When the script finds a change
in the new file, or there is no installed version of the new file it
gives you four options to deal with it. You can install the new file as
is, delete the new file, merge the old and new files (as appropriate)
using sdiff(1) or leave the file in the temporary root environment to
merge by hand later.

View File

@ -1,3 +0,0 @@
@comment $OpenBSD: PLIST,v 1.2 2004/09/15 18:39:33 espie Exp $
@man man/man8/mergemaster.8
sbin/mergemaster