Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 May 2012 15:06:05 +0000 (UTC)
From:      Josh Paetzel <jpaetzel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r235443 - stable/9/usr.sbin/pc-sysinstall/backend
Message-ID:  <201205141506.q4EF65CV038276@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jpaetzel
Date: Mon May 14 15:06:04 2012
New Revision: 235443
URL: http://svn.freebsd.org/changeset/base/235443

Log:
  MFC: 234985
  
  Fix parsing values which contain multiple "=" signs.
  
  Submitted by:	glarkin
  Sponsored by:	iXsystems

Modified:
  stable/9/usr.sbin/pc-sysinstall/backend/functions-parse.sh
Directory Properties:
  stable/9/usr.sbin/pc-sysinstall/   (props changed)

Modified: stable/9/usr.sbin/pc-sysinstall/backend/functions-parse.sh
==============================================================================
--- stable/9/usr.sbin/pc-sysinstall/backend/functions-parse.sh	Mon May 14 15:05:18 2012	(r235442)
+++ stable/9/usr.sbin/pc-sysinstall/backend/functions-parse.sh	Mon May 14 15:06:04 2012	(r235443)
@@ -33,7 +33,7 @@ get_value_from_string()
 {
   if [ -n "${1}" ]
   then
-    export VAL="`echo ${1} | cut -d '=' -f 2-15`"
+    export VAL="`echo ${1} | cut -d '=' -f 2-`"
   else
     echo "Error: Did we forgot to supply a string to parse?"
     exit 1
@@ -45,7 +45,7 @@ get_value_from_cfg_with_spaces()
 {
   if [ -n "${1}" ]
   then
-    export VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2-15`
+    export VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2-`
   else
     exit_err "Error: Did we forgot to supply a setting to grab?"
   fi
@@ -57,7 +57,7 @@ get_value_from_cfg()
 {
   if [ -n "${1}" ]
   then
-    export VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2-15 | tr -d ' '`
+    export VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2- | tr -d ' '`
   else
     exit_err "Error: Did we forgot to supply a setting to grab?"
   fi
@@ -71,7 +71,7 @@ if_check_value_exists()
   then
     # Get the first occurance of the setting from the config, strip out whitespace
 
-    VAL=`grep "^${1}" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '`
+    VAL=`grep "^${1}" ${CFGF} | head -n 1 | cut -d '=' -f 2- | tr -d ' '`
     if [ -z "${VAL}" ]
     then
       # This value doesn't exist, lets return
@@ -104,7 +104,7 @@ check_value()
   if [ -n "${1}" -a -n "${2}" ]
   then
     # Get the first occurance of the setting from the config, strip out whitespace
-    VAL=`grep "^${1}" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '`
+    VAL=`grep "^${1}" ${CFGF} | head -n 1 | cut -d '=' -f 2- | tr -d ' '`
     VALID="1"
     for i in ${2}
     do
@@ -133,7 +133,7 @@ file_sanity_check()
       grep -q "^${i}=" $CFGF 2>/dev/null
       if [ $? -eq 0 ]
       then
-        LN=`grep "^${i}=" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '`
+        LN=`grep "^${i}=" ${CFGF} | head -n 1 | cut -d '=' -f 2- | tr -d ' '`
         if [ -z "${LN}" ]
         then
           echo "Error: Config fails sanity test! ${i}= is empty"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205141506.q4EF65CV038276>