diff options
author | dougb <dougb@FreeBSD.org> | 2009-12-11 23:03:35 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2009-12-11 23:03:35 +0000 |
commit | 333d839380081985fbd2214da8accf9b1bf91274 (patch) | |
tree | 81fc4ed58d0191e935b39e1507fd3f7f0cdcdefe | |
parent | 77e9a5ab4394203cc729e004be045bd2617c13fb (diff) | |
download | FreeBSD-src-333d839380081985fbd2214da8accf9b1bf91274.zip FreeBSD-src-333d839380081985fbd2214da8accf9b1bf91274.tar.gz |
Simplify handling of MTREEFILE relative to DESTDIR
Make the message about a missing MTREEFILE combined with -U
more informative
-rwxr-xr-x | usr.sbin/mergemaster/mergemaster.sh | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/mergemaster/mergemaster.sh b/usr.sbin/mergemaster/mergemaster.sh index 4d2ffc0..646f7ff 100755 --- a/usr.sbin/mergemaster/mergemaster.sh +++ b/usr.sbin/mergemaster/mergemaster.sh @@ -263,7 +263,7 @@ fi # Assign the location of the mtree database # -MTREEDB=${MTREEDB:-/var/db} +MTREEDB=${MTREEDB:-${DESTDIR}/var/db} MTREEFILE="${MTREEDB}/mergemaster.mtree" # Check the command line options @@ -351,9 +351,10 @@ fi case "${AUTO_UPGRADE}" in '') ;; # If the option is not set no need to run the test or warn the user *) - if [ ! -s "${DESTDIR}${MTREEFILE}" ]; then + if [ ! -s "${MTREEFILE}" ]; then echo '' - echo "*** Unable to find mtree database. Skipping auto-upgrade on this run." + echo "*** Unable to find mtree database (${MTREEFILE})." + echo " Skipping auto-upgrade on this run." echo " It will be created for the next run when this one is complete." echo '' press_to_continue @@ -463,9 +464,9 @@ MM_MAKE="make ${ARCHSTRING} -m ${SOURCEDIR}/share/mk" # Check DESTDIR against the mergemaster mtree database to see what # files the user changed from the reference files. # -if [ -n "${AUTO_UPGRADE}" -a -s "${DESTDIR}${MTREEFILE}" ]; then +if [ -n "${AUTO_UPGRADE}" -a -s "${MTREEFILE}" ]; then CHANGED=: - for file in `mtree -eqL -f ${DESTDIR}${MTREEFILE} -p ${DESTDIR}/ \ + for file in `mtree -eqL -f ${MTREEFILE} -p ${DESTDIR}/ \ 2>/dev/null | awk '($2 == "changed") {print $1}'`; do if [ -f "${DESTDIR}/$file" ]; then CHANGED="${CHANGED}${DESTDIR}/${file}:" @@ -1061,8 +1062,8 @@ echo "*** Comparison complete" if [ -s "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" - test -e "${DESTDIR}${MTREEFILE}" && unlink ${DESTDIR}${MTREEFILE} - mv ${MTREENEW} ${DESTDIR}${MTREEFILE} + test -e "${MTREEFILE}" && unlink ${MTREEFILE} + mv ${MTREENEW} ${MTREEFILE} fi echo '' |