From owner-freebsd-stable Mon Oct 14 15: 2:39 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DCC0A37B401 for ; Mon, 14 Oct 2002 15:02:35 -0700 (PDT) Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9927743E9E for ; Mon, 14 Oct 2002 15:02:34 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.12.1/8.12.1) with ESMTP id g9EM1sAN264238; Mon, 14 Oct 2002 18:01:54 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <200210140228.g9E2SRlA058696@apollo.backplane.com> References: <20021013172810.A19177@titus.hanley.stade.co.uk> <20021013130138.G523-100000@femme.sapphite.org> <20021013214642.GB90169@blossom.cjclark.org> <200210132154.g9DLsUmc057065@apollo.backplane.com> <20021013225509.GA90575@blossom.cjclark.org> <200210140228.g9E2SRlA058696@apollo.backplane.com> Date: Mon, 14 Oct 2002 18:01:53 -0400 To: Matthew Dillon , "Crist J. Clark" , Trish Lynch , Adrian Wontroba , chris scott , freebsd-stable@FreeBSD.ORG From: Garance A Drosihn Subject: Re: Some Changes to Mergemaster Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang) Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Apologies for simply repeating Matt's message, but there are plenty of people interested in mergemaster who would not even glance at the discussion about 'Ifconfig config of gif tunnels', and a subject of 'Patch #2 (Re: Ifconfig config of gif tunnels)' did not strike me as being all that much better... At 7:28 PM -0700 10/13/02, Matthew Dillon wrote: > Here's a new patch. I attempt to pull out terminal > parameters via stty. > > I'm still not sure how to deal with the terminal > history / clear issue, but since we kinda know > how many rows there are it would be possible to > scroll the data off before clearing. > > -Matt > >Index: mergemaster.sh >=================================================================== >RCS file: /home/ncvs/src/usr.sbin/mergemaster/mergemaster.sh,v >retrieving revision 1.6.2.14 >diff -u -r1.6.2.14 mergemaster.sh >--- mergemaster.sh 30 Jun 2002 19:01:35 -0000 1.6.2.14 >+++ mergemaster.sh 14 Oct 2002 02:25:53 -0000 >@@ -12,6 +12,20 @@ > > PATH=/bin:/usr/bin:/usr/sbin > >+# XXX set to number of rows on terminal minus 8 >+DIFFROWS=`stty size | awk '{ print $1; }'` >+DIFFCOLS=`stty size | awk '{ print $2; }'` >+if [ -z "$DIFFCOLS" ]; then >+ DIFFCOLS=80 >+fi >+if [ -z "$DIFFROWS" ]; then >+ DIFFROWS=24 >+fi >+if [ $DIFFROWS -le 0 ]; then >+ DIFFROWS=24 >+fi >+DIFFROWS=$(($DIFFROWS - 8)) >+DIFFCOLS=$(($DIFFCOLS - 1)) > display_usage () { > VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4` > echo "mergemaster version ${VERSION_NUMBER}" >@@ -106,24 +120,34 @@ > diff_loop () { > > HANDLE_COMPFILE=v >+ FIRST_TIME=y > > while [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" -o \ > "${HANDLE_COMPFILE}" = "NOT V" ]; do > if [ -f "${DESTDIR}${COMPFILE#.}" -a -f "${COMPFILE}" ]; then > if [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" ]; then >+ if [ "$FIRST_TIME" = "y" ]; then >+ clear >+ ( >+ echo " *** Displaying differences between ${COMPFILE} >and installed version:" >+ echo '' >+ diff "${DIFF_FLAG}" "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" >+ ) | cut -b 1-${DIFFCOLS} | head -${DIFFROWS} >+ echo '...' >+ else >+ clear >+ ( >+ echo " *** Displaying differences between ${COMPFILE} >and installed version:" >+ echo '' >+ diff "${DIFF_FLAG}" "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" >+ ) | ${PAGER} >+ echo '...' >+ fi > echo '' >- echo ' >====================================================================== >' >- echo '' >- ( >- echo '' >- echo " *** Displaying differences between ${COMPFILE} >and installed version:" >- echo '' >- diff "${DIFF_FLAG}" "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" >- ) | ${PAGER} >- echo '' >+ FIRST_TIME=n > fi > else >- echo '' >+ clear > echo " *** There is no installed version of ${COMPFILE}" > echo '' > case "${AUTO_INSTALL}" in -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message