mergemaster.sh (94196) | mergemaster.sh (96045) |
---|---|
1#!/bin/sh 2 3# mergemaster 4 5# Compare files created by /usr/src/etc/Makefile (or the directory 6# the user specifies) with the currently installed copies. 7 8# Copyright 1998-2002 Douglas Barton 9# DougB@FreeBSD.org 10 | 1#!/bin/sh 2 3# mergemaster 4 5# Compare files created by /usr/src/etc/Makefile (or the directory 6# the user specifies) with the currently installed copies. 7 8# Copyright 1998-2002 Douglas Barton 9# DougB@FreeBSD.org 10 |
11# $FreeBSD: head/usr.sbin/mergemaster/mergemaster.sh 94196 2002-04-08 10:30:44Z dougb $ | 11# $FreeBSD: head/usr.sbin/mergemaster/mergemaster.sh 96045 2002-05-04 22:45:12Z dougb $ |
12 13PATH=/bin:/usr/bin:/usr/sbin 14 15display_usage () { 16 VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4` 17 echo "mergemaster version ${VERSION_NUMBER}" 18 echo 'Usage: mergemaster [-scrvahipC] [-m /path]' 19 echo ' [-t /path] [-d] [-u N] [-w N] [-D /path]' --- 235 unchanged lines hidden (view full) --- 255 h) 256 display_usage 257 display_help 258 exit 0 259 ;; 260 i) 261 AUTO_INSTALL=yes 262 ;; | 12 13PATH=/bin:/usr/bin:/usr/sbin 14 15display_usage () { 16 VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4` 17 echo "mergemaster version ${VERSION_NUMBER}" 18 echo 'Usage: mergemaster [-scrvahipC] [-m /path]' 19 echo ' [-t /path] [-d] [-u N] [-w N] [-D /path]' --- 235 unchanged lines hidden (view full) --- 255 h) 256 display_usage 257 display_help 258 exit 0 259 ;; 260 i) 261 AUTO_INSTALL=yes 262 ;; |
263 p) 264 PRE_WORLD=yes 265 ;; | |
266 C) 267 COMP_CONFS=yes 268 ;; | 263 C) 264 COMP_CONFS=yes 265 ;; |
266 p) 267 PRE_WORLD=yes 268 unset COMP_CONFS 269 unset AUTO_RUN 270 ;; |
|
269 m) 270 SOURCEDIR=${OPTARG} 271 ;; 272 t) 273 TEMPROOT=${OPTARG} 274 ;; 275 d) 276 TEMPROOT=${TEMPROOT}.`date +%m%d.%H.%M` --- 79 unchanged lines hidden (view full) --- 356# Assign the diff flag once so we will not have to keep testing it 357# 358DIFF_FLAG=${DIFF_FLAG:--u} 359 360# Assign the source directory 361# 362SOURCEDIR=${SOURCEDIR:-/usr/src/etc} 363 | 271 m) 272 SOURCEDIR=${OPTARG} 273 ;; 274 t) 275 TEMPROOT=${OPTARG} 276 ;; 277 d) 278 TEMPROOT=${TEMPROOT}.`date +%m%d.%H.%M` --- 79 unchanged lines hidden (view full) --- 358# Assign the diff flag once so we will not have to keep testing it 359# 360DIFF_FLAG=${DIFF_FLAG:--u} 361 362# Assign the source directory 363# 364SOURCEDIR=${SOURCEDIR:-/usr/src/etc} 365 |
366# Check the width of the user's terminal 367# 368if [ -t 0 ]; then 369 w=$(stty -a | sed -ne 's/.* \([0-9][0-9]*\) columns.*/\1/p') 370 case "${w}" in 371 0|'') ;; # No-op, since the input is not valid 372 *) 373 case "${SCREEN_WIDTH}" in 374 '') SCREEN_WIDTH="${w}" ;; 375 "${w}") ;; # No-op, since they are the same 376 *) 377 echo -n "*** You entered ${SCREEN_WIDTH} as your screen width, but stty " 378 echo "thinks it is ${w}." 379 echo '' 380 echo -n "What would you like to use? [${w}] " 381 read SCREEN_WIDTH 382 ;; 383 esac 384 esac 385fi 386 |
|
364# Define what CVS $Id tag to look for to aid portability. 365# 366CVS_ID_TAG=FreeBSD 367 368case "${RERUN}" in 369'') 370 # Set up the loop to test for the existence of the 371 # temp root directory. --- 133 unchanged lines hidden (view full) --- 505 read ANY_KEY 506 unset ANY_KEY 507 ;; 508 esac 509 510 # Avoid comparing the motd if the user specifies it in .mergemasterrc 511 case "${IGNORE_MOTD}" in 512 '') ;; | 387# Define what CVS $Id tag to look for to aid portability. 388# 389CVS_ID_TAG=FreeBSD 390 391case "${RERUN}" in 392'') 393 # Set up the loop to test for the existence of the 394 # temp root directory. --- 133 unchanged lines hidden (view full) --- 528 read ANY_KEY 529 unset ANY_KEY 530 ;; 531 esac 532 533 # Avoid comparing the motd if the user specifies it in .mergemasterrc 534 case "${IGNORE_MOTD}" in 535 '') ;; |
513 *) rm ${TEMPROOT}/etc/motd | 536 *) rm -f ${TEMPROOT}/etc/motd |
514 ;; 515 esac 516 517 # Avoid trying to update MAKEDEV if /dev is on a devfs 518 if /sbin/sysctl vfs.devfs.generation > /dev/null 2>&1 ; then 519 rm -f ${TEMPROOT}/dev/MAKEDEV ${TEMPROOT}/dev/MAKEDEV.local 520 fi 521 522 ;; # End of the "RERUN" test 523esac 524 525# We really don't want to have to deal with these files, since 526# master.passwd is the real file that should be compared, then 527# the user should run pwd_mkdb if necessary. 528# 529rm -f ${TEMPROOT}/etc/spwd.db ${TEMPROOT}/etc/passwd ${TEMPROOT}/etc/pwd.db 530 531# We only need to compare things like freebsd.cf once | 537 ;; 538 esac 539 540 # Avoid trying to update MAKEDEV if /dev is on a devfs 541 if /sbin/sysctl vfs.devfs.generation > /dev/null 2>&1 ; then 542 rm -f ${TEMPROOT}/dev/MAKEDEV ${TEMPROOT}/dev/MAKEDEV.local 543 fi 544 545 ;; # End of the "RERUN" test 546esac 547 548# We really don't want to have to deal with these files, since 549# master.passwd is the real file that should be compared, then 550# the user should run pwd_mkdb if necessary. 551# 552rm -f ${TEMPROOT}/etc/spwd.db ${TEMPROOT}/etc/passwd ${TEMPROOT}/etc/pwd.db 553 554# We only need to compare things like freebsd.cf once |
532find ${TEMPROOT}/usr/obj -type f -delete | 555find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null |
533 534# Get ready to start comparing files 535 536# Check umask if not specified on the command line, 537# and we are not doing an autorun 538# 539if [ -z "${NEW_UMASK}" -a -z "${AUTO_RUN}" ]; then 540 USER_UMASK=`umask` --- 453 unchanged lines hidden --- | 556 557# Get ready to start comparing files 558 559# Check umask if not specified on the command line, 560# and we are not doing an autorun 561# 562if [ -z "${NEW_UMASK}" -a -z "${AUTO_RUN}" ]; then 563 USER_UMASK=`umask` --- 453 unchanged lines hidden --- |