From d9583fb3712a0f57fc8a99a39b74cbf7cbd441b6 Mon Sep 17 00:00:00 2001 From: delphij Date: Mon, 29 Jun 2015 18:44:15 +0000 Subject: [PATCH] MFC r284425: Skip src component if /usr/src is empty. Submitted by: kczekirda Reviewed by: cperciva, delphij, nwhitehorn, allanjude git-svn-id: svn://svn.freebsd.org/base/stable/10@284936 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.sbin/freebsd-update/freebsd-update.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 5a66f0ae9..47588a1fd 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -216,7 +216,15 @@ config_KeepModifiedMetadata () { # Add to the list of components which should be kept updated. config_Components () { for C in $@; do - COMPONENTS="${COMPONENTS} ${C}" + if [ "$C" = "src" ]; then + if [ -e /usr/src/COPYRIGHT ]; then + COMPONENTS="${COMPONENTS} ${C}" + else + echo "src component not installed, skipped" + fi + else + COMPONENTS="${COMPONENTS} ${C}" + fi done } @@ -2634,10 +2642,10 @@ install_unschg () { while read F; do if ! [ -e ${BASEDIR}/${F} ]; then continue + else + echo ${BASEDIR}/${F} fi - - chflags noschg ${BASEDIR}/${F} || return 1 - done < filelist + done < filelist | xargs chflags noschg || return 1 # Clean up rm filelist -- 2.45.0