Move where the configuration file is sourced if '-c'

is specified.  If the configuration file does not exist,
proceed with the default options instead of exiting.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Glen Barber 2015-05-06 14:59:16 +00:00
parent 43eee0751f
commit 81cfc2845b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/release-arm-redux/; revision=282544

View File

@ -328,12 +328,6 @@ main() {
case ${opt} in
c)
RELEASECONF="${OPTARG}"
if [ ! -e "${RELEASECONF}" ]; then
echo "ERROR: Configuration file ${RELEASECONF} does not exist."
exit 1
fi
# Source the specified configuration file for overrides
. ${RELEASECONF}
;;
\?)
usage
@ -341,6 +335,14 @@ main() {
esac
done
shift $(($OPTIND - 1))
if [ ! -z "${RELEASECONF}" ]; then
if [ -e "${RELEASECONF}" ]; then
. ${RELEASECONF}
else
echo "Nonexistent configuration file: ${RELEASECONF}"
echo "Using default build environment."
fi
fi
env_check
trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit
chroot_setup