diff options
author | dougb <dougb@FreeBSD.org> | 2002-05-04 22:45:12 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2002-05-04 22:45:12 +0000 |
commit | 2ce981504c799a2f4a4f784422760e528e45e410 (patch) | |
tree | 8c4dbb4bdd1d54d76e286418b5214b66d06ca593 /usr.sbin | |
parent | 926e98b7197f0c7e8348433329c5b551b2e9a5dc (diff) | |
download | FreeBSD-src-2ce981504c799a2f4a4f784422760e528e45e410.zip FreeBSD-src-2ce981504c799a2f4a4f784422760e528e45e410.tar.gz |
* Add some niceties to make the -p option quieter, and better behaved
* Take a simple idea about setting the screen width using stty (for sdiff's
purposes) thoughtfully suggested by Joerg to an absurd conclusion.
Diffstat (limited to 'usr.sbin')
-rwxr-xr-x | usr.sbin/mergemaster/mergemaster.sh | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/usr.sbin/mergemaster/mergemaster.sh b/usr.sbin/mergemaster/mergemaster.sh index 960e83e..dc4ea90 100755 --- a/usr.sbin/mergemaster/mergemaster.sh +++ b/usr.sbin/mergemaster/mergemaster.sh @@ -260,12 +260,14 @@ while getopts ":ascrvhipCm:t:du:w:D:" COMMAND_LINE_ARGUMENT ; do i) AUTO_INSTALL=yes ;; - p) - PRE_WORLD=yes - ;; C) COMP_CONFS=yes ;; + p) + PRE_WORLD=yes + unset COMP_CONFS + unset AUTO_RUN + ;; m) SOURCEDIR=${OPTARG} ;; @@ -361,6 +363,27 @@ DIFF_FLAG=${DIFF_FLAG:--u} # 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') + case "${w}" in + 0|'') ;; # No-op, since the input is not valid + *) + case "${SCREEN_WIDTH}" in + '') SCREEN_WIDTH="${w}" ;; + "${w}") ;; # No-op, since they are the same + *) + echo -n "*** You entered ${SCREEN_WIDTH} as your screen width, but stty " + echo "thinks it is ${w}." + echo '' + echo -n "What would you like to use? [${w}] " + read SCREEN_WIDTH + ;; + esac + esac +fi + # Define what CVS $Id tag to look for to aid portability. # CVS_ID_TAG=FreeBSD @@ -510,7 +533,7 @@ case "${RERUN}" in # Avoid comparing the motd if the user specifies it in .mergemasterrc case "${IGNORE_MOTD}" in '') ;; - *) rm ${TEMPROOT}/etc/motd + *) rm -f ${TEMPROOT}/etc/motd ;; esac @@ -529,7 +552,7 @@ esac rm -f ${TEMPROOT}/etc/spwd.db ${TEMPROOT}/etc/passwd ${TEMPROOT}/etc/pwd.db # We only need to compare things like freebsd.cf once -find ${TEMPROOT}/usr/obj -type f -delete +find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null # Get ready to start comparing files |