[BACK]Return to install.sxxu CVS log [TXT][DIR] Up to [local] / openbsd / sxxu

Diff for /openbsd/sxxu/Attic/install.sxxu between version 1.11 and 1.16

version 1.11, 2010/04/22 21:36:24 version 1.16, 2010/04/23 00:01:30
Line 25 
Line 25 
 export PKG_PATH  export PKG_PATH
   
 do_pre() {  do_pre() {
     # nothing to do      echo 'Running post install from sxxu'
 }  }
   
 do_post() {  do_post() {
     # nothing to do      echo 'See /var/log/install.log for install messages.'
 }  }
   
   # Strip comments (and leading/trailing whitespace if IFS is set)
   # from a file and spew to stdout
   stripcom() {
       local _file="$1"
       local _line
   
       {
           while read _line ; do
               _line=${_line%%#*}              # strip comments
               test -z "$_line" && continue
               echo $_line
           done
       } < $_file
   }
   
   
 process_roles() {  process_roles() {
     local _oldpwd="${PWD}"      local _oldpwd="${PWD}"
   
Line 42 
Line 58 
     fi      fi
   
     local _roles      local _roles
       unset _roles
     set -A _roles      set -A _roles
     local _role      local _role
     while read _role; do      stripcom roles | while read _role; do
         if [ -n "${_role}" ]; then      if [ -n "${_role}" ]; then
                 _roles[${#_roles[@]}]="$_role"              _roles[${#_roles[@]}]="$_role"
         fi      fi
     done < roles      done
   
     for _role in "${_roles[@]}"; do      for _role in "${_roles[@]}"; do
         apply_role "$_role"          apply_role "$_role"
Line 63 
Line 80 
   
     echo ' ==> Setting PKG_PATH'      echo ' ==> Setting PKG_PATH'
     local _line      local _line
     while read _line; do      stripcom pkg_path | while read _line; do
         if [ -z "${PKG_PATH}" ]; then          if [ -z "${PKG_PATH}" ]; then
             PKG_PATH="$_line"              PKG_PATH="$_line"
         else          else
             PKG_PATH="${PKG_PATH}:${_line}"              PKG_PATH="${PKG_PATH}:${_line}"
         fi          fi
     done < pkg_path      done
   
     PKG_PATH=`eval echo $PKG_PATH`      PKG_PATH=`eval echo $PKG_PATH`
 }  }
   
Line 83 
Line 101 
   
         echo " ==> Running $_cmd $_args"          echo " ==> Running $_cmd $_args"
         local _line          local _line
         while read _line; do          stripcom "${_f}" | while read _line; do
             echo "  => ${_line}"              echo "  => ${_cmd} ${_args} ${_line}"
             eval ${_cmd} ${_args} ${_line}              eval ${_cmd} ${_args} ${_line}
         done < ${_f}          done
     done      done
 }  }
   
Line 101 
Line 119 
         # -N Always assume a forward patch.          # -N Always assume a forward patch.
         # -t Never prompt; assume the user is expert          # -t Never prompt; assume the user is expert
         # -p0 full path, always          # -p0 full path, always
         patch -N -t -p0 -d / < $_p          patch -N -t -p0 -d / < "$_p"
     done      done
 }  }
   
Line 123 
Line 141 
         return          return
     fi      fi
   
     echo "===> Applying ${_role}"      echo "===> Applying role ${_role}"
   
     cd "${_rolepwd}"      cd "${_rolepwd}"
     if [ -e ./siteXXrc ]; then      if [ -e ./siteXXrc ]; then
Line 156 
Line 174 
     exit      exit
 fi  fi
   
 do_pre  do_pre        2>&1 | /usr/bin/tee    /var/log/install.log
 process_roles  process_roles 2>&1 | /usr/bin/tee -a /var/log/install.log | grep '^...>'
 do_post  do_post       2>&1 | /usr/bin/tee -a /var/log/install.log

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.16

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>