mergemaster.sh (192230) | mergemaster.sh (193853) |
---|---|
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-2009 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-2009 Douglas Barton 9# DougB@FreeBSD.org 10 |
11# $FreeBSD: head/usr.sbin/mergemaster/mergemaster.sh 192230 2009-05-16 22:22:31Z dougb $ | 11# $FreeBSD: head/usr.sbin/mergemaster/mergemaster.sh 193853 2009-06-09 20:20:08Z 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 [-scrvahipFCPU]' 19 echo ' [-m /path] [-t /path] [-d] [-u N] [-w N] [-A arch] [-D /path]' --- 328 unchanged lines hidden (view full) --- 348fi 349 350# Check for the mtree database in DESTDIR 351case "${AUTO_UPGRADE}" in 352'') ;; # If the option is not set no need to run the test or warn the user 353*) 354 if [ ! -s "${DESTDIR}${MTREEFILE}" ]; then 355 echo '' | 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 [-scrvahipFCPU]' 19 echo ' [-m /path] [-t /path] [-d] [-u N] [-w N] [-A arch] [-D /path]' --- 328 unchanged lines hidden (view full) --- 348fi 349 350# Check for the mtree database in DESTDIR 351case "${AUTO_UPGRADE}" in 352'') ;; # If the option is not set no need to run the test or warn the user 353*) 354 if [ ! -s "${DESTDIR}${MTREEFILE}" ]; then 355 echo '' |
356 echo "*** Unable to find mtree database. Skipping auto-upgrade." | 356 echo "*** Unable to find mtree database. Skipping auto-upgrade on this run." 357 echo " It will be created for the next run when this one is complete." |
357 echo '' 358 press_to_continue 359 unset AUTO_UPGRADE 360 fi 361 ;; 362esac 363 364if [ -e "${DESTDIR}/etc/fstab" ]; then --- 304 unchanged lines hidden (view full) --- 669# or spwd.db. Instead, we want to compare the text versions, and run *_mkdb. 670# Prompt the user to do so below, as needed. 671# 672rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd 673 674# We only need to compare things like freebsd.cf once 675find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null 676 | 358 echo '' 359 press_to_continue 360 unset AUTO_UPGRADE 361 fi 362 ;; 363esac 364 365if [ -e "${DESTDIR}/etc/fstab" ]; then --- 304 unchanged lines hidden (view full) --- 670# or spwd.db. Instead, we want to compare the text versions, and run *_mkdb. 671# Prompt the user to do so below, as needed. 672# 673rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd 674 675# We only need to compare things like freebsd.cf once 676find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null 677 |
677# Delete 0 length files to make the mtree database as small as possible. | 678# Delete stuff we do not need to keep the mtree database small, 679# and to make the actual comparison faster. 680find ${TEMPROOT}/usr -type l -delete 2>/dev/null |
678find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null | 681find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null |
682find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null |
|
679 680# Build the mtree database in a temporary location. 681MTREENEW=`mktemp -t mergemaster.mtree` 682case "${PRE_WORLD}" in 683'') mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null 684 ;; 685*) # We don't want to mess with the mtree database on a pre-world run. 686 ;; --- 271 unchanged lines hidden (view full) --- 958fi 959 960cd "${TEMPROOT}" 961 962if [ -r "${MM_PRE_COMPARE_SCRIPT}" ]; then 963 . "${MM_PRE_COMPARE_SCRIPT}" 964fi 965 | 683 684# Build the mtree database in a temporary location. 685MTREENEW=`mktemp -t mergemaster.mtree` 686case "${PRE_WORLD}" in 687'') mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null 688 ;; 689*) # We don't want to mess with the mtree database on a pre-world run. 690 ;; --- 271 unchanged lines hidden (view full) --- 962fi 963 964cd "${TEMPROOT}" 965 966if [ -r "${MM_PRE_COMPARE_SCRIPT}" ]; then 967 . "${MM_PRE_COMPARE_SCRIPT}" 968fi 969 |
966# Using -size +0 avoids uselessly checking the empty log files created 967# by ${SOURCEDIR}/etc/Makefile and the device entries in ./dev, but does 968# check the scripts in ./dev, as we'd like (assuming no devfs of course). 969# 970for COMPFILE in `find . -type f -size +0`; do | 970for COMPFILE in `find . -type f`; do |
971 972 # First, check to see if the file exists in DESTDIR. If not, the 973 # diff_loop function knows how to handle it. 974 # 975 if [ ! -e "${DESTDIR}${COMPFILE#.}" ]; then 976 case "${AUTO_RUN}" in 977 '') 978 diff_loop --- 294 unchanged lines hidden --- | 971 972 # First, check to see if the file exists in DESTDIR. If not, the 973 # diff_loop function knows how to handle it. 974 # 975 if [ ! -e "${DESTDIR}${COMPFILE#.}" ]; then 976 case "${AUTO_RUN}" in 977 '') 978 diff_loop --- 294 unchanged lines hidden --- |