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.
This commit is contained in:
Doug Barton 2010-01-08 00:05:10 +00:00
parent c670f97a6b
commit f94a6780d9
2 changed files with 30 additions and 24 deletions

View File

@ -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

View File

@ -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
'') ;;