Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Mar 1998 19:19:52 -0800
From:      Studded <Studded@dal.net>
To:        "Jordan K. Hubbard" <jkh@time.cdrom.com>
Cc:        stable@FreeBSD.ORG
Subject:   Re: More problems with new slice code
Message-ID:  <350B48D8.C2315333@dal.net>
References:  <13009.889922009@time.cdrom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------F1B4693A969C983496806E1F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Jordan K. Hubbard wrote:
> 
> > That sounds like a plan. :)  Thanks.  I merged the etc's on the machine
> > quite happily after the previous -STABLE upgrade, but skipped
> > /dev/MAKEDEV.  ah well..
> 
> You'd hardly be the first to forget this - it's rather buried there
> under /usr/src/etc/etc.i386.
> 
> Anyone listened here care to write up an UPGRADE.TXT file that lists
> all sorts of helpful facts like the above? :-)  I'd be more than happy
> to bundle it with the upcoming 2.2.6 distribution if it's done with
> any reasonable degree of care.

	Just the opening I was waiting for. :) Actually I think between Nik
Clayton and I we have a very good procedure outlined as part of our
respective make world tutorials. You can find mine (and a link to his)
at http://home.san.rr.com/freebsd/upgrade.html. The short version is:

1. mkdir /var/tmp/temproot
2. cd /usr/src/etc
3. make DESTDIR=/var/tmp/temproot distrib-dirs distribution
4. cd /var/tmp/temproot

	Here is where Nik and I differ. He has a perl script that checks the
files, but I wrote one in sh that I think is simpler, easier for the
user to understand, but still does a lot for the user. I'll append it to
this letter. If you'd like me to hammer the info I have on my page (plus
other pertinent bits) into something that can be used as an UPGRADE.TXT
just let me know, I'll be happy to do that. 

	As far as updating /dev goes, I copied Nik's procedure to do that
verbatim, I think it's a good one. He's updated it on his page but I
haven't had a chance to crib the good bits yet.

Doug

PS, I'm open to suggestions on the name for the script, I'm not terribly
happy with "comproot" but I haven't come up with anything better. :)

-- 
***         Chief Operations Officer, DALnet IRC network       ***
*** Proud operator, designer and maintainer of the world's largest
*** Internet Relay Chat server.  5,328 clients and still growing.
*** Try spider.dal.net on ports 6662-4    (Powered by FreeBSD)
--------------F1B4693A969C983496806E1F
Content-Type: text/plain; charset=us-ascii; name="comproot"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="comproot"

#!/bin/sh

# comproot

# Compare files in the temproot environment with the currently installed copy.
# Studded@dal.net
# Last modified 13 March 1998

# Usage: 
# To compare CVS revision $Id's for files that have them, and compare
# diffs for files that don't, type 
# comproot
# in the top level temp root directory. (e.g., /var/tmp/temproot)
#
# For a strict comparison (diff'ing every pair of files) use 
# comproot -s
#
# To use context diff's instead of unified diffs use
# comproot [-s] -c

PATH=/bin:/usr/bin

# If user has a pager defined, use it. If not, use more.
if [ "x$PAGER" = "x" ]; then
  PAGER='more'
else
  echo ''
  echo "*** You have $PAGER defined as your pager so we'll use that"
  echo ''
  sleep 1
fi

# Use unified diffs by default. Context diffs give me a headache. :)
DIFF_FLAG='-u'

opt-err () {
  echo ''
  echo 'Usage: comproot [-s] [-c]'
  echo ''
  echo 'Options:'
  echo '  -s strict comparison (diff every pair of files)'
  echo '  -c use context diff instead of unified diff'
  echo ''
  exit 1
}

opt-case () {
  case "$1" in
   "-s")
    STRICT=yes
    ;;
   "-c")
    DIFF_FLAG='-c'
    ;;
   *)
    opt-err
    ;;
  esac
}

# Check command line options
if [ "x$1" != "x" ]; then
  opt-case "$1"
fi

if [ "x$2" != "x" ]; then
  opt-case "$2"
fi

if [ "x$3" != "x" ]; then
  opt-err
fi

# Using -size +0 avoids uselessly checking the empty log files created
# by /usr/src/etc/Makefile and the device entries in ./dev (but does
# check the scripts in ./dev, as we'd like). 
for COMPFILE in `find . -type f -size +0`; do
if [ ! -n "$STRICT" ]; then

# Compare CVS $Id's first so if the file hasn't been modified
# local changes will be ignored.
  IDFILE1=`grep "[$]Id:" $COMPFILE`
  IDFILE2=`grep "[$]Id:" ${COMPFILE#.}`

# If the files have the same $Id, delete the one in temproot so the
# user will have less to wade through if files are left to merge by hand.
  if [ -n "$IDFILE1" -a "$IDFILE1" = "$IDFILE2" ]; then
    echo "*** $COMPFILE has the same Id as the installed version, deleting"
    rm $COMPFILE
  fi
fi

# If the file is still here either because the $Id's are different, the
# file doesn't have an $Id, or we're using 'STRICT' mode; look at the diff.
if [ -f "$COMPFILE" ]; then

# Do an absolute diff first to see if the files are actually different.
  diff -q "${COMPFILE#.}" "$COMPFILE"

# If they're not different, delete the one in temproot.
  if [ $? -eq 0 ]; then
    echo "*** $COMPFILE is the same as installed version, deleting"
    rm "$COMPFILE"
  else

# Ok, the files are different, so show the user where they differ. Use user's
# choice of diff methods; and user's pager if they have one. Use more if not.
    echo ''
    diff "$DIFF_FLAG" "${COMPFILE#.}" "$COMPFILE" | "$PAGER"
    echo ''
    read -p "*** Ok to delete $COMPFILE? (y for yes) [no]  " RMORNOT
    if [ "x$RMORNOT" = "xy" -o "x$RMORNOT" = "xY" ]; then
      rm "$COMPFILE"
      echo ''
      echo "   *** Deleting $COMPFILE"
      echo ''
      sleep 1
    fi
  fi
fi

# If the user didn't want to delete the file, give them the option to
# install it, or leave it around to merge by hand.
if [ -f "$COMPFILE" ]; then
  echo ''
  read -p "*** Would you like to install $COMPFILE? (y for yes) [no]  " MVORNOT
  echo ''
  if [ "x$MVORNOT" = "xy" -o "x$MVORNOT" = "xY" ]; then
    mv "$COMPFILE" "${COMPFILE#.}"
    echo "   *** Installing $COMPFILE"
  else
    echo "   *** $COMPFILE will remain for your consideration"
  fi
  echo ''
  sleep 1
fi
# This is for the 'do' way up there at the beginning
done

--------------F1B4693A969C983496806E1F--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message



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