r2656 - in jhalfs/branches/experimental: . optimize

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sat May 6 08:52:27 PDT 2006


Author: manuel
Date: 2006-05-06 09:52:27 -0600 (Sat, 06 May 2006)
New Revision: 2656

Modified:
   jhalfs/branches/experimental/master.sh
   jhalfs/branches/experimental/optimize/optimize_functions
Log:
Added user validation for optimize settings.

Modified: jhalfs/branches/experimental/master.sh
===================================================================
--- jhalfs/branches/experimental/master.sh	2006-05-06 14:39:04 UTC (rev 2655)
+++ jhalfs/branches/experimental/master.sh	2006-05-06 15:52:27 UTC (rev 2656)
@@ -481,6 +481,9 @@
 fi
 #
 
+# Validate optimize settings, if required
+[[ "$OPTIMIZE" != "0" ]] && validate_opt_settings
+
 # Prevents setting "-d /" by mistake.
 
 if [ $BUILDDIR = / ] ; then

Modified: jhalfs/branches/experimental/optimize/optimize_functions
===================================================================
--- jhalfs/branches/experimental/optimize/optimize_functions	2006-05-06 14:39:04 UTC (rev 2655)
+++ jhalfs/branches/experimental/optimize/optimize_functions	2006-05-06 15:52:27 UTC (rev 2656)
@@ -6,6 +6,33 @@
 
 
 #----------------------------------#
+validate_opt_settings() {          # Show optimize setting and wait user agreement
+#----------------------------------#
+  local OPT_VAR optVal
+  local -r PARAM_VALS='${config_param}: ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}'
+
+  echo -e "MAKEFLAGS: ${L_arrow}${BOLD}${MAKEFLAGS}${OFF}${R_arrow}\n"
+  echo -e "DEF_OPT_LVL: ${L_arrow}${BOLD}${DEF_OPT_LVL}${OFF}${R_arrow}\n"
+
+  for OPT_VAR in $ACTIVE_OPT_VARS ; do
+    eval optVal=\$${OPT_VAR}_${DEF_OPT_LVL}
+    echo -e "${OPT_VAR}: ${L_arrow}${BOLD}${optVal}${OFF}${R_arrow}"
+  done
+
+  echo -e "\nOverrided packages:"
+  cat optimize/opt_override
+  echo "${nl_}${SD_BORDER}${nl_}"
+
+  echo -n "Are you happy with these optimization settings? yes/no (no): "
+  read ANSWER
+  if [ x$ANSWER != "xyes" ] ; then
+    echo "${nl_}Fix the optimization options and rerun the script.${nl_}"
+    exit 1
+  fi
+  echo "${nl_}${SD_BORDER}${nl_}"
+}
+
+#----------------------------------#
 wrt_optimize() {                   # Apply pkg specific opt's to build
 #----------------------------------#
   local pkg=$1




More information about the alfs-log mailing list