[Midnightbsd-cvs] src [10465] U trunk/usr.sbin/mergemaster: add freebsd 9 compatibility

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Jun 6 20:04:19 EDT 2018


Revision: 10465
          http://svnweb.midnightbsd.org/src/?rev=10465
Author:   laffer1
Date:     2018-06-06 20:04:19 -0400 (Wed, 06 Jun 2018)
Log Message:
-----------
add freebsd 9 compatibility

Modified Paths:
--------------
    trunk/usr.sbin/mergemaster/mergemaster.8
    trunk/usr.sbin/mergemaster/mergemaster.sh

Property Changed:
----------------
    trunk/usr.sbin/mergemaster/mergemaster.8
    trunk/usr.sbin/mergemaster/mergemaster.sh

Modified: trunk/usr.sbin/mergemaster/mergemaster.8
===================================================================
--- trunk/usr.sbin/mergemaster/mergemaster.8	2018-06-06 23:59:21 UTC (rev 10464)
+++ trunk/usr.sbin/mergemaster/mergemaster.8	2018-06-07 00:04:19 UTC (rev 10465)
@@ -22,9 +22,10 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
+.\" $FreeBSD: stable/10/usr.sbin/mergemaster/mergemaster.8 315343 2017-03-16 01:38:04Z ngie $
 .\" $MidnightBSD$
 .\"
-.Dd November 1, 2011
+.Dd March 6, 2017
 .Dt MERGEMASTER 8
 .Os
 .Sh NAME
@@ -48,7 +49,7 @@
 utility is a Bourne shell script which is designed to aid you
 in updating the various configuration and other files
 associated with
-.Mx .
+.Fx .
 It is
 .Sy HIGHLY
 recommended that you back up your
@@ -226,9 +227,10 @@
 .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 .
+{build|install}world, i.e.,
+.Pa /etc/group
+and
+.Pa /etc/master.passwd .
 .It Fl F
 If the files differ only by VCS Id ($MidnightBSD)
 install the new file.
@@ -257,14 +259,13 @@
 .Xr make 1 .
 (In other words, where your sources are, but -s was already
 taken.)
-In previous versions of
+In older versions of
 .Nm
-you needed to specify the path all the way to
-.Pa src/etc .
-Starting with r186678 you only need to specify the path to
-.Pa src .
+the path to
+.Pa src/etc
+was required.
 .Nm
-will convert the path for you if you use the old method.
+will convert the path if this older method is used.
 .It Fl t Ar /path/to/temp/root
 Create the temporary root environment in
 .Pa /path/to/temp/root
@@ -474,11 +475,3 @@
 .Sh AUTHORS
 This manual page and the script itself were written by
 .An Douglas Barton Aq dougb at FreeBSD.org .
-.Sh BUGS
-There are no known bugs.
-Please report any problems,
-comments or suggestions to the author.
-Several of the
-improvements to this program have come from user
-suggestions.
-Thank you.


Property changes on: trunk/usr.sbin/mergemaster/mergemaster.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/mergemaster/mergemaster.sh
===================================================================
--- trunk/usr.sbin/mergemaster/mergemaster.sh	2018-06-06 23:59:21 UTC (rev 10464)
+++ trunk/usr.sbin/mergemaster/mergemaster.sh	2018-06-07 00:04:19 UTC (rev 10465)
@@ -495,8 +495,14 @@
 # files the user changed from the reference files.
 #
 if [ -n "${AUTO_UPGRADE}" -a -s "${MTREEFILE}" ]; then
+	# Force FreeBSD 9 compatible output when available.
+	if mtree -F freebsd9 -c -p /var/empty/ > /dev/null 2>&1; then
+		MTREE_FLAVOR="-F freebsd9"
+	else
+		MTREE_FLAVOR=
+	fi
 	CHANGED=:
-	for file in `mtree -eqL -f ${MTREEFILE} -p ${DESTDIR}/ \
+	for file in `mtree -eqL ${MTREE_FLAVOR} -f ${MTREEFILE} -p ${DESTDIR}/ \
 		2>/dev/null | awk '($2 == "changed") {print $1}'`; do
 		if [ -f "${DESTDIR}/$file" ]; then
 			CHANGED="${CHANGED}${DESTDIR}/${file}:"
@@ -705,12 +711,12 @@
   # and to make the actual comparison faster.
   find ${TEMPROOT}/usr -type l -delete 2>/dev/null
   find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null
-  find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null
+  find -d ${TEMPROOT} -type d -empty -mindepth 1 -delete 2>/dev/null
 
   # Build the mtree database in a temporary location.
   case "${PRE_WORLD}" in
   '') MTREENEW=`mktemp -t mergemaster.mtree`
-      mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null
+      mtree -nci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null
       ;;
   *) # We don't want to mess with the mtree database on a pre-world run or
      # when re-scanning a previously-built tree.
@@ -1330,7 +1336,7 @@
   ;;
 esac
 
-if [ -e "${DESTDIR}/etc/localtime" -a -z "${PRE_WORLD}" ]; then	# Ignore if TZ == UTC
+if [ -e "${DESTDIR}/etc/localtime" -a ! -L "${DESTDIR}/etc/localtime" -a -z "${PRE_WORLD}" ]; then	# Ignore if TZ == UTC
   echo ''
   [ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}"
   if [ -f "${DESTDIR}/var/db/zoneinfo" ]; then


Property changes on: trunk/usr.sbin/mergemaster/mergemaster.sh
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list