summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2003-02-05 11:09:21 +0000
committerdougb <dougb@FreeBSD.org>2003-02-05 11:09:21 +0000
commit60462a1f22acfbfb6b0e4226ba8bbbd8809e15ed (patch)
tree9efa995555560aae8e6ee2df8dc4ceb5672f97f5 /usr.sbin
parentf1aeff9dcbbfd44faf53c5eddf9f6206bd2bdce1 (diff)
downloadFreeBSD-src-60462a1f22acfbfb6b0e4226ba8bbbd8809e15ed.zip
FreeBSD-src-60462a1f22acfbfb6b0e4226ba8bbbd8809e15ed.tar.gz
* Update copyright year.
* Give back one line of ws when showing a diff. This was requested by several. * Un-quote DIFF_FLAG, and add DIFF_OPTIONS. This will allow the user to do more creative things in a mergemaster rc file. Un-quoting is necessary in order to handle things like CVS Id tags that look like shell variables. * Simplify terminal width determination. Suggestions related to ignoring the CVS Id's were taken from several, with dillon and gad providing particularly helpful feedback.
Diffstat (limited to 'usr.sbin')
-rwxr-xr-xusr.sbin/mergemaster/mergemaster.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/mergemaster/mergemaster.sh b/usr.sbin/mergemaster/mergemaster.sh
index d2f1f90..7e415f9 100755
--- a/usr.sbin/mergemaster/mergemaster.sh
+++ b/usr.sbin/mergemaster/mergemaster.sh
@@ -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-2002 Douglas Barton
+# Copyright 1998-2003 Douglas Barton
# DougB@FreeBSD.org
# $FreeBSD$
@@ -115,10 +115,9 @@ diff_loop () {
echo ' ====================================================================== '
echo ''
(
- echo ''
echo " *** Displaying differences between ${COMPFILE} and installed version:"
echo ''
- diff "${DIFF_FLAG}" "${DESTDIR}${COMPFILE#.}" "${COMPFILE}"
+ diff ${DIFF_FLAG} ${DIFF_OPTIONS} "${DESTDIR}${COMPFILE#.}" "${COMPFILE}"
) | ${PAGER}
echo ''
fi
@@ -242,6 +241,7 @@ while getopts ":ascrvhipCm:t:du:w:D:" COMMAND_LINE_ARGUMENT ; do
case "${COMMAND_LINE_ARGUMENT}" in
s)
STRICT=yes
+ unset DIFF_OPTIONS
;;
c)
DIFF_FLAG='-c'
@@ -372,7 +372,7 @@ SOURCEDIR=${SOURCEDIR:-/usr/src/etc}
# Check the width of the user's terminal
#
if [ -t 0 ]; then
- w=$(stty -a | sed -ne 's/.* \([0-9][0-9]*\) columns.*/\1/p')
+ w=`tput columns`
case "${w}" in
0|'') ;; # No-op, since the input is not valid
*)
@@ -812,7 +812,8 @@ for COMPFILE in `find . -type f -size +0`; do
# Do an absolute diff first to see if the files are actually different.
# If they're not different, delete the one in temproot.
#
- if diff -q "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > /dev/null 2>&1; then
+ if diff -q ${DIFF_OPTIONS} "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > \
+ /dev/null 2>&1; then
echo " *** Temp ${COMPFILE} and installed are the same, deleting"
rm "${COMPFILE}"
else
OpenPOWER on IntegriCloud