changeset 189:c3a1f3f344be

Don't overwrite default values if set in environment. Add the name of the current selected profile in the title.
author "Nicolai Petri <nicolai@catpipe.net>"
date Wed, 10 Aug 2011 20:57:33 +0200
parents 0d9c107d4422
children 1b70fecf8ce5
files menu.sh
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/menu.sh	Tue Aug 02 00:26:35 2011 +0300
+++ b/menu.sh	Wed Aug 10 20:57:33 2011 +0200
@@ -34,7 +34,7 @@
 main_menu() {
 	TMPOPTIONSFILE=$(mktemp -t zrouter-build-menu)
 	trap "${RM} -f ${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15
-	${SH} -c "${DIALOG} --title \"ZRouter build menu\" --menu ' ' 13 60 6 \
+	${SH} -c "${DIALOG} --title \"ZRouter build menu ${PROFILE_NAME}\" --menu ' ' 13 60 6 \
 	    Device \"Select the target device\" \
 	    Targets \"Select the build targets\" \
 	    Paths \"Set the paths of sources and build objects\" \
@@ -271,6 +271,7 @@
 FREEBSD_SRC_TREE="${FREEBSD_SRC_TREE}"
 OBJ_DIR="${OBJ_DIR}"
 EOF
+	PROFILE_NAME="(${PROFILE})"
 	return 0
 }
 
@@ -320,6 +321,7 @@
 		    \"\nThere is a problem with the selected profile (not a file ?).\nThe file could not be read.\" 8 65"
 		return 1
 	fi
+	PROFILE_NAME="(${PROFILE})"
 	return 0
 }
 
@@ -332,7 +334,7 @@
 	else
 		BOX_SIZE=$(($BOX_SIZE + 10))
 	fi
-	${SH} -c "${DIALOG} --title \"ZRouter build settings\" --yesno \
+	${SH} -c "${DIALOG} --title \"ZRouter build settings ${PROFILE_NAME}\" --yesno \
 	    \"\nPROFILE: ${PROFILE} \
 	    \nTARGET_PAIR: ${TARGET_PAIR} \
 	    \nTARGETS: ${TARGETS} \
@@ -352,12 +354,13 @@
 #
 # Set defaults
 #
-BUILD_PROFILES_DIR=build_profiles
-FREEBSD_SRC_TREE="/usr/src"
-OBJ_DIR="/usr/obj"
-TARGET_PAIR="NONE"
-PROFILE="NONE"
-TARGETS="kernel.oldlzma.uboot rootfs.iso.ulzma"
+: ${BUILD_PROFILES_DIR:="build_profiles"}
+: ${FREEBSD_SRC_TREE:="/usr/src"}
+: ${OBJ_DIR:="/usr/obj"}
+: ${TARGET_PAIR:="NONE"}
+: ${PROFILE:="NONE"}
+: ${TARGETS:="kernel.oldlzma.uboot rootfs.iso.ulzma"}
+PROFILE_NAME="(${PROFILE})"
 
 #
 # Tools paths