Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Jan 2010 00:05:10 +0000 (UTC)
From:      Doug Barton <dougb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r201765 - head/usr.sbin/mergemaster
Message-ID:  <201001080005.o0805Ad4005288@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dougb
Date: Fri Jan  8 00:05:10 2010
New Revision: 201765
URL: http://svn.freebsd.org/changeset/base/201765

Log:
  Update copyright date
  
  Update delete_temproot() to include the error message if it fails,
  and clean up the places where it's called.
  
  If there are no files left in temproot when the comparison is done
  delete it without prompting. This should make "automated" runs of
  mergemaster without -a a little easier.
  
  Document the new behavior in the man page.

Modified:
  head/usr.sbin/mergemaster/mergemaster.8
  head/usr.sbin/mergemaster/mergemaster.sh

Modified: head/usr.sbin/mergemaster/mergemaster.8
==============================================================================
--- head/usr.sbin/mergemaster/mergemaster.8	Thu Jan  7 23:30:10 2010	(r201764)
+++ head/usr.sbin/mergemaster/mergemaster.8	Fri Jan  8 00:05:10 2010	(r201765)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1998-2009 Douglas Barton
+.\" Copyright (c) 1998-2010 Douglas Barton
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 30, 2009
+.Dd January 7, 2010
 .Dt MERGEMASTER 8
 .Os
 .Sh NAME
@@ -165,6 +165,14 @@ which will be read before
 Options specified on the command line are updated last,
 and therefore can override both files.
 .Pp
+When the comparison is done if there are any files remaining
+in the temproot directory they will be listed, and if the
+.Fl a
+option is not in use the user will be given the option of 
+deleting the temproot directory.
+If there are no files remaining in the temproot directory
+it will be deleted.
+.Pp
 The options are as follows:
 .Bl -tag -width Fl
 .It Fl s

Modified: head/usr.sbin/mergemaster/mergemaster.sh
==============================================================================
--- head/usr.sbin/mergemaster/mergemaster.sh	Thu Jan  7 23:30:10 2010	(r201764)
+++ head/usr.sbin/mergemaster/mergemaster.sh	Fri Jan  8 00:05:10 2010	(r201765)
@@ -5,7 +5,7 @@
 # Compare files created by /usr/src/etc/Makefile (or the directory
 # the user specifies) with the currently installed copies.
 
-# Copyright 1998-2009 Douglas Barton
+# Copyright 1998-2010 Douglas Barton
 # DougB@FreeBSD.org
 
 # $FreeBSD$
@@ -511,7 +511,7 @@ CVS_ID_TAG=FreeBSD
 delete_temproot () {
   rm -rf "${TEMPROOT}" 2>/dev/null
   chflags -R 0 "${TEMPROOT}" 2>/dev/null
-  rm -rf "${TEMPROOT}" || exit 1
+  rm -rf "${TEMPROOT}" || { echo "*** Unable to delete ${TEMPROOT}";  exit 1; }
 }
 
 case "${RERUN}" in
@@ -542,7 +542,7 @@ case "${RERUN}" in
           echo ''
           echo "   *** Deleting the old ${TEMPROOT}"
           echo ''
-          delete_temproot || exit 1
+          delete_temproot
           unset TEST_TEMP_ROOT
           ;;
         [tT])
@@ -1144,28 +1144,26 @@ if [ -n "${TEST_FOR_FILES}" ]; then
   echo "*** Files that remain for you to merge by hand:"
   find "${TEMPROOT}" -type f -size +0 | sort
   echo ''
-fi
-
-case "${AUTO_RUN}" in
-'')
-  echo -n "Do you wish to delete what is left of ${TEMPROOT}? [no] "
-  read DEL_TEMPROOT
 
-  case "${DEL_TEMPROOT}" in
-  [yY]*)
-    if delete_temproot; then
-      echo " *** ${TEMPROOT} has been deleted"
-    else
-      echo " *** Unable to delete ${TEMPROOT}"
-    fi
-    ;;
-  *)
-    echo " *** ${TEMPROOT} will remain"
+  case "${AUTO_RUN}" in
+  '')
+    echo -n "Do you wish to delete what is left of ${TEMPROOT}? [no] "
+    read DEL_TEMPROOT
+    case "${DEL_TEMPROOT}" in
+    [yY]*)
+      delete_temproot
+      ;;
+    *)
+      echo " *** ${TEMPROOT} will remain"
+      ;;
+    esac
     ;;
+  *) ;;
   esac
-  ;;
-*) ;;
-esac
+else
+  echo "*** ${TEMPROOT} is empty, deleting"
+  delete_temproot
+fi
 
 case "${AUTO_INSTALLED_FILES}" in
 '') ;;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001080005.o0805Ad4005288>