[BACK]Return to build.sh CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/build.sh between version 1.320 and 1.321

version 1.320, 2017/10/08 00:45:25 version 1.321, 2017/10/08 01:05:13
Line 952  setmakeenv()
Line 952  setmakeenv()
         eval "$1='$2'; export $1"          eval "$1='$2'; export $1"
         makeenv="${makeenv} $1"          makeenv="${makeenv} $1"
 }  }
   safe_setmakeenv()
   {
           case "$1" in
   
           #       Look for any vars we want to prohibit here, like:
           # Bad | Dangerous)      usage "Cannot override $1 with -V";;
   
           # That first char is OK has already been verified.
           *[!A-Za-z0-9_]*)        usage "Bad variable name (-V): '$1'";;
           esac
           setmakeenv "$@"
   }
   
 unsetmakeenv()  unsetmakeenv()
 {  {
         eval "unset $1"          eval "unset $1"
         makeenv="${makeenv} $1"          makeenv="${makeenv} $1"
 }  }
   safe_unsetmakeenv()
   {
           case "$1" in
   
           #       Look for any vars user should not be able to unset
           # Needed | Must_Have)   usage "Variable $1 cannot be unset";;
   
           [!A-Za-z_]* | *[!A-Za-z0-9_]*)  usage "Bad variable name (-Z): '$1'";;
           esac
           unsetmakeenv "$1"
   }
   
 # Given a variable name in $1, modify the variable in place as follows:  # Given a variable name in $1, modify the variable in place as follows:
 # For each space-separated word in the variable, call resolvepath.  # For each space-separated word in the variable, call resolvepath.
Line 1259  parseoptions()
Line 1282  parseoptions()
                         eval ${optargcmd}                          eval ${optargcmd}
                         case "${OPTARG}" in                          case "${OPTARG}" in
                     # XXX: consider restricting which variables can be changed?                      # XXX: consider restricting which variables can be changed?
                         [a-zA-Z_][a-zA-Z_0-9]*=*)                          [a-zA-Z_]*=*)
                                 setmakeenv "${OPTARG%%=*}" "${OPTARG#*=}"                                  safe_setmakeenv "${OPTARG%%=*}" "${OPTARG#*=}"
                                   ;;
                           [a-zA-Z_]*)
                                   safe_setmakeenv "${OPTARG}" ""
                                 ;;                                  ;;
                         *)                          *)
                                 usage "-V argument must be of the form 'var=[value]'"                                  usage "-V argument must be of the form 'var=[value]'"
Line 1294  parseoptions()
Line 1320  parseoptions()
                 -Z)                  -Z)
                         eval ${optargcmd}                          eval ${optargcmd}
                     # XXX: consider restricting which variables can be unset?                      # XXX: consider restricting which variables can be unset?
                         unsetmakeenv "${OPTARG}"                          safe_unsetmakeenv "${OPTARG}"
                         ;;                          ;;
   
                 --)                  --)

Legend:
Removed from v.1.320  
changed lines
  Added in v.1.321

CVSweb <webmaster@jp.NetBSD.org>